[PATCH] Demangler woes with current CVS and type names

Phil Edwards phil@jaj.com
Tue Jan 29 20:49:00 GMT 2002


On Tue, Jan 29, 2002 at 11:31:01PM -0500, Daniel Berlin wrote:
> On Tue, 29 Jan 2002, Phil Edwards wrote:
> > It's not a mangler bug:  the symbol appearing in the .o file is prefixed
> > with _Z, but the string returned from type_info's name() is not.  The ABI
> > specifies the object file symbol name, not AFAICT the name() string.
> 
> The ABI says it should return a mangled name for the type.
> Without the _Z, it's not a mangled name.
[...]
> Checking for _Z is always valid. Any valid new mangled name begins with 
> _Z.
> The grammar quite clearly says:
> 
> <mangled_name> :: = _Z <encoding>

Yeah, this drove me in circles for a little while.

The title of that section of the ABI clearly specifies object file names,
however, and the intro paragraphs beneath it restrict themselves to only
talking about object file symbols.

So while my testcase emits "St9bad_alloc" the output from nm correctly
reads "_ZTVSt9bad_alloc".  This is what finally led me to conclude that
the demangler needed to be more lenient.

Like you say, it could be a bug in that the ABI needs to change its
specification.  But I don't think that's going to happen.  :-)  I don't
particularly care one way or another; I just feel c++filt should be able
to read what g++ writes.


Phil

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams



More information about the Gcc-patches mailing list