diff options
author | Andrew Burgess <aburgess@broadcom.com> | 2013-10-18 16:25:14 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@broadcom.com> | 2013-10-18 16:25:14 +0000 |
commit | e8369a73b982f60326e89c38bd1a7e6bb7363beb (patch) | |
tree | 82dbafc553a62757810f5bf180f32ffd4f24cc95 /gdb/testsuite/gdb.base/watchpoints.exp | |
parent | 776f04fafe124218f3602c2d9c598662c0f17aa9 (diff) | |
download | gdb-e8369a73b982f60326e89c38bd1a7e6bb7363beb.zip gdb-e8369a73b982f60326e89c38bd1a7e6bb7363beb.tar.gz gdb-e8369a73b982f60326e89c38bd1a7e6bb7363beb.tar.bz2 |
Hardware watchpoints turned off, inferior not yet started.
https://sourceware.org/ml/gdb-patches/2013-10/msg00477.html
gdb/ChangeLog
* breakpoint.c (update_watchpoint): If hardware watchpoints are
forced off, downgrade them to software watchpoints if possible,
and error out if not possible.
(watch_command_1): Move watchpoint type selection closer to
watchpoint creation, and extend the comments.
gdb/testsuite/ChangeLog
* gdb.base/watchpoints.exp: Add test for setting software
watchpoints of different types before starting the inferior.
Diffstat (limited to 'gdb/testsuite/gdb.base/watchpoints.exp')
-rw-r--r-- | gdb/testsuite/gdb.base/watchpoints.exp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/watchpoints.exp b/gdb/testsuite/gdb.base/watchpoints.exp index 7c10d81..b70e86c 100644 --- a/gdb/testsuite/gdb.base/watchpoints.exp +++ b/gdb/testsuite/gdb.base/watchpoints.exp @@ -29,6 +29,29 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} { return -1 } +with_test_prefix "before inferior start" { + # Ensure that if we turn off hardware watchpoints and set a watch point + # before starting the inferior the watchpoint created will not be a + # hardware watchpoint. + gdb_test_no_output "set can-use-hw-watchpoints 0" "" + gdb_test "watch ival1" "Watchpoint \[0-9\]+: ival1" \ + "create watchpoint" + + # The next tests are written to match the current state of gdb: access + # and read watchpoints require hardware watchpoint support, with this + # turned off these can't be created. + gdb_test "awatch ival1" \ + "Software read/access watchpoints not supported." \ + "create access watchpoint" + gdb_test "rwatch ival1" \ + "Software read/access watchpoints not supported." \ + "create read watchpoint" +} + + # This will turn hardware watchpoints back on and delete the watchpoint + # we just created. + clean_restart ${binfile} + # Disable hardware watchpoints if necessary. if [target_info exists gdb,no_hardware_watchpoints] { gdb_test_no_output "set can-use-hw-watchpoints 0" "" |