From 06a64a0b786b2a3b81e8caced730c43939a78684 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 16 Aug 2010 19:19:22 +0000 Subject: gdb * 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. --- gdb/doc/ChangeLog | 4 ++++ gdb/doc/gdb.texinfo | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'gdb/doc') diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index b8f060b..36099c2 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,7 @@ +2010-08-16 Tom Tromey + + * gdb.texinfo (Set Watchpoints): Document -location option. + 2010-08-13 Doug Evans * gdb.texinfo (.debug_gdb_scripts section): Fix typo. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index cd3ac0f..fa50761 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -3711,7 +3711,7 @@ watchpoints, which do not slow down the running of your program. @table @code @kindex watch -@item watch @var{expr} @r{[}thread @var{threadnum}@r{]} +@item watch @r{[}-l@r{|}-location@r{]} @var{expr} @r{[}thread @var{threadnum}@r{]} Set a watchpoint for an expression. @value{GDBN} will break when the expression @var{expr} is written into by the program and its value changes. The simplest (and the most popular) use of this command is @@ -3728,13 +3728,22 @@ change the value of @var{expr}, @value{GDBN} will not break. Note that watchpoints restricted to a single thread in this way only work with Hardware Watchpoints. +Ordinarily a watchpoint respects the scope of variables in @var{expr} +(see below). The @code{-location} argument tells @value{GDBN} to +instead watch the memory referred to by @var{expr}. In this case, +@value{GDBN} will evaluate @var{expr}, take the address of the result, +and watch the memory at that address. The type of the result is used +to determine the size of the watched memory. If the expression's +result does not have an address, then @value{GDBN} will print an +error. + @kindex rwatch -@item rwatch @var{expr} @r{[}thread @var{threadnum}@r{]} +@item rwatch @r{[}-l@r{|}-location@r{]} @var{expr} @r{[}thread @var{threadnum}@r{]} Set a watchpoint that will break when the value of @var{expr} is read by the program. @kindex awatch -@item awatch @var{expr} @r{[}thread @var{threadnum}@r{]} +@item awatch @r{[}-l@r{|}-location@r{]} @var{expr} @r{[}thread @var{threadnum}@r{]} Set a watchpoint that will break when @var{expr} is either read from or written into by the program. -- cgit v1.1