This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Demangling C++ global initializers and destructors


Hello.

Currently the -C option on the binutils tools does not demangle global
C++ initializers and destructors, because the demangler is confused by
the _GLOBAL__?_ prefix.  The following patch changes this by skipping
this prefix when handing down to the demangler.  This means for
example _GLOBAL__I__ZN10HashBasics13hashtablesizeEj is demangled to
_GLOBAL__I_HashBasics::hashtablesize(unsigned).

What do you think about such a change?

Or do you prefer a different style for the demangled version of these
symbols?

2003-02-28  Robert Schiele  <rschiele at uni-mannheim dot de>

	* binutils/budemang.c (demangle): Allow demangling of
          _GLOBAL__?_ symbols.

Index: binutils/budemang.c
===================================================================
RCS file: /cvs/src/src/binutils/budemang.c,v
retrieving revision 1.3
diff -u -r1.3 budemang.c
--- binutils/budemang.c	23 Jul 2002 05:12:26 -0000	1.3
+++ binutils/budemang.c	28 Feb 2003 14:31:55 -0000
@@ -54,6 +54,11 @@
   while (*p == '.')
     ++p;
 
+  /* This allows demangling of static initializers and
+     destructors.  */
+  if (! (strncmp(p, "_GLOBAL__I_", 11) && strncmp(p, "_GLOBAL__D_", 11)))
+    p += 11;
+
   res = cplus_demangle (p, DMGL_ANSI | DMGL_PARAMS);
   if (res)
     {

Robert

-- 
Robert Schiele			Tel.: +49-621-181-2517
Dipl.-Wirtsch.informatiker	mailto:rschiele at uni-mannheim dot de

Attachment: pgp00000.pgp
Description: PGP signature


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