diff options
Diffstat (limited to 'gdb/testsuite/gdb.threads')
-rw-r--r-- | gdb/testsuite/gdb.threads/leader-exit.c | 3 | ||||
-rw-r--r-- | gdb/testsuite/gdb.threads/leader-exit.exp | 20 |
2 files changed, 22 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.threads/leader-exit.c b/gdb/testsuite/gdb.threads/leader-exit.c index 287388a..0df1adc 100644 --- a/gdb/testsuite/gdb.threads/leader-exit.c +++ b/gdb/testsuite/gdb.threads/leader-exit.c @@ -29,7 +29,8 @@ start (void *arg) i = pthread_join (main_thread, NULL); assert (i == 0); - return arg; /* break-here */ + sleep (10); /* break-here */ + return arg; } int diff --git a/gdb/testsuite/gdb.threads/leader-exit.exp b/gdb/testsuite/gdb.threads/leader-exit.exp index d213d55..2d6b723 100644 --- a/gdb/testsuite/gdb.threads/leader-exit.exp +++ b/gdb/testsuite/gdb.threads/leader-exit.exp @@ -34,3 +34,23 @@ gdb_continue_to_breakpoint "break-here" ".* break-here .*" gdb_test "info threads" \ "\r\n\[ \t\]*Id\[ \t\]+Target\[ \t\]+Id\[ \t\]+Frame\[ \t\]*\r\n\\* 2 *Thread \[^\r\n\]* at \[^\r\n\]*" \ "Single thread has been left" + +# Test that ctrl-c works even if the leader has exited. + +set test "continue for ctrl-c" +gdb_test_multiple "continue" $test { + -re "Continuing" { + pass $test + } +} + +sleep 1 + +send_gdb "\003" + +set test "caught interrupt" +gdb_test_multiple "" $test { + -re "Program received signal SIGINT.*$gdb_prompt $" { + pass $test + } +} |