From: Pedro Alves <pedro@codesourcery.com>
To: Michael Snyder <msnyder@vmware.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: Watching expressions that don't involve memory (e.g., watch $regfoo)
Date: Thu, 04 Mar 2010 02:13:00 -0000 [thread overview]
Message-ID: <201003040213.19438.pedro@codesourcery.com> (raw)
In-Reply-To: <4B8F155E.8050209@vmware.com>
On Thursday 04 March 2010 02:05:18, Michael Snyder wrote:
> I think watching registers, or expressions involving registers
> (such as $sp > 0x10000000) could be incredibly useful.
Yeah, that works.
(top-gdb) p $rsp
$1 = (void *) 0x7fffffffe040
(top-gdb) watch $rsp < 0x7fffffffe040
Watchpoint 4: $rsp < 0x7fffffffe040
(top-gdb) c
Continuing.
Watchpoint 4: $rsp < 0x7fffffffe040
Old value = 0
New value = 1
0x0000000000454fd8 in memset@plt ()
(top-gdb) bt
#0 0x0000000000454fd8 in memset@plt ()
#1 0x0000000000456659 in main (argc=1, argv=0x7fffffffe158) at ../../src/gdb/gdb.c:28
(top-gdb)
> Expressions on a varobj sound useful to watch too.
What do you mean by varobj here? If that's something
that you can "(gdb) print", it should work too. It sounds
like it opens pathway for some crazy watching :-)
> One question; what will happen if I watch a constant?
The watchpoint never triggers, as is today.
--
Pedro Alves
next prev parent reply other threads:[~2010-03-04 2:13 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 [this message]
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
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=201003040213.19438.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=msnyder@vmware.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