From: Daniel Jacobowitz <drow@false.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org, jimb@red-bean.com
Subject: Re: [rfc] Allow watchpoints on inaccessible memory
Date: Sun, 02 Mar 2008 04:24:00 -0000 [thread overview]
Message-ID: <20080302042432.GA5486@caradoc.them.org> (raw)
In-Reply-To: <uablkkr9j.fsf@gnu.org>
On Fri, Feb 29, 2008 at 12:10:00PM +0200, Eli Zaretskii wrote:
> > Date: Thu, 28 Feb 2008 11:17:49 -0500
> > From: Daniel Jacobowitz <drow@false.org>
> > Cc: Eli Zaretskii <eliz@gnu.org>, Jim Blandy <jimb@red-bean.com>
> >
> > Eli, is the NEWS entry OK?
>
> Yes, but I think we should mention this feature in the manual as well.
What do you think of the attached?
> Btw, are there any command, either CLI or MI, that print the current
> value of the watched expression? If there are, we need to fix them
> somehow in the case struct value is NULL.
No, there are no commands that do this; I checked all the uses of
struct breakpoint's val field.
> Also, maybe we should display <PENDING> in "info break" in this case,
> like we do with breakpoints.
That goes in the address field, which we don't use for other
watchpoints. And we don't print the current value in info break,
so I think this is a full-fledged watchpoint; everything is
displayed as if we could read the value.
--
Daniel Jacobowitz
CodeSourcery
2008-03-01 Daniel Jacobowitz <dan@codesourcery.com>
* doc/gdb.texinfo (Set Watchpoints): Mention watchpoints on
unreadable memory. Delete obsolete SPARClite reference.
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.471
diff -u -p -r1.471 gdb.texinfo
--- doc/gdb.texinfo 28 Feb 2008 16:26:18 -0000 1.471
+++ doc/gdb.texinfo 2 Mar 2008 04:23:36 -0000
@@ -3211,6 +3211,16 @@ expression can use any operators valid i
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 hard
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.
next prev parent reply other threads:[~2008-03-02 4:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-21 14:25 Daniel Jacobowitz
2007-08-21 16:33 ` Jim Blandy
2007-08-21 18:06 ` Daniel Jacobowitz
2007-08-21 22:49 ` Jim Blandy
2007-08-21 23:17 ` Daniel Jacobowitz
2007-08-21 19:04 ` Eli Zaretskii
2007-11-20 7:56 ` Vladimir Prus
2008-02-28 16:27 ` Daniel Jacobowitz
2008-02-29 10:11 ` Eli Zaretskii
2008-03-02 4:24 ` Daniel Jacobowitz [this message]
2008-03-02 21:09 ` Eli Zaretskii
2008-03-02 23:23 ` Daniel Jacobowitz
2008-03-03 4:27 ` Eli Zaretskii
2008-03-03 14:07 ` Daniel Jacobowitz
2008-02-29 17:54 ` Jim Blandy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080302042432.GA5486@caradoc.them.org \
--to=drow@false.org \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=jimb@red-bean.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox