2011-07-26 Pedro Alves <pedro@codesourcery.com>
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / watchpoint.exp
index 1d8c5bcbf6b31bc9e7b2827913d8edba99db7c38..331b18165b3582e0e4dda65ecdfb9a74e3e2be27 100644 (file)
@@ -630,6 +630,23 @@ proc test_constant_watchpoint {} {
     gdb_test_no_output "delete \$bpnum" "delete watchpoint `7 + count'"
 }
 
+proc test_disable_enable_software_watchpoint {} {
+    # This is regression test for a bug that caused `enable' to fail
+    # for software watchpoints.
+
+    # Watch something not memory to force a software watchpoint.
+    gdb_test {watch $pc} ".*atchpoint \[0-9\]+: .pc"
+
+    gdb_test_no_output "disable \$bpnum" "disable watchpoint `\$pc'"
+    gdb_test_no_output "enable \$bpnum" "reenable watchpoint `\$pc'"
+
+    gdb_test "info watchpoint \$bpnum" \
+       ".*watchpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+.pc.*" \
+       "watchpoint `\$pc' is enabled"
+
+    gdb_test_no_output "delete \$bpnum" "delete watchpoint `\$pc'"
+}
+
 proc test_watch_location {} {
     gdb_breakpoint [gdb_get_line_number "func5 breakpoint here"]
     gdb_continue_to_breakpoint "func5 breakpoint here"
@@ -903,6 +920,8 @@ if [initialize] then {
 
     test_constant_watchpoint
 
+    test_disable_enable_software_watchpoint
+
     test_watch_location
 }
 
This page took 0.024888 seconds and 4 git commands to generate.