From: Paul Koning <Paul_Koning@dell.com>
To: schwab@suse.de
Cc: eliz@gnu.org, gdb@sourceware.org, gdb@sources.redhat.com
Subject: Re: How to watch for changes in a location of memory
Date: Tue, 12 Aug 2008 14:34:00 -0000 [thread overview]
Message-ID: <18588.20108.351032.425751@rrenna-us-nas.equallogic.com> (raw)
In-Reply-To: <jeprojoepz.fsf@sykes.suse.de>
>>>>> "Andreas" == Andreas Schwab <schwab@suse.de> writes:
Andreas> Eli Zaretskii <eliz@gnu.org> writes:
>>> From: Andreas Schwab <schwab@suse.de> Cc: gdb Mailing List
>>> <gdb@sources.redhat.com> Date: Fri, 08 Aug 2008 13:55:47 +0200
>>>
>>> Stefano Sabatini <stefano.sabatini-lala@poste.it> writes:
>>>
>>> > Thank you for the good pointer, yes indeed it seems it does
>>> what I > want, which is basically: > watch &ctx->foo;
>>>
>>> This is equivalent to `watch ctx', since the address of ctx->foo
>>> can only change if ctx changes. Watching an address of something
>>> is generally not usefull.
>> And "watch ctx" is also not generally useful, because most
>> platforms cannot watch large structures.
Andreas> In this example, ctx is a pointer (otherwise ctx->foo
Andreas> wouldn't work), which is small enough on all platforms.
Right. But from the original note it seems that the requester is
interested in catching changes to field foo of the structure that ctx
points to.
The thing that confuses lots of people when they first use the "watch"
command is that the intuitive meaning is "watch this address" but the
actual meaning is "watch this expression". So Stefano wrote
"watch &ctx->foo" but to get the effect that I believe was intended
you'd want "watch ctx->foo".
Similarly, to watch a specific numeric address, you have to say
"watch *(T*)0x123454" as opposed to "watch 0x123454" or something like
that.
paul
WARNING: multiple messages have this Message-ID
From: Paul Koning <Paul_Koning@dell.com>
To: schwab@suse.de
Cc: eliz@gnu.org, gdb@sourceware.org, gdb@sources.redhat.com
Subject: Re: How to watch for changes in a location of memory
Date: Sun, 10 Aug 2008 21:02:00 -0000 [thread overview]
Message-ID: <18588.20108.351032.425751@rrenna-us-nas.equallogic.com> (raw)
Message-ID: <20080810210200.NBTZn6tV-F0eFSojVk23PMBT_mOkIFKQHdS5OjTnGQM@z> (raw)
In-Reply-To: <jeprojoepz.fsf@sykes.suse.de>
>>>>> "Andreas" == Andreas Schwab <schwab@suse.de> writes:
Andreas> Eli Zaretskii <eliz@gnu.org> writes:
>>> From: Andreas Schwab <schwab@suse.de> Cc: gdb Mailing List
>>> <gdb@sources.redhat.com> Date: Fri, 08 Aug 2008 13:55:47 +0200
>>>
>>> Stefano Sabatini <stefano.sabatini-lala@poste.it> writes:
>>>
>>> > Thank you for the good pointer, yes indeed it seems it does
>>> what I > want, which is basically: > watch &ctx->foo;
>>>
>>> This is equivalent to `watch ctx', since the address of ctx->foo
>>> can only change if ctx changes. Watching an address of something
>>> is generally not usefull.
>> And "watch ctx" is also not generally useful, because most
>> platforms cannot watch large structures.
Andreas> In this example, ctx is a pointer (otherwise ctx->foo
Andreas> wouldn't work), which is small enough on all platforms.
Right. But from the original note it seems that the requester is
interested in catching changes to field foo of the structure that ctx
points to.
The thing that confuses lots of people when they first use the "watch"
command is that the intuitive meaning is "watch this address" but the
actual meaning is "watch this expression". So Stefano wrote
"watch &ctx->foo" but to get the effect that I believe was intended
you'd want "watch ctx->foo".
Similarly, to watch a specific numeric address, you have to say
"watch *(T*)0x123454" as opposed to "watch 0x123454" or something like
that.
paul
next prev parent reply other threads:[~2008-08-08 13:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-08 8:13 Stefano Sabatini
2008-08-08 8:38 ` Eran Ifrah
2008-08-08 9:13 ` Stefano Sabatini
2008-08-08 11:56 ` Stefano Sabatini
2008-08-08 12:42 ` Andreas Schwab
2008-08-08 12:48 ` Andreas Schwab
2008-08-09 12:03 ` Eli Zaretskii
2008-08-08 13:48 ` Eli Zaretskii
2008-08-09 12:20 ` Andreas Schwab
2008-08-09 13:49 ` Andreas Schwab
2008-08-12 14:34 ` Paul Koning [this message]
2008-08-10 21:02 ` Paul Koning
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=18588.20108.351032.425751@rrenna-us-nas.equallogic.com \
--to=paul_koning@dell.com \
--cc=eliz@gnu.org \
--cc=gdb@sources.redhat.com \
--cc=gdb@sourceware.org \
--cc=schwab@suse.de \
/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