aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base
diff options
context:
space:
mode:
authorPhilippe Waroquiers <philippe@sourceware.org>2013-05-03 19:16:56 +0000
committerPhilippe Waroquiers <philippe@sourceware.org>2013-05-03 19:16:56 +0000
commit96f7d3f1666830257f8942c168640ad8cc8b0ea0 (patch)
tree35e928066a65da99419fc053b3da25622d0dadd3 /gdb/testsuite/gdb.base
parent1ebff1fdfdbf851157c55915a6a87ba3b3902823 (diff)
downloadgdb-96f7d3f1666830257f8942c168640ad8cc8b0ea0.zip
gdb-96f7d3f1666830257f8942c168640ad8cc8b0ea0.tar.gz
gdb-96f7d3f1666830257f8942c168640ad8cc8b0ea0.tar.bz2
Fix to handle properly 'catch signal SIGINT' and SIGTRAP
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r--gdb/testsuite/gdb.base/catch-signal.c2
-rw-r--r--gdb/testsuite/gdb.base/catch-signal.exp13
2 files changed, 15 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/catch-signal.c b/gdb/testsuite/gdb.base/catch-signal.c
index d128958..36d34d2 100644
--- a/gdb/testsuite/gdb.base/catch-signal.c
+++ b/gdb/testsuite/gdb.base/catch-signal.c
@@ -42,5 +42,7 @@ main ()
raise (SIGHUP); /* third HUP */
raise (SIGHUP); /* fourth HUP */
+
+ raise (SIGINT); /* first INT */
}
diff --git a/gdb/testsuite/gdb.base/catch-signal.exp b/gdb/testsuite/gdb.base/catch-signal.exp
index 2ca4dff..e7179a0 100644
--- a/gdb/testsuite/gdb.base/catch-signal.exp
+++ b/gdb/testsuite/gdb.base/catch-signal.exp
@@ -71,6 +71,19 @@ proc test_catch_signal {signame} {
gdb_breakpoint ${srcfile}:[gdb_get_line_number "fourth HUP"]
gdb_continue_to_breakpoint "fourth HUP"
delete_breakpoints
+
+ # Verify an internal signal used by gdb is properly caught.
+ gdb_breakpoint ${srcfile}:[gdb_get_line_number "first INT"]
+ gdb_continue_to_breakpoint "first INT"
+ set test "override SIGINT to catch"
+ gdb_test "handle SIGINT nostop print nopass" \
+ "SIGINT.*No.*Yes.*No.*" \
+ "$test" \
+ "SIGINT is used by the debugger.*Are you sure you want to change it.*y or n.*" \
+ y
+ gdb_test "catch signal SIGINT" "Catchpoint .*"
+ gdb_test "continue" "Catchpoint .* SIGINT.*"
+
}
}