return -1
}
-mi_delete_breakpoints
-mi_gdb_reinitialize_dir $srcdir/$subdir
-mi_gdb_load ${binfile}
-
proc test_watchpoint_creation_and_listing {} {
global mi_gdb_prompt
global srcfile
}
}
-# Disable hardware watchpoints if necessary.
+proc test_watchpoint_all {type} {
+ global pf_prefix
+ upvar srcdir srcdir
+ upvar subdir subdir
+ upvar binfile binfile
+
+ set old_prefix $pf_prefix
+ lappend pf_prefix "$type:"
+
+ mi_delete_breakpoints
+ mi_gdb_reinitialize_dir $srcdir/$subdir
+ mi_gdb_load ${binfile}
+
+ mi_runto callee4
+ test_watchpoint_creation_and_listing
+ #test_rwatch_creation_and_listing
+ #test_awatch_creation_and_listing
+ test_watchpoint_triggering
+
+ set pf_prefix $old_prefix
+}
+
+# Run the tests twice, once using software watchpoints...
+mi_gdb_test "567-gdb-set can-use-hw-watchpoints 0" \
+ "567\\^done" \
+ "hw watchpoints toggle (1)"
+test_watchpoint_all sw
+
+mi_gdb_exit
+
+# ... and unless requested otherwise...
if [target_info exists gdb,no_hardware_watchpoints] {
- mi_gdb_test "-gdb-set can-use-hw-watchpoints 0" "\\^done" ""
+ return 0
}
-mi_runto callee4
-test_watchpoint_creation_and_listing
-#test_rwatch_creation_and_listing
-#test_awatch_creation_and_listing
-test_watchpoint_triggering
+mi_gdb_start
+
+# ... once using hardware watchpoints (if available).
+mi_gdb_test "890-gdb-set can-use-hw-watchpoints 1" \
+ "890\\^done" \
+ "hw watchpoints toggle (2)"
+test_watchpoint_all hw
mi_gdb_exit
return 0