diff options
author | Daniel Jacobowitz <drow@false.org> | 2008-03-03 13:24:12 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2008-03-03 13:24:12 +0000 |
commit | fa4727a64f112282dc798744b98b0f39bd3458e8 (patch) | |
tree | 735a625e569e273db0b98fc541a5d934a78b23c7 /gdb/doc | |
parent | 35d60fe406fc549ffff0e3042b91d66716a22c37 (diff) | |
download | gdb-fa4727a64f112282dc798744b98b0f39bd3458e8.zip gdb-fa4727a64f112282dc798744b98b0f39bd3458e8.tar.gz gdb-fa4727a64f112282dc798744b98b0f39bd3458e8.tar.bz2 |
* breakpoint.c (fetch_watchpoint_value): New function.
(update_watchpoint): Set and clear val_valid. Use
fetch_watchpoint_value. Handle unreadable values on the
value chain. Correct check for user-requested array watchpoints.
(breakpoint_init_inferior): Clear val_valid.
(watchpoint_value_print): New function.
(print_it_typical): Use it. Do not free or clear old_val. Print
watchpoints even if old_val == NULL.
(watchpoint_check): Use fetch_watchpoint_value. Check for values
becoming readable or unreadable.
(watch_command_1): Use fetch_watchpoint_value. Set val_valid.
(do_enable_watchpoint): Likewise.
* breakpoint.h (struct breakpoint): Update comment for val. Add
val_valid.
* NEWS: Mention watchpoints on inaccessible memory.
* gdb.base/watchpoint.c (global_ptr, func4): New.
(main): Call func4.
* gdb.base/watchpoint.exp: Call test_inaccessible_watchpoint.
(test_inaccessible_watchpoint): New.
* gdb.texinfo (Set Watchpoints): Mention watchpoints on
unreadable memory. Delete obsolete SPARClite reference.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 21 |
2 files changed, 15 insertions, 11 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 95d94d9..6e68899 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2008-03-03 Daniel Jacobowitz <dan@codesourcery.com> + + * gdb.texinfo (Set Watchpoints): Mention watchpoints on + unreadable memory. Delete obsolete SPARClite reference. + 2008-02-28 Daniel Jacobowitz <dan@codesourcery.com> * gdb.texinfo (Starting): Mention always-running targets. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index dfc6e81..1a0e9d2 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -3211,6 +3211,16 @@ expression can use any operators valid in the program's native language (@pxref{Languages}). @end itemize +You can set a watchpoint on an expression even if the expression can +not be evaluated yet. For instance, you can set a watchpoint on +@samp{*global_ptr} before @samp{global_ptr} is initialized. +@value{GDBN} will stop when your program sets @samp{global_ptr} and +the expression produces a valid value. If the expression becomes +valid in some other way than changing a variable (e.g.@: if the memory +pointed to by @samp{*global_ptr} becomes readable as the result of a +@code{malloc} call), @value{GDBN} may not stop until the next time +the expression changes. + @cindex software watchpoints @cindex hardware watchpoints Depending on your system, watchpoints may be implemented in software or @@ -3338,17 +3348,6 @@ exhaust the resources available for hardware-assisted watchpoints. That's because @value{GDBN} needs to watch every variable in the expression with separately allocated resources. -The SPARClite DSU will generate traps when a program accesses some data -or instruction address that is assigned to the debug registers. For the -data addresses, DSU facilitates the @code{watch} command. However the -hardware breakpoint registers can only take two data watchpoints, and -both watchpoints must be the same kind. For example, you can set two -watchpoints with @code{watch} commands, two with @code{rwatch} commands, -@strong{or} two with @code{awatch} commands, but you cannot set one -watchpoint with one command and the other with a different command. -@value{GDBN} will reject the command if you try to mix watchpoints. -Delete or disable unused watchpoint commands before setting new ones. - If you call a function interactively using @code{print} or @code{call}, any watchpoints you have set will be inactive until @value{GDBN} reaches another kind of breakpoint or the call completes. |