gdb/testsuite/
authorYao Qi <yao@codesourcery.com>
Sun, 18 Sep 2011 02:36:27 +0000 (02:36 +0000)
committerYao Qi <yao@codesourcery.com>
Sun, 18 Sep 2011 02:36:27 +0000 (02:36 +0000)
* lib/gdb.exp (can_single_step_to_signal_handler): New.
* gdb.base/kill-after-signal.exp: Call it.  Skip if target doesn't
support single step to signal handler.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/kill-after-signal.exp
gdb/testsuite/lib/gdb.exp

index e48d7c24facafa2f088eee7326d7c68feb01303b..132351a96511f6112270707f92af912987838422 100644 (file)
@@ -1,3 +1,9 @@
+2011-09-17  Yao Qi  <yao@codesourcery.com>
+
+       * lib/gdb.exp (can_single_step_to_signal_handler): New.
+       * gdb.base/kill-after-signal.exp: Call it.  Skip if target doesn't
+       support single step to signal handler.
+
 2011-09-17  Yao Qi  <yao@codesourcery.com>
 
        * gdb.base/disp-step-fork.c: New.
index eecad2ed293eb05b60457282f8b06ceda0187df7..8bb06590853e8d82f299ec8cc942a60e97d30edf 100644 (file)
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 set testfile "kill-after-signal"
+
+if { ![can_single_step_to_signal_handler] } {
+    untested ${testfile}.exp
+    return
+}
+
 if [prepare_for_testing ${testfile}.exp ${testfile}] {
     return -1
 }
index b22e32262d61344f856e4e827b2bd914c9ebb5a7..1476c1916513e1d052c50de71926916196d1a3e1 100644 (file)
@@ -1527,6 +1527,22 @@ proc support_complex_tests {} {
     return $support_complex_tests_saved
 }
 
+# Return 1 if target hardware or OS supports single stepping to signal
+# handler, otherwise, return 0.
+
+proc can_single_step_to_signal_handler {} {
+
+    # 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.