From: Vladimir Prus <ghost@cs.msu.su>
To: Nick Roberts <nickrob@snap.net.nz>
Cc: gdb-patches@sources.redhat.com
Subject: Re: Variable objects: references formatting
Date: Thu, 04 May 2006 12:10:00 -0000 [thread overview]
Message-ID: <200605041610.16153.ghost@cs.msu.su> (raw)
In-Reply-To: <17497.43822.261192.673547@farnswood.snap.net.nz>
On Thursday 04 May 2006 11:20, Nick Roberts wrote:
> > Again, maybe you can provide specific case where this error is produced?
> > If it affect real-world cases we'd better fix it soon.
>
> It happens when I debug Emacs but I can't provide a simple case yet.
> However, do you see the problem with references that I mentioned earlier
> (that they don't seem to disappear from the changelist with -var-update)?
> This seems to be the case for any variable object made from a reference.
Yes, I see that for variable object created from reference, -var-update *
always mentions that. Looking at this under debugger, it seems that the call
to my_value_equal in varobj_update compares the value of *reference* to the
value of new *referenced-to* object. This happens in my_value_equal
(varobj.c):
static int
my_value_equal (struct value *val1, struct value *volatile val2, int
*error2)
{
/* Make sure we also know the contents of VAL2. */
val2 = coerce_array (val2);
Before this call, val2 is the value of reference itself. After this call, it
has value of referenced-to object. val1, on the other hand, is still the
value of reference.
I'm not sure what's the point of that call is, and importantly, I'm not sure
what would be the right behaviour. Variable object corresponding to reference
can be reported as updated either when:
(1) The referenced-to value changes
(2) The value of reference changes itself
(3) Both
I think that (1) is the right solution since in C++ reference can't change
value, and change of reference value in gdb can be only when reference goes
into scope or goes out of scope, so we're never interested in the value of
reference itself. In fact, both Eclipse and KDevelop hide the reference value
in its displays.
If (1) is what we need, there should be extra call to 'coerce_array' for
'val1'. In fact, that call should probably be done when varobj is first
created. Alas, quick attempt to do that results in segfault, and I'm out of
time for today. Feel free to beat me to it ;-)
- Volodya
next prev parent reply other threads:[~2006-05-04 12:10 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-03 23:05 Nick Roberts
2006-05-03 23:50 ` Jim Blandy
2006-05-04 1:53 ` Nick Roberts
2006-05-04 17:32 ` Jim Blandy
2006-05-04 22:30 ` Nick Roberts
2006-05-05 8:08 ` Jim Blandy
2006-05-04 5:30 ` Vladimir Prus
2006-05-04 6:21 ` Nick Roberts
2006-05-04 7:00 ` Vladimir Prus
2006-05-04 7:20 ` Nick Roberts
2006-05-04 12:10 ` Vladimir Prus [this message]
2006-05-08 12:41 ` [PATCH] -var-update [was Re: Variable objects: references formatting] Nick Roberts
2006-05-08 17:27 ` Jim Blandy
2006-05-08 21:17 ` Nick Roberts
2006-05-15 16:54 ` Daniel Jacobowitz
2006-05-17 0:45 ` Nick Roberts
2006-05-17 1:28 ` Daniel Jacobowitz
2006-05-17 1:43 ` Nick Roberts
2006-05-17 3:39 ` Daniel Jacobowitz
2006-05-19 7:41 ` [PATCH] -var-update Nick Roberts
2006-05-19 9:47 ` Vladimir Prus
-- strict thread matches above, loose matches on Subject: below --
2006-05-03 9:22 Variable objects: references formatting Vladimir Prus
2006-05-03 17:50 ` Jim Blandy
2006-05-03 18:08 ` Jim Blandy
2006-05-04 5:19 ` Vladimir Prus
2006-05-04 6:08 ` Jim Blandy
2006-05-04 6:10 ` Vladimir Prus
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=200605041610.16153.ghost@cs.msu.su \
--to=ghost@cs.msu.su \
--cc=gdb-patches@sources.redhat.com \
--cc=nickrob@snap.net.nz \
/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