diff options
author | David Carlton <carlton@bactrian.org> | 2003-03-17 19:51:58 +0000 |
---|---|---|
committer | David Carlton <carlton@bactrian.org> | 2003-03-17 19:51:58 +0000 |
commit | 46466ad9d59db53793b0b1a20e7895b49dc718f7 (patch) | |
tree | 563222460addbfe6b4653f7452c12d386ad1528a /gdb/testsuite | |
parent | d6349564821d599de22a25acc6609dd2c0a0531d (diff) | |
download | gdb-46466ad9d59db53793b0b1a20e7895b49dc718f7.tar.gz |
2003-03-17 David Carlton <carlton@math.stanford.edu>
* gdb.base/watchpoint.exp (test_watchpoint_and_breakpoint): New
test, for PR breakpoints/38.
Call test_watchpoint_and_breakpoint.
* gdb.base/watchpoint.c (func3): New function.
(main): Call func3.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/watchpoint.c | 15 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/watchpoint.exp | 32 |
3 files changed, 55 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index fa7aa7312cf..89e2462bf9d 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2003-03-17 David Carlton <carlton@math.stanford.edu> + + * gdb.base/watchpoint.exp (test_watchpoint_and_breakpoint): New + test, for PR breakpoints/38. + Call test_watchpoint_and_breakpoint. + * gdb.base/watchpoint.c (func3): New function. + (main): Call func3. + 2003-03-04 David Carlton <carlton@math.stanford.edu> * gdb.c++/templates.exp (do_tests): Accept valid const in "print diff --git a/gdb/testsuite/gdb.base/watchpoint.c b/gdb/testsuite/gdb.base/watchpoint.c index 14ccecd5253..1a61ba16521 100644 --- a/gdb/testsuite/gdb.base/watchpoint.c +++ b/gdb/testsuite/gdb.base/watchpoint.c @@ -83,6 +83,18 @@ func2 () static_b = local_a; } +void +func3 () +{ + int x; + int y; + + x = 0; + x = 1; /* second x assignment */ + y = 1; + y = 2; +} + int func1 () { @@ -170,5 +182,8 @@ int main () recurser (2); marker6 (); + + func3 (); + return 0; } diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp index f10955fce5a..c5e37d451a5 100644 --- a/gdb/testsuite/gdb.base/watchpoint.exp +++ b/gdb/testsuite/gdb.base/watchpoint.exp @@ -648,6 +648,27 @@ proc test_complex_watchpoint {} { } } +proc test_watchpoint_and_breakpoint {} { + global gdb_prompt + + # This is a test for PR gdb/38, which involves setting a + # watchpoint right after you've reached a breakpoint. + + if [runto func3] then { + gdb_breakpoint [gdb_get_line_number "second x assignment"] + gdb_continue_to_breakpoint "second x assignment" + gdb_test "watch x" ".*atchpoint \[0-9\]+: x" + gdb_test_multiple "next" "next after watch x" { + -re ".*atchpoint \[0-9\]+: x\r\n\r\nOld value = 0\r\nNew value = 1\r\n.*$gdb_prompt $" { + pass "next after watch x" + } + -re "\[0-9\]+\[\t \]+y = 1;\r\n$gdb_prompt $" { + kfail "gdb/38" "next after watch x" + } + } + } +} + # Start with a fresh gdb. gdb_exit @@ -799,6 +820,17 @@ if [initialize] then { timeout {fail "(timeout) access watches disallowed"} } } + + # See above. + if [istarget "mips-idt-*"] then { + gdb_exit + gdb_start + gdb_reinitialize_dir $srcdir/$subdir + gdb_load $binfile + initialize + } + + test_watchpoint_and_breakpoint } # Restore old timeout |