diff options
author | Pierre Muller <muller@sourceware.org> | 2007-12-19 14:40:37 +0000 |
---|---|---|
committer | Pierre Muller <muller@sourceware.org> | 2007-12-19 14:40:37 +0000 |
commit | abc8a88dc55a020f9bf146e115e01bc83437a14d (patch) | |
tree | b875fdf72dda8b3c5da2b84e31db0955d90b0669 /gdb | |
parent | 67cd94cafdf46c81cf52dd71db412f0a68a0cda5 (diff) | |
download | gdb-abc8a88dc55a020f9bf146e115e01bc83437a14d.zip gdb-abc8a88dc55a020f9bf146e115e01bc83437a14d.tar.gz gdb-abc8a88dc55a020f9bf146e115e01bc83437a14d.tar.bz2 |
2007-12-19 Pierre Muller <muller@ics-u-strasbg.fr>
* (gdb.base/watch_thread_num.exp): Add breakpoint at thread_function
and record first explicitly generated thread number.
Use that thread number for thread specific watchpoint test.
Add iteration number to repetitive tests.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/watch_thread_num.exp | 27 |
2 files changed, 29 insertions, 5 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index a75108b..32d59f6 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2007-12-19 Pierre Muller <muller@ics-u-strasbg.fr> + + * (gdb.base/watch_thread_num.exp): Add breakpoint at thread_function + and record first explicitly generated thread number. + Use that thread number for thread specific watchpoint test. + Add iteration number to repetitive tests. + 2007-12-16 Carlos Eduardo Seo <cseo@linux.vnet.ibm.com> Jim Blandy <jimb@codesourcery.com> diff --git a/gdb/testsuite/gdb.base/watch_thread_num.exp b/gdb/testsuite/gdb.base/watch_thread_num.exp index d5114ef..5fb7f23 100644 --- a/gdb/testsuite/gdb.base/watch_thread_num.exp +++ b/gdb/testsuite/gdb.base/watch_thread_num.exp @@ -54,11 +54,28 @@ gdb_test "watch shared_var thread" "A syntax error in expression, near `thread'\ gdb_test "Next 5" "" -gdb_test "watch shared_var thread 2" "Hardware watchpoint 2: shared_var" "Watchpoint on shared variable" -gdb_test "info breakpoint 2" "stop only in thread 2" +gdb_test "break thread_function" "Breakpoint \[0-9\].*" \ + "Set breakpoint at thread_function" -for {set i 0} {$i < 10} {incr i 1} { -gdb_test "continue" "Hardware watchpoint 2: shared_var.*" "Watchpoint triggered" -gdb_test "thread" "\\\[Current thread is 2 \\\(Thread $hex \\\(LWP $decimal\\\)\\\)\\\]" "Check thread that triggered" +gdb_test "continue" ".*Breakpoint 2.*" "Stopped in thread_function" + +send_gdb "thread\n" +gdb_expect { + -re ".*Current thread is (\[0-9\]*).*$gdb_prompt $" { pass "Thread command" } + -re ".*$gdb_prompt $" { fail "Thread command" } + timeout { fail "(timeout) Thread command" } +} + +set thread_num "$expect_out(1,string)" + +gdb_test "disable 2" "" "Disable breakpoint 2" +gdb_test "watch shared_var thread $thread_num" "Hardware watchpoint 3: shared_var" "Watchpoint on shared variable" +gdb_test "info breakpoint 3" "stop only in thread $thread_num" + +for {set i 1} {$i <= 10} {incr i 1} { +gdb_test "continue" "Hardware watchpoint 3: shared_var.*" \ + "Watchpoint triggered iteration $i" +gdb_test "thread" ".*Current thread is $thread_num .*" \ + "Check thread that triggered iteration $i" } |