This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project. See the GDB home page for more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Name Mangling from Solaris CC


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 
  cplus_demangle(sun_args);
#else
  cplus_demangle(gnu_args);
#endif

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
function
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
cplus_demangle().
If you need more arguments, well, then you have to change every
occurence
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
more,
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
some
time improving free software. :-) Well, I'll give it a shot next week,
as
time permits. Now off into the weekend ... :-)

  Guenther