This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: C++/Java regressions
Daniel Jacobowitz <drow@mvista.com> writes:
> On Tue, Nov 25, 2003 at 11:04:41PM -0500, Ian Lance Taylor wrote:
> > Then when gdb goes to look up T5<int>, it finds the DWARF psymbol for
> > the class itself, but it also finds that the symbol might be a
> > namespace. It then decides that it is a namespace.
>
> That sounds like the bit that's wrong. If it found a psymbol for the
> class why does it decide to call it a namespace?
Good question. My guess is that it's because lookup_symbol_aux()
calls current_language->la_lookup_symbol_nonlocal() before it calls
lookup_symbol_aux_psymtabs(). If I force la_lookup_symbol_nonlocal()
to return NULL, then lookup_symbol_aux_psymtabs() finds the typedef,
and `ptype T5<int>' works more or less correctly.
One solution might be that when gdb finds that a symbol has a class
definition, it makes sure that it does not have a pseudo-namespace
definition.
> I'm considering a routine for canonicalization of C++ demangled names.
If it helps, that's more or less what my libiberty C++ demangler does.
It first translate the name into a simple tree structure, and then
walks the tree translating it into a string. I could expose the tree,
although it would have to be documented a bit better.
Ian