gdb/testsuite/ * lib/gdb.exp (single_step_to_signal_handler_p): New. * gdb.base/kill-after-signal.exp: Skip if target supports single step to signal handler. diff --git a/gdb/testsuite/gdb.base/kill-after-signal.exp b/gdb/testsuite/gdb.base/kill-after-signal.exp index eecad2e..f7086fc 100644 --- a/gdb/testsuite/gdb.base/kill-after-signal.exp +++ b/gdb/testsuite/gdb.base/kill-after-signal.exp @@ -14,6 +14,12 @@ # along with this program. If not, see . set testfile "kill-after-signal" + +if { ![single_step_to_signal_handler_p] } { + untested ${testfile}.exp + return +} + if [prepare_for_testing ${testfile}.exp ${testfile}] { return -1 } diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index ef5ad5c..b967a97 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -1527,6 +1527,21 @@ proc support_complex_tests {} { return $support_complex_tests_saved } +# Return 1 if target hardware or OS supports single stepping to single handler, +# otherwise, return 0. + +proc single_step_to_signal_handler_p {} { + + # Targets don't have hardware single step. On these targets, when a signal + # is delivered during software single step, gdb is unable to determine the + # next instruction addresses, because start of signal handler is one of them. + if { [istarget "arm*-*-*"] || [istarget "mips*-*-*"] } { + return 0 + } + + return 1 +} + # Return 1 if target is ILP32. # This cannot be decided simply from looking at the target string, # as it might depend on externally passed compiler options like -m64.