From 57380f4e0bbdfa396ed068db6bd867b4fafd9925 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Sun, 27 Jul 2008 21:12:40 +0000 Subject: * 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. --- gdb/testsuite/gdb.threads/manythreads.exp | 34 +++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'gdb/testsuite/gdb.threads') 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" { -- cgit v1.1