diff options
author | Pedro Alves <palves@redhat.com> | 2012-01-27 13:58:46 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2012-01-27 13:58:46 +0000 |
commit | 274f47f34a990de0d05c842dbe1a7645f4689654 (patch) | |
tree | 6e0f2239622a91f610e82c18453deaf67071fb79 /gdb | |
parent | e4d63ba2ed8b8195a5b6684f8df7b4d777e8ef23 (diff) | |
download | gdb-274f47f34a990de0d05c842dbe1a7645f4689654.zip gdb-274f47f34a990de0d05c842dbe1a7645f4689654.tar.gz gdb-274f47f34a990de0d05c842dbe1a7645f4689654.tar.bz2 |
2012-01-27 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint.exp (test_watchpoint_in_big_blob): Expect
"You may have requested too many hardware
breakpoints/watchpoints".
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/watchpoint.exp | 40 |
2 files changed, 44 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 180d508..278bf86 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,11 @@ 2012-01-27 Pedro Alves <palves@redhat.com> + * gdb.base/watchpoint.exp (test_watchpoint_in_big_blob): Expect + "You may have requested too many hardware + breakpoints/watchpoints". + +2012-01-27 Pedro Alves <palves@redhat.com> + * gdb.base/watchpoint.exp (maybe_clean_restart) (maybe_reinitialize): New. (test_disabling_watchpoints): Call maybe_reinitialize. Don't diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp index 1da6f9b..a4f30b39 100644 --- a/gdb/testsuite/gdb.base/watchpoint.exp +++ b/gdb/testsuite/gdb.base/watchpoint.exp @@ -769,8 +769,44 @@ proc test_inaccessible_watchpoint {} { proc test_watchpoint_in_big_blob {} { global gdb_prompt - gdb_test "watch buf" ".*atchpoint \[0-9\]+: buf" - gdb_test "cont" "Continuing.*atchpoint \[0-9\]+: buf\r\n\r\nOld value = .*testte\".*" "watchpoint on buf hit" + # On native targets where we do hardware resource accounting, this + # may end up as a software watchpoint. + set ok 0 + set test "watch buf" + gdb_test_multiple "watch buf" $test { + -re "Hardware watchpoint \[0-9\]+: buf.*You may have requested too many hardware breakpoints/watchpoints.*$gdb_prompt $" { + # This may happen with remote targets (where we don't do + # resource accounting) that support hardware watchpoints, + # when breakpoint always-inserted is on. The watchpoint + # was too large, for example. If GDB is ever adjusted to + # downgrade the watchpoint automatically in this case, + # this match should be removed. Note the breakpoint has + # been created, and is in the list, so it needs deleting. + pass $test + } + -re ".*atchpoint \[0-9\]+: buf.*$gdb_prompt $" { + pass $test + set ok 1 + } + } + + if { $ok } { + set test "watchpoint on buf hit" + gdb_test_multiple "cont" $test { + -re "Continuing.*atchpoint \[0-9\]+: buf\r\n\r\nOld value = .*testte\".*$gdb_prompt $" { + pass $test + } + -re "Could not insert hardware breakpoints:.*You may have requested too many hardware breakpoints/watchpoints.*$gdb_prompt $" { + # This may happen with remote targets that support + # hardware watchpoints. We only find out the + # watchpoint was too large, for example, at insert + # time. If GDB is ever adjusted to downgrade the + # watchpoint automatically in this case, this match + # should be removed. + pass $test + } + } + } gdb_test_no_output "delete \$bpnum" "delete watch buf" } |