Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jed Brown <jed@59A2.org>
To: gdb@sourceware.org
Subject: watch -location
Date: Sun, 22 Jan 2012 02:45:00 -0000	[thread overview]
Message-ID: <CAM9tzSmRS0Dd2qC=iZR3__X+VCK8pNK7xr1r-c4YUKadrurAQA@mail.gmail.com> (raw)

I was surprised when I upgraded to 7.3.1 that my common pattern of

(gdb) print &obj->member
$1 = (int *) 0x6fcf04
(gdb) watch *$1

was no longer watching the value at this address. I found that the
changelog mentioned the new -location option, which makes this much
nicer

(gdb) watch -location obj->member
Hardware watchpoint 3: -location obj->member


I like the new method, but why did the old method stop working? It
makes some old debugging documentation incorrect.


I currently see

(gdb) info watchpoints
Num     Type           Disp Enb Address            What
3       hw watchpoint  keep y                      -location obj->member

Could the address of obj->member be printed in this output? It would
be useful for me to distinguish multiple watchpoints set for members
of different objects. (I.e. I set watchpoints twice from the same
scope with the same commands, but with different values of "obj", and
I'd like to be able to distinguish which of these are related other
than to remember which numbers refer to members of which object.)


             reply	other threads:[~2012-01-22  2:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-22  2:45 Jed Brown [this message]
2012-01-23 21:07 ` Tom Tromey
2012-01-23 22:05 ` Sergio Durigan Junior

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='CAM9tzSmRS0Dd2qC=iZR3__X+VCK8pNK7xr1r-c4YUKadrurAQA@mail.gmail.com' \
    --to=jed@59a2.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