Name Mangling from Solaris CC

Guenther Grau
Fri May 8 10:54:00 GMT 1998

Hi Jake,

Jake Colman wrote:
> Guenther,
> I am now subscribed to the gdb since this seems to becoming an ongoing
> conversation.

:-) Well, then I can strip off your address from the header as well, so
you don't get this mail twice, like I do :-)

>     Guenther> Well, depends on how you define fancy footwork. I guess an sed
>     Guenther> script and couple of lines of code should do the trick. Maybe
>     Guenther> I'll have a look at it next week. I will download the latest
>     Guenther> gdb-4.17 right now to have a look.
> Hmmmm.  So I suppose you'll rename every call to cplus-compile to something
> else in order to remove the conflict?  It just never occurred to me how easily

That's right. I don't know if the gdb-maintainer will accept such a
change, though.
Maybe I can do it in a less intrusive way with using
#ifdef __sun 

on every occurance of cplus_demangle, but IMHO it would be better if the
name of the function would change.

> one can make such a massive change.

Well, in the simplest case, you would use sed to rename the existing
to "gdb_cplus_demangle" and in the implementation body of the function
you'd just add one #ifdef __sun and use the sun version of
If you need more arguments, well, then you have to change every
of the call as well. We'll see...

> I already looked at source code and it seems to my untrained (with respect to
> gdb code) eye that it should be fairly easy.  All demangling is dispatched

I wouldn't expect any great problems here as well.

> through cplus_demangle where it uses a set of tests, dependant on the selected
> demangle style, to determine the demangled name.  For Solaris you would pass it
> right through their own function and short-circuit the whole thing.

Could be implemented like this. I'll have to think about this a little
if it makes sense to have this demangling style still switchable even if
we are on solaris. Anybody else got any comments on this?

> Having said that, I am not offering to do this!  :-)   You seem far more at
> ease with this than I but, if you do implement this, I will will be the first
> beta tester!

:-) Same all over. Almost noone want's to get his hands dirty and spend
time improving free software. :-) Well, I'll give it a shot next week,
time permits. Now off into the weekend ... :-)


More information about the Gdb mailing list