--- a/gdb/probe.c
+++ b/gdb/probe.c
@@ -980,4 +980,6 @@ OBJECT matches the executable or shared library name.\n\
 If you do not specify any argument then the command will ignore\n\
 all defined probes.  Only supported for SystemTap probes"),
           &maintenancelist);
+
+  ignore_probes_command ("libc ^longjmp$", 0);
 }
...
using the RFC patch introducing the "maint ignore-probes" command (
https://sourceware.org/pipermail/gdb-patches/2022-December/194535.html ).

The gdb.base/longjmp.exp test-case has been updated to accept the new
behaviour.

I found these regressions (only first in test-case listed):
...
FAIL: gdb.base/longjmp-until-in-main.exp: until $line, in main
FAIL: gdb.base/premature-dummy-frame-removal.exp: p some_func ()
FAIL: gdb.base/stale-infcall.exp: test system longjmp tracking support
...
These will need to be updated to accept the new behaviour.  Since this is an
RFC, I've left that for now.

Suggested-By: Simon Marchi <simon.marchi@efficios.com>
---
 gdb/infrun.c                       |  3 ++-
 gdb/testsuite/gdb.base/longjmp.exp | 14 ++++++++++++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/gdb/infrun.c b/gdb/infrun.c
index c67458b30b6..51bc72dae5f 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -6650,7 +6650,8 @@ process_event_stop_test (struct execution_control_state *ecs)
 	    {
 	      infrun_debug_printf ("BPSTAT_WHAT_SET_LONGJMP_RESUME "
 				   "(!gdbarch_get_longjmp_target)");
-	      keep_going (ecs);
+	      warning (_("GDB can't determine the longjmp target"));
+	      end_stepping_range (ecs);
 	      return;
 	    }
 
diff --git a/gdb/testsuite/gdb.base/longjmp.exp b/gdb/testsuite/gdb.base/longjmp.exp
index 0f78304a14a..c3f46f06698 100644
--- a/gdb/testsuite/gdb.base/longjmp.exp
+++ b/gdb/testsuite/gdb.base/longjmp.exp
@@ -81,6 +81,9 @@ set re_cannot_insert_bp \
 	 "Cannot insert breakpoint $decimal\\." \
 	 "Cannot access memory at address $hex"]
 
+set re_no_longjmp_target \
+    "warning: GDB can't determine the longjmp target"
+
 #
 # Pattern 1 - simple longjmp.
 #
@@ -111,7 +114,7 @@ with_test_prefix "pattern 1" {
 	    gdb_test "next" "resumes\\+\\+.*" "next into else block"
 	    gdb_test "next" "miss_step_1.*" "next into safety net"
 	}
-	-re "miss_step_1.*$gdb_prompt $" {
+	-re -wrap "\r\n$re_no_longjmp_target\r\n.*" {
 	    if { $have_longjmp_probe } {
 		fail $gdb_test_name
 	    } else {
@@ -158,7 +161,7 @@ with_test_prefix "pattern 2" {
 	    gdb_test "next" "resumes\\+\\+.*" "next into else block"
 	    gdb_test "next" "miss_step_2.*" "next into safety net"
 	}
-	-re "miss_step_2.*$gdb_prompt $" {
+	-re -wrap "\r\n$re_no_longjmp_target\r\n.*" {
 	    if { $have_longjmp_probe } {
 		fail $gdb_test_name
 	    } else {
@@ -194,6 +197,13 @@ with_test_prefix "pattern 3" {
 	-re -wrap "longjmp caught.*" {
 	    pass $gdb_test_name
 	}
+	-re -wrap "\r\n$re_no_longjmp_target\r\n.*" {
+	    if { $have_longjmp_probe } {
+		fail $gdb_test_name
+	    } else {
+		kfail $gdb_test_name "gdb/26967"
+	    }
+	}
 	-re -wrap "\r\n$re_cannot_insert_bp\r\n.*" {
 	    if { $have_longjmp_probe } {
 		fail $gdb_test_name
