This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Is physname mangled or not? (PR c++/8216)
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: jan dot kratochvil at redhat dot com (Jan Kratochvil)
- Cc: gdb-patches at sourceware dot org, keiths at redhat dot com (Keith Seitz)
- Date: Wed, 4 May 2011 19:32:43 +0200 (CEST)
- Subject: Re: Is physname mangled or not? (PR c++/8216)
Jan Kratochvil wrote:
> This physname change broke more issues, thanks for finding this one.
> The change I described in the bottom patch of:
> Re: [RFA] Typedef'd method parameters [2/4]
> http://sourceware.org/ml/gdb-patches/2011-04/msg00524.html
> that is the part:
> The mangled symbol name is not available for full symbols. */
> #define SYMBOL_LINKAGE_NAME(symbol) (symbol)->ginfo.name
Hmm, unless I'm missing something your comment
+ For full symbols return its demangled form of view of the linker, that is
+ with typedefs and toplevel const/volatile qualifiers of parameters removed,
+ for `f(int_typedef const)' it is `f(int)'. If no typedefs/qualifiers are
+ in use it's the same as SYMBOL_NATURAL_NAME. The mangled symbol name is not
+ available for full symbols. */
is not fully accurate either. As far as I can tell, that *is* true for
symbols read in by the DWARF reader. However, for symbols read in by
the stabs reads (or any of the others), SYMBOL_LINKAGE_NAME still refers
to the mangled name ... (Which strikes me as quite odd in the first
place; how is common code supposed to use this field?)
> > So I guess my question is, how is this supposed to work? Should
> > is_constructor_name accept demangled names?
>
> It cannot - it does not know the type name, does it?
Right, good point.
> > Should there be some generic routine that instead tests a demangled name for
> > whether it is a constructor (or destructor)?
>
> With a GCC debug/ fix it should work. Do you agree with its filing?
It seems that by now we have agreement that GCC is correct here. So I guess
I see two options remaining:
- Code a test that compares class name and (demangled) function name, but
explicitly removes template instance parameters first
or
- Have the symbol reader call is_constructor_name on the mangled name while
it is still available, and store that information somewhere in the type
information
Thoughts?
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com