aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.threads
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2008-07-27 21:12:40 +0000
committerDaniel Jacobowitz <drow@false.org>2008-07-27 21:12:40 +0000
commit57380f4e0bbdfa396ed068db6bd867b4fafd9925 (patch)
treec55eb8d7d1ab1052274749c38291df076a980cb2 /gdb/testsuite/gdb.threads
parente09490f18a66aa4d02a2f5b7a75d2530caf09d5b (diff)
downloadgdb-57380f4e0bbdfa396ed068db6bd867b4fafd9925.zip
gdb-57380f4e0bbdfa396ed068db6bd867b4fafd9925.tar.gz
gdb-57380f4e0bbdfa396ed068db6bd867b4fafd9925.tar.bz2
* linux-nat.c (resume_callback): Add more debugging output.
(linux_nat_has_pending_sigint): New function, based on linux_nat_has_pending. (set_ignore_sigint, maybe_clear_ignore_sigint): New functions. (stop_wait_callback): Remove flush_mask handling. Honor ignore_sigint. Call maybe_clear_ignore_sigint. Pass NULL to recursive calls. (linux_nat_has_pending, flush_callback): Remove. (linux_nat_filter_event): Check for ignore_sigint. (linux_nat_wait): Remove flush_mask support and call to flush_callback. Use set_ignore_sigint and maybe_clear_ignore_sigint. * linux-nat.h (struct lwp_info): Add ignore_sigint field. * gdb.threads/manythreads.exp: Use remote_expect instead of after. Add a test for duplicated SIGINTs.
Diffstat (limited to 'gdb/testsuite/gdb.threads')
-rw-r--r--gdb/testsuite/gdb.threads/manythreads.exp34
1 files changed, 32 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.threads/manythreads.exp b/gdb/testsuite/gdb.threads/manythreads.exp
index a92d049..2bdedf0 100644
--- a/gdb/testsuite/gdb.threads/manythreads.exp
+++ b/gdb/testsuite/gdb.threads/manythreads.exp
@@ -58,8 +58,11 @@ gdb_test_multiple "continue" "first continue" {
}
}
+# Wait one second. This is better than the TCL "after" command, because
+# we don't lose GDB's output while we do it.
+remote_expect host 1 { timeout { } }
+
# Send a Ctrl-C and verify that we can do info threads and continue
-after 1000
send_gdb "\003"
set message "stop threads 1"
gdb_test_multiple "" "stop threads 1" {
@@ -110,8 +113,35 @@ gdb_test_multiple "continue" "second continue" {
}
}
+# Wait another second. If the program stops on its own, GDB has failed
+# to handle duplicate SIGINTs sent to multiple threads.
+set failed 0
+remote_expect host 1 {
+ -re "\\\[New \[^\]\]*\\\]\r\n" {
+ exp_continue -continue_timer
+ }
+ -re "\\\[\[^\]\]* exited\\\]\r\n" {
+ exp_continue -continue_timer
+ }
+ -re "Thread \[^\n\]* executing\r\n" {
+ exp_continue -continue_timer
+ }
+ -re "Program received signal SIGINT.*$gdb_prompt $" {
+ if { $failed == 0 } {
+ fail "check for duplicate SIGINT"
+ }
+ send_gdb "continue\n"
+ set failed 1
+ exp_continue
+ }
+ timeout {
+ if { $failed == 0 } {
+ pass "check for duplicate SIGINT"
+ }
+ }
+}
+
# Send another Ctrl-C and verify that we can do info threads and quit
-after 1000
send_gdb "\003"
set message "stop threads 2"
gdb_test_multiple "" "stop threads 2" {