This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MI: fix base members in references


On Sun, Dec 10, 2006 at 05:14:28PM +1300, Nick Roberts wrote:
> Vladimir Prus writes:
> 
> > does the code you've added ever does anything?
> 
> It seems to handle variable objects of references to pointers correctly.
> Have you tried it?

I have not been able to follow this discussion, but there needs to be a
better level of understanding here.  Vlad's asking "why does this fix
the problem" and you're responding "it seems to fix the problem". 
Every time I see something like that, I assume the problem is only
being fixed by accident - I'm a big believer in understanding causes.

get_type_deref looks at the type, and if it is a pointer or reference,
it dereferences it.  I assume that this is because we want to show the
children of pointers to structs and references to structs.  Is that
right?

If you want to show the children of the struct given a reference to a
pointer to the struct, then it should handle that too.  Sounds like it
should check for a reference and _then_ for a pointer, instead of
checking at the same time.

There are probably some missing calls to check_typedef here, too.  I
don't think you can have a typedef to a reference in C++, but you can
definitely have a typedef to a pointer, so it would probably be
advisable to call check_typedef before checking for TYPE_CODE_PTR.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]