* value.c (release_value): Clear 'next' pointer.
	* breakpoint.c (watch_command_1): Add 'just_location' argument.
	(watch_command_wrapper): Update.
	(watch_maybe_just_location): New function.
	(watch_command): Update.
	(rwatch_command_wrapper): Update.
	(rwatch_command): Update.
	(awatch_command_wrapper): Update.
	(awatch_command): Update.
	(check_for_argument): New function.
	(_initialize_breakpoint): Update help text.
gdb/testsuite
	* gdb.base/help.exp: Update.
	* gdb.base/watchpoint.exp (test_watchpoint_and_breakpoint): Delete
	watchpoint.
	(test_watch_location): New proc.
	(test_watchpoint_in_big_blob): Delete watchpoint.
	* gdb.base/watchpoint.c (func5): New function.
	(main): Call it.
gdb/doc
	* gdb.texinfo (Set Watchpoints): Document -location option.
This commit is contained in:
Tom Tromey
2010-08-16 19:19:22 +00:00
parent 70ebf4ed1a
commit 06a64a0b78
9 changed files with 159 additions and 25 deletions

View File

@ -615,6 +615,8 @@ proc test_watchpoint_and_breakpoint {} {
kfail "gdb/38" "next after watch x"
}
}
gdb_test_no_output "delete \$bpnum" "delete watch x"
}
}
@ -628,6 +630,19 @@ proc test_constant_watchpoint {} {
gdb_test_no_output "delete \$bpnum" "delete watchpoint `7 + count'"
}
proc test_watch_location {} {
gdb_breakpoint [gdb_get_line_number "func5 breakpoint here"]
gdb_continue_to_breakpoint "func5 breakpoint here"
gdb_test "watch -location *x" "atchpoint .*: .*" "watch -location .x"
gdb_test "continue" \
"Continuing.*\[Ww\]atchpoint .*: .*New value = 27.*" \
"continue with watch -location"
gdb_test_no_output "delete \$bpnum" "delete watch -location"
}
proc test_inaccessible_watchpoint {} {
global gdb_prompt
@ -678,6 +693,8 @@ proc test_watchpoint_in_big_blob {} {
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"
gdb_test_no_output "delete \$bpnum" "delete watch buf"
}
# Start with a fresh gdb.
@ -853,6 +870,8 @@ if [initialize] then {
}
test_constant_watchpoint
test_watch_location
}
# Restore old timeout