This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: gdb/1465
- From: David Carlton <carlton at kealia dot com>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 26 Nov 2003 21:28:00 -0000
- Subject: Re: gdb/1465
- Reply-to: David Carlton <carlton at kealia dot com>
The following reply was made to PR c++/1465; it has been noted by GNATS.
From: David Carlton <carlton@kealia.com>
To: mec.gnu@mindspring.com (Michael Elizabeth Chastain)
Cc: gdb-gnats@sources.redhat.com
Subject: Re: gdb/1465
Date: Wed, 26 Nov 2003 13:20:16 -0800
On Wed, 26 Nov 2003 16:09:08 -0500 (EST), mec.gnu@mindspring.com (Michael Elizabeth Chastain) said:
> gnuv2_value_rtti_type wants to find the rtti type for the static type "A".
> So it calls lookup_typename.
> The objfile for the main executable has one symtab.
> This symtab has a static block, as usual.
> This static block has the symbol for "struct A".
> I want to find this symbol.
Right. But, as I just e-mailed in a separate thread, I think this is
part of the problem here - this symbol shouldn't be in a static block,
it should be in a global block. And my latest patch awaiting
approval, among other things, puts it in a global block.
> I think the real problem is the point where gnuv2_value_rtti_type
> specifies block=0. Conceptually, that looks wrong to me. gdb is
> looking up a type name and the type name might have different
> meanings in different scopes. lookup_typename really needs a
> correct block argument.
Yes, I agree.
> The problem is: there is no handy block pointer lying around in
> gnuv2_value_rtti_type, or anywhere in the call stack above it, for
> that matter. Can someone help me out here?
There's always get_selected_block (0), or whatever it's called. But
I'm not sure that that will always be the correct thing to do.
> Another question: v2 searches in VAR_DOMAIN, and v3 searches in
> STRUCT_DOMAIN. Why the difference?
Beats me. I think VAR_DOMAIN is better.
> (1) Change gnuv2_value_rtti_type from lookup_typename to
> lookup_symbol.
Yeah. After all, the only difference is that lookup_typename has the
primitive type stuff, but that shouldn't come into play for RTTI
information.
David Carlton
carlton@kealia.com