From: Erik Leunissen <e.leunissen@hccnet.nl>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb@sourceware.org
Subject: Re: breakpoint for accessing memory location
Date: Sat, 21 Oct 2006 22:28:00 -0000 [thread overview]
Message-ID: <453A9EE4.1070800@hccnet.nl> (raw)
In-Reply-To: <uiridq0zw.fsf@gnu.org>
Eli Zaretskii wrote:
>
> I fixed the manual as shown below. Please see if this addresses your
> concerns.
>
It certainly does. See one nit below.
Thanks,
Erik Leunissen
> A @dfn{watchpoint} is a special breakpoint that stops your program
> -when the value of an expression changes. You must use a different
> -command to set watchpoints (@pxref{Set Watchpoints, ,Setting
> -watchpoints}), but aside from that, you can manage a watchpoint like
> -any other breakpoint: you enable, disable, and delete both breakpoints
> -and watchpoints using the same commands.
> +when the value of an expression changes. The expression may be a value
^^^^^^^^^^^^^^^^^^^^^^^^^^^
> +of a variable, or it could involve values of one or more variables
^^^^^^^^^^^^^
We watch for a change in the value of the variable, OK. However the
corresponding expression for that case simply holds the *name* of the
variable, doesn't it?
> +combined by operators, such as @samp{a + b}. This is sometimes called
> +@dfn{data breakpoints}. You must use a different command to set
> +watchpoints (@pxref{Set Watchpoints, ,Setting watchpoints}), but aside
> +from that, you can manage a watchpoint like any other breakpoint: you
> +enable, disable, and delete both breakpoints and watchpoints using the
> +same commands.
>
> You can arrange to have values from your program displayed automatically
> whenever @value{GDBN} stops at a breakpoint. @xref{Auto Display,,
> @@ -3106,7 +3110,24 @@
> @cindex setting watchpoints
> You can use a watchpoint to stop execution whenever the value of an
> expression changes, without having to predict a particular place where
> -this may happen.
> +this may happen. (This is sometimes called a @dfn{data breakpoint}.)
> +The expression may be as simple as the value of a single variable, or
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
same here
> +as complex as many variables combined by operators. Examples include:
> +
> +@itemize @bullet
> +@item
> +A reference to the value of a single variable.
> +
> +@item
> +An address cast to an appropriate data type. For example,
> +@samp{*(int *)0x12345678} will watch a 4-byte region at the specified
> +address (assuming an @code{int} occupies 4 bytes).
> +
> +@item
> +An arbitrarily complex expression, such as @samp{a*b + c/d}. The
> +expression can use any operators valid in the program's native
> +language (@pxref{Languages}).
> +@end itemize
>
> @cindex software watchpoints
> @cindex hardware watchpoints
> @@ -3124,8 +3145,14 @@
> @table @code
> @kindex watch
> @item watch @var{expr}
> -Set a watchpoint for an expression. @value{GDBN} will break when @var{expr}
> -is written into by the program and its value changes.
> +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
> +to watch the value of a single variable:
> +
> +@smallexample
> +(@value{GDBP}) watch foo
> +@end smallexample
>
> @kindex rwatch
> @item rwatch @var{expr}
> @@ -3217,6 +3244,11 @@
> @noindent
> If this happens, delete or disable some of the watchpoints.
>
> +Watching complex expressions that reference many variables can also
> +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
>
>
next prev parent reply other threads:[~2006-10-21 22:28 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-19 20:10 Erik Leunissen
2006-10-19 20:12 ` Daniel Jacobowitz
2006-10-19 20:24 ` Erik Leunissen
2006-10-19 20:25 ` Daniel Jacobowitz
2006-10-19 20:28 ` Erik Leunissen
2006-10-20 6:31 ` Eli Zaretskii
2006-10-20 14:27 ` Daniel Jacobowitz
2006-10-21 13:20 ` [commit] Fix annotations-related index entries (was: breakpoint for accessing memory location) Eli Zaretskii
2006-10-20 16:56 ` breakpoint for accessing memory location Erik Leunissen
2006-10-20 17:39 ` Eli Zaretskii
2006-10-21 12:58 ` Eli Zaretskii
2006-10-21 22:28 ` Erik Leunissen [this message]
2006-10-22 4:20 ` Eli Zaretskii
2006-10-22 9:11 ` Erik Leunissen
2006-10-22 9:19 ` Erik Leunissen
2006-10-22 22:16 ` Eli Zaretskii
2006-10-23 7:41 ` Erik Leunissen
2006-10-21 15:06 ` Rodney M. Bates
2006-10-21 15:27 ` Daniel Jacobowitz
2006-10-21 15:29 ` Eli Zaretskii
2006-10-21 15:51 ` Daniel Jacobowitz
2006-10-21 21:26 ` Eli Zaretskii
2006-10-21 22:32 ` Daniel Jacobowitz
2006-10-22 4:18 ` Eli Zaretskii
2006-10-22 4:22 ` Daniel Jacobowitz
2006-10-22 12:18 ` Robert Dewar
2006-10-22 22:18 ` Eli Zaretskii
2006-10-22 22:21 ` Daniel Jacobowitz
2006-10-22 22:29 ` Eli Zaretskii
2006-10-22 22:49 ` Robert Dewar
2006-10-22 23:18 ` Daniel Jacobowitz
2006-10-23 2:03 ` Robert Dewar
2006-10-23 4:11 ` Eli Zaretskii
2006-10-23 12:36 ` Daniel Jacobowitz
2006-10-22 22:48 ` Robert Dewar
2006-10-22 22:51 ` Eli Zaretskii
2006-10-22 22:55 ` Robert Dewar
2006-10-23 4:10 ` Eli Zaretskii
2006-10-22 20:40 ` Mark Kettenis
2006-10-21 18:07 ` Rodney M. Bates
2006-10-21 21:42 ` Eli Zaretskii
2006-10-21 18:55 ` Rodney M. Bates
2006-10-21 21:53 ` Eli Zaretskii
2006-10-22 15:20 ` Rodney M. Bates
2006-10-22 17:24 ` Daniel Jacobowitz
2006-10-22 22:22 ` Eli Zaretskii
2006-10-23 22:02 ` Jim Blandy
2006-10-24 4:32 ` Eli Zaretskii
2006-10-24 12:57 ` Daniel Jacobowitz
2006-10-24 17:37 ` Eli Zaretskii
2006-10-24 17:41 ` Daniel Jacobowitz
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=453A9EE4.1070800@hccnet.nl \
--to=e.leunissen@hccnet.nl \
--cc=eliz@gnu.org \
--cc=gdb@sourceware.org \
/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