Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <ghost@cs.msu.su>
To: gdb-patches@sources.redhat.com
Subject: Re: MI: fix base members in references
Date: Thu, 07 Dec 2006 06:53:00 -0000	[thread overview]
Message-ID: <el8dmi$g4a$1@sea.gmane.org> (raw)
In-Reply-To: <200612070921.25566.ghost@cs.msu.su>

Vladimir Prus wrote:

> On Thursday 07 December 2006 07:57, Nick Roberts wrote:
>> Nick Roberts writes:
>>  > More generally variable objects still don't seem to work (even with
>>  > Vladimir's yet to be committed patch) for references to pointers.
>>  > 
>>  > Assuming that the test program below makes sense, a variable object
>>  > for n1 has a value which includes the address and reports the value
>>  > has changed (as it used to do for pure references)
>> 
>> Sorry  thats actually rubbish (I was using an old GDB), but for
>> 
>>   struct S { int i; int j; };
>> 
>>   S *s;
>>   S *&s1 = s;
>> 
>> -var-create - * s
>> ^done,name="var1",numchild="1",type="S *"
>> (gdb)
>> -var-create - * s1
>> ^done,name="var2",numchild="0",type="S *&"
>> 
>> so the pointer is dereferenced by GDB but the reference to the pointer is
>> not.  I think that they should work in the same way but I'm not sure.
> 
> Guess what happens? The code path that computes the number of children --
> namely c_number_of_children -- does not seem to handle references.
> 
> So even while the underlying value is passed via coerce_ref, the reported
> number of children
> is always 0, so you  can't get any children. Ick!
> 
> On the other hand, that's no something that I've broke -- I did not even
> touch c_number_of_children or anything related. I guess we need to first
> commit the primary references patch and then fix c_number_of_children. Not
> that I find references to pointers very common thing, but better be
> correct.

To avoid potential confusion -- cplus_number_of_children does not handle
references. c_number_of_children is not expected to,
cplus_number_of_children might handle them, but does not.

- Volodya



  reply	other threads:[~2006-12-07  6:53 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-29 12:56 Vladimir Prus
2006-12-05 13:23 ` Vladimir Prus
2006-12-05 21:32   ` Jim Blandy
2006-12-05 20:59     ` Nick Roberts
2006-12-05 21:12       ` Daniel Jacobowitz
2006-12-05 21:25         ` Nick Roberts
2006-12-05 21:47           ` Daniel Jacobowitz
2006-12-05 22:27             ` Jim Blandy
2006-12-06  8:44             ` Vladimir Prus
2006-12-07  2:22             ` Nick Roberts
2006-12-07  5:24               ` Nick Roberts
2006-12-07  6:22                 ` Vladimir Prus
2006-12-07  6:53                   ` Vladimir Prus [this message]
2006-12-07 10:36                   ` Nick Roberts
2006-12-08 12:53                     ` Vladimir Prus
2006-12-09 22:10                     ` Vladimir Prus
2006-12-05 20:45 ` Daniel Jacobowitz
2006-12-06  9:04   ` Vladimir Prus
2006-12-06 20:29     ` Joel Brobecker
2006-12-06 20:33       ` Vladimir Prus
2006-12-09 21:27 Nick Roberts
2006-12-09 21:38 ` Vladimir Prus
2006-12-09 21:50   ` Nick Roberts
2006-12-09 22:15     ` Vladimir Prus
2006-12-10  4:19       ` Nick Roberts
2006-12-10 11:24         ` Vladimir Prus
2006-12-10 20:09           ` Nick Roberts
2006-12-10 20:42         ` Daniel Jacobowitz
2006-12-10 21:20           ` Nick Roberts
2006-12-11  2:35             ` Daniel Jacobowitz
2006-12-11  5:58               ` Nick Roberts
2006-12-11  7:22                 ` Vladimir Prus
2006-12-11  8:03                   ` Nick Roberts

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='el8dmi$g4a$1@sea.gmane.org' \
    --to=ghost@cs.msu.su \
    --cc=gdb-patches@sources.redhat.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