diff options
Diffstat (limited to 'gdb/testsuite/gdb.threads')
-rw-r--r-- | gdb/testsuite/gdb.threads/execl.exp | 11 | ||||
-rw-r--r-- | gdb/testsuite/gdb.threads/print-threads.exp | 62 | ||||
-rw-r--r-- | gdb/testsuite/gdb.threads/queue-signal.exp | 12 | ||||
-rw-r--r-- | gdb/testsuite/gdb.threads/signal-command-multiple-signals-pending.exp | 6 |
4 files changed, 48 insertions, 43 deletions
diff --git a/gdb/testsuite/gdb.threads/execl.exp b/gdb/testsuite/gdb.threads/execl.exp index db4c5d2..68341be 100644 --- a/gdb/testsuite/gdb.threads/execl.exp +++ b/gdb/testsuite/gdb.threads/execl.exp @@ -54,21 +54,18 @@ gdb_test_no_output "delete 2" gdb_test "continue" ".*Breakpoint 1, main.*" \ "continue across exec" -gdb_test "info threads" ".*" "info threads after exec" - -set test "info threads after exec" -gdb_test_multiple "info threads" "$test" { +gdb_test_multiple "info threads" "info threads after exec" { -re "2 *Thread .*$gdb_prompt $" { # Old threads left behind. - fail "$test" + fail "$gdb_test_name" } -re "4 *Thread .*$gdb_prompt $" { # New threads registered. - fail "$test" + fail "$gdb_test_name" } -re "$gdb_prompt $" { # Target doesn't register the main thread, pass for now. - pass "$test" + pass "$gdb_test_name" } } diff --git a/gdb/testsuite/gdb.threads/print-threads.exp b/gdb/testsuite/gdb.threads/print-threads.exp index 16b4b10..2693b6b 100644 --- a/gdb/testsuite/gdb.threads/print-threads.exp +++ b/gdb/testsuite/gdb.threads/print-threads.exp @@ -45,38 +45,40 @@ gdb_test "shell stty intr '^C'" ".*" proc test_all_threads { name kill } { global gdb_prompt inferior_exited_re - set i 0 - set j 0 - gdb_test_multiple "continue" "all threads ran once" { - -re "Breakpoint \[0-9\]+, thread_function \\(arg=.*\\) at .*print-threads.c:\[0-9\]+.*$gdb_prompt" { - set i [expr $i + 1] - pass "hit thread_function breakpoint, $i ($name)" - send_gdb "continue\n" - exp_continue - } - -re "Breakpoint \[0-9\]+, .* kill \\(.*\\) .*$gdb_prompt" { - set j [expr $j + 1] - if { $kill == 1 } { - pass "hit kill breakpoint, $j ($name)" - } else { - fail "hit kill breakpoint, $j ($name) (unexpected)" + with_test_prefix $name { + set i 0 + set j 0 + gdb_test_multiple "continue" "all threads ran once" { + -re "Breakpoint \[0-9\]+, thread_function \\(arg=.*\\) at .*print-threads.c:\[0-9\]+.*$gdb_prompt" { + set i [expr $i + 1] + pass "hit thread_function breakpoint, $i" + send_gdb "continue\n" + exp_continue } - send_gdb "continue\n" - exp_continue - } - -re "$inferior_exited_re normally.\[\r\n\]+$gdb_prompt" { - pass "program exited normally" - if {$i == 5} { - pass "all threads ran once ($name)" - } else { - fail "all threads ran once ($name) (total $i threads ran)" + -re "Breakpoint \[0-9\]+, .* kill \\(.*\\) .*$gdb_prompt" { + set j [expr $j + 1] + if { $kill == 1 } { + pass "hit kill breakpoint, $j" + } else { + fail "hit kill breakpoint, $j (unexpected)" + } + send_gdb "continue\n" + exp_continue } - } - -re " received signal SIGTRAP.*(Thread \[-0-9a-fx\]* \\(zombie\\)|0x00000000 in ).*$gdb_prompt $" { - if { $kill == 1 } { - kfail "gdb/1265" "Running threads ($name) (zombie thread)" - } else { - fail "running threads ($name) (unknown output)" + -re "$inferior_exited_re normally.\[\r\n\]+$gdb_prompt" { + pass "program exited normally" + if {$i == 5} { + pass "all threads ran once" + } else { + fail "all threads ran once (total $i threads ran)" + } + } + -re " received signal SIGTRAP.*(Thread \[-0-9a-fx\]* \\(zombie\\)|0x00000000 in ).*$gdb_prompt $" { + if { $kill == 1 } { + kfail "gdb/1265" "Running threads (zombie thread)" + } else { + fail "running threads (unknown output)" + } } } } diff --git a/gdb/testsuite/gdb.threads/queue-signal.exp b/gdb/testsuite/gdb.threads/queue-signal.exp index 3ec3adc..ca06ce7 100644 --- a/gdb/testsuite/gdb.threads/queue-signal.exp +++ b/gdb/testsuite/gdb.threads/queue-signal.exp @@ -60,16 +60,20 @@ gdb_test_no_output "set scheduler-locking on" gdb_test_no_output "set var ready = 1" # Thread sigusr1_thread gets a SIGUSR1 which we leave alone. -gdb_test "thread $sigusr1_thread" "" -gdb_test "continue" "SIGUSR1.*" +gdb_test "thread $sigusr1_thread" "" \ + "switch to SIGUSR1 thread" +gdb_test "continue" "SIGUSR1.*" \ + "continue until we get SIGUSR1" # Inject SIGUSR2 into thread sigusr2_thread. -gdb_test "thread $sigusr2_thread" "" +gdb_test "thread $sigusr2_thread" "" \ + "switch to SIGUSR2 thread" gdb_test_no_output "queue-signal SIGUSR2" # The main thread gets SIGABRT which we then throw away. gdb_test "thread 1" "" -gdb_test "continue" "SIGABRT.*" +gdb_test "continue" "SIGABRT.*" \ + "continue until we get SIGABRT" gdb_test_no_output "queue-signal 0" # Now let every thread run. diff --git a/gdb/testsuite/gdb.threads/signal-command-multiple-signals-pending.exp b/gdb/testsuite/gdb.threads/signal-command-multiple-signals-pending.exp index 2d4417c..78ded0d 100644 --- a/gdb/testsuite/gdb.threads/signal-command-multiple-signals-pending.exp +++ b/gdb/testsuite/gdb.threads/signal-command-multiple-signals-pending.exp @@ -53,14 +53,16 @@ proc test { schedlock } { gdb_test "continue" "thread_function.*" "thread 2 created" gdb_test "continue" "thread_function.*" "thread 3 created" - gdb_test "continue" "all_threads_started.*" + gdb_test "continue" "all_threads_started.*" \ + "continue to all_threads_started" # Using schedlock, let the main thread queue a signal for each # non-main thread. gdb_test_no_output "set scheduler-locking on" gdb_test "break all_threads_signalled" "Breakpoint .* at .*$srcfile.*" - gdb_test "continue" "all_threads_signalled.*" + gdb_test "continue" "all_threads_signalled.*" \ + "continue to all_threads signalled" gdb_test "info threads" "\\\* 1\[ \t\]+Thread.*" "thread 1 selected" |