Index: gdb/testsuite/gdb.base/catch-signal-fork.exp |
diff --git a/gdb/testsuite/gdb.base/siginfo-infcall.exp b/gdb/testsuite/gdb.base/catch-signal-fork.exp |
similarity index 50% |
copy from gdb/testsuite/gdb.base/siginfo-infcall.exp |
copy to gdb/testsuite/gdb.base/catch-signal-fork.exp |
index d84cd264e4f624a16a23451bc5e2f6ca26868152..cb4b91891a144e80c07a95e1a1f5cb511ec90194 100644 |
--- a/gdb/testsuite/gdb.base/siginfo-infcall.exp |
+++ b/gdb/testsuite/gdb.base/catch-signal-fork.exp |
@@ -1,4 +1,4 @@ |
-# Copyright 2010-2012 Free Software Foundation, Inc. |
+# Copyright 2012-2013 Free Software Foundation, Inc. |
# This program is free software; you can redistribute it and/or modify |
# it under the terms of the GNU General Public License as published by |
@@ -14,34 +14,30 @@ |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
if [target_info exists gdb,nosignals] { |
- verbose "Skipping siginfo-infcall.exp because of nosignals." |
+ verbose "Skipping catch-signal-fork.exp because of nosignals." |
continue |
} |
-set testfile siginfo-infcall |
-set srcfile ${testfile}.c |
-set executable ${testfile} |
-if { [prepare_for_testing ${testfile}.exp $executable] } { |
+standard_testfile |
+ |
+if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} { |
return -1 |
} |
-if ![runto_main] { |
+if {![runto_main]} { |
return -1 |
} |
-gdb_breakpoint "pass" |
-gdb_breakpoint "fail" |
- |
-gdb_test "continue" "Program received signal SIGUSR1, .*" "continue to SIGUSR1" |
+# Test "catch signal SIGHUP" |
+gdb_test "catch signal SIGHUP" "Catchpoint .*" |
+gdb_breakpoint ${srcfile}:[gdb_get_line_number "first HUP"] |
+gdb_breakpoint ${srcfile}:[gdb_get_line_number "fork loop"] |
-gdb_test "p callme ()" " = 42" |
+gdb_continue_to_breakpoint "first HUP" |
+gdb_test "continue" "Catchpoint .*" |
-set test "continue to the handler" |
-gdb_test_multiple "continue" $test { |
- -re "Breakpoint \[0-9\]+,\[^\r\n\]* pass .*\r\n$gdb_prompt $" { |
- pass $test |
- } |
- -re "Breakpoint \[0-9\]+,\[^\r\n\]* fail .*\r\n$gdb_prompt $" { |
- fail $test |
- } |
-} |
+# Test interaction with fork. |
+# This used to cause a gdb_assert in the code detaching the |
+# breakpoints for the child. |
+gdb_continue_to_breakpoint "fork loop" |
+gdb_test "continue" "Catchpoint .* SIGHUP.*" "got SIGHUP after fork" |