From e8369a73b982f60326e89c38bd1a7e6bb7363beb Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Fri, 18 Oct 2013 16:25:14 +0000 Subject: 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. --- gdb/testsuite/gdb.base/watchpoints.exp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'gdb/testsuite/gdb.base') 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" "" -- cgit v1.1