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:
> > > 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.
>
> Oh, so it's already two-pass? If we could work out an API for the
> tree, then GDB could build and supply trees to get a canonical form
> back from the demangler. That has the added bonus of not needing to
> post-process the demangler output (if we know that we've got a GNU v3
> name and thus this demangler was used, of course - v2 would still need
> to be parsed). That sounds like an ideal solution.
It sounds workable to me. You may want to take a look at enum
d_comp_type and struct d_comp near the top of libiberty/cp-demangle.c,
and see if it is the type of thing you could imagine using.
> Do you have an opinion on the "A::bar const" DMGL_PARAMS issue that
> Michael Chastain noticed, by the way?
Yes, I think it should print A::bar without the const. I have the
patch in my sources, but I haven't checked it in yet.
Ian