Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Joel Brobecker <brobecker@adacore.com>
Cc: pedro@codesourcery.com, gdb-patches@sourceware.org
Subject: Re: Watching expressions that don't involve memory (e.g., watch  $regfoo)
Date: Thu, 04 Mar 2010 07:40:00 -0000	[thread overview]
Message-ID: <E1Nn5ez-0006BG-5a@fencepost.gnu.org> (raw)
In-Reply-To: <20100304053017.GH2832@adacore.com> (message from Joel Brobecker 	on Thu, 4 Mar 2010 09:30:17 +0400)

> Date: Thu, 4 Mar 2010 09:30:17 +0400
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: gdb-patches@sourceware.org
> 
> > Anyone else things this is useful?  Here's a 5 minute hack at it.
> > +* Watchpoints on expressions not involving memory
> > +
> > +  GDB now supports watching expressions that don't involve memory.
> > +  This allows, for example, watching for register changes.
> > +  E.g. "watch $pc" will do the right thing.
> 
> I think that this might be very useful, indeed. For instance, if
> a variable is stored in a register instead of memory.

What would be _really_ nice is if GDB would automatically put a
watchpoint on the register that hold the variable, when the debug info
tells that.  In optimized programs, watching the memory alone will
frequently miss value changes.


      reply	other threads:[~2010-03-04  7:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-04  1:57 Pedro Alves
2010-03-04  2:05 ` Michael Snyder
2010-03-04  2:13   ` Pedro Alves
2010-03-04  4:12 ` Eli Zaretskii
2010-03-04 13:16   ` Pedro Alves
2010-03-04 14:11     ` Eli Zaretskii
2010-03-04 15:39       ` Pedro Alves
2010-03-04  5:30 ` Joel Brobecker
2010-03-04  7:40   ` Eli Zaretskii [this message]

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=E1Nn5ez-0006BG-5a@fencepost.gnu.org \
    --to=eliz@gnu.org \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.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