Re: [rfa] generate symbols associated to namespaces

David Carlton
2003-06-27T16:04:14Z

On Tue, 24 Jun 2003 14:50:19 -0400, Daniel Jacobowitz <drow@mvista.com> said:
> On Tue, Jun 24, 2003 at 11:31:36AM -0700, David Carlton wrote:
>> On Sun, 22 Jun 2003 13:35:47 -0400, Daniel Jacobowitz <drow@mvista.com> said:

>>> I'd really, really like to see that in the next release of GDB; we'll
>>> see...]

>> I don't think this is a good idea. First, looking through my mailbox,

> I'll bow to your judgement on this. Right now it's our
> second-most-often reported bug in C++, after the constructor
> breakpoints thing.

Yes. Unfortunately, if we do a hasty job at this, we'll have a new
favorite bug in C++, namely people asking what all these "<incomplete
type>" messages are about, and why they can no longer print out
members of classes that they used to be able to. :-(

(Incidentally, in regards to constructor breakpoints, it looks less
likely than it did a couple of months ago that I'll have time to work
on that. So if you need an outlet for your considerable energies,
feel free to work on that one. :-) )

> However, if we do a limited form of inference - just
> DW_AT_MIPS_linkage_name based - I think the risk is much smaller.
> If we have time to play with it...

You'd be surprised. (Or at least I was.) It turns out that it's not
all that uncommon for type deduction to fail in ways that confuse
lookup_transparent_type no end. Sigh.

Anyways, don't worry: we really are making progress on this, and it
really will be there for 6.1.

>>> I think you're going to have to tie a fake block to each objfile
>>> instead, which should be an acceptable compromise. Definite
>>> namespaces would go in the global block of any objfile where they
>>> are found, possible namespaces would go in a special block in any
>>> objfile in which they are inferred.
>>> lookup_possible_namespace_symbol will gain a loop over all
>>> objfiles. A few functions will have to take an objfile parameter.

>> That sounds sensible: I guess I hadn't really realized how objfiles
>> work. I understand and agree with you about the possible namespace
>> symbol stuff, but let me double-check on what you want with
>> definite namespace symbols: should I stick those in each symtab
>> where they're found, or should I put them in a special symtab (one
>> per objfile, of course)? Either way is fine with me.

> I would prefer them in the normal global block, but if you've got a
> reason to do it the other way that's good too. I believe, with some
> minor massaging, that this will be easier. And it's fewer special
> cases.

You're probably right; I'll treat them like normal symbols, then.

I've looked at your code comments, and they all seem reasonable. I
hope I'll have a revised version of the patch today; job transition
issues will take up some of my time (I start full-time work at Kealia
today, so I have to figure out what they want me to do other than hack
GDB), but it's near the top of my priority list.