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 | 293e9a3142dabaf46ab93191bad3a0e76fe75a0b (patch) | |
tree | 7c05246411e72ab4db70327f1ed93b75b3ad59ae /gdb/testsuite/gdb.base/watchpoint.exp | |
parent | 94e10508982b22ad3f65e7eb73361057455efa3f (diff) | |
download | gdb-293e9a3142dabaf46ab93191bad3a0e76fe75a0b.zip gdb-293e9a3142dabaf46ab93191bad3a0e76fe75a0b.tar.gz gdb-293e9a3142dabaf46ab93191bad3a0e76fe75a0b.tar.bz2 |
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/gdb.base/watchpoint.exp')
-rw-r--r-- | gdb/testsuite/gdb.base/watchpoint.exp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp index f10955f..c5e37d4 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 |