diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2004-10-12 22:49:17 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2004-10-12 22:49:17 +0000 |
commit | e1923096a1457947ac9c358b081001e99f664fc2 (patch) | |
tree | 15fc5d5b3af01d0047cc06001ff156fc917087c8 /gdb/testsuite/gdb.threads/watchthreads.exp | |
parent | 1b9445c221ae5af50d982e82d241d11a4ac36764 (diff) | |
download | gdb-e1923096a1457947ac9c358b081001e99f664fc2.zip gdb-e1923096a1457947ac9c358b081001e99f664fc2.tar.gz gdb-e1923096a1457947ac9c358b081001e99f664fc2.tar.bz2 |
2004-10-12 Jeff Johnston <jjohnstn@redhat.com>
* gdb.threads/schedlock.c: Add comment markers to use to find
line numbers.
* gdb.threads/schedlock.exp: Adjust regex to handle the new
comments.
* gdb.threads/watchthreads.exp: Use gdb_get_line_number to find
breakpoint lines.
Diffstat (limited to 'gdb/testsuite/gdb.threads/watchthreads.exp')
-rw-r--r-- | gdb/testsuite/gdb.threads/watchthreads.exp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gdb/testsuite/gdb.threads/watchthreads.exp b/gdb/testsuite/gdb.threads/watchthreads.exp index d6e89d9..0bb940f 100644 --- a/gdb/testsuite/gdb.threads/watchthreads.exp +++ b/gdb/testsuite/gdb.threads/watchthreads.exp @@ -31,7 +31,7 @@ if [target_info exists gdb,no_hardware_watchpoints] { return 0; } -set testfile "schedlock" +set testfile "watchthreads" set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } { @@ -60,17 +60,20 @@ set args_1 0 gdb_test "watch args\[0\]" "Hardware watchpoint 2: args\\\[0\\\]" gdb_test "watch args\[1\]" "Hardware watchpoint 3: args\\\[1\\\]" +set init_line [expr [gdb_get_line_number "Init value"]+1] +set inc_line [gdb_get_line_number "Loop increment"] + # Loop and continue to allow both watchpoints to be triggered. for {set i 0} {$i < 30} {incr i} { set test_flag 0 gdb_test_multiple "continue" "threaded watch loop" { - -re "Hardware watchpoint 2: args\\\[0\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*schedlock.c:21.*$gdb_prompt $" + -re "Hardware watchpoint 2: args\\\[0\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*watchthreads.c:$init_line.*$gdb_prompt $" { set args_0 1; set test_flag 1 } - -re "Hardware watchpoint 3: args\\\[1\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*schedlock.c:21.*$gdb_prompt $" + -re "Hardware watchpoint 3: args\\\[1\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*watchthreads.c:$init_line.*$gdb_prompt $" { set args_1 1; set test_flag 1 } - -re "Hardware watchpoint 2: args\\\[0\\\].*Old value = $args_0.*New value = [expr $args_0+1].*in thread_function \\\(arg=0x0\\\) at .*schedlock.c:42.*$gdb_prompt $" + -re "Hardware watchpoint 2: args\\\[0\\\].*Old value = $args_0.*New value = [expr $args_0+1].*in thread_function \\\(arg=0x0\\\) at .*watchthreads.c:$inc_line.*$gdb_prompt $" { set args_0 [expr $args_0+1]; set test_flag 1 } - -re "Hardware watchpoint 3: args\\\[1\\\].*Old value = $args_1.*New value = [expr $args_1+1].*in thread_function \\\(arg=0x1\\\) at .*schedlock.c:42.*$gdb_prompt $" + -re "Hardware watchpoint 3: args\\\[1\\\].*Old value = $args_1.*New value = [expr $args_1+1].*in thread_function \\\(arg=0x1\\\) at .*watchthreads.c:$inc_line.*$gdb_prompt $" { set args_1 [expr $args_1+1]; set test_flag 1 } } # If we fail above, don't bother continuing loop |