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]

Demangling problem



Apparently commas in names confuse the demangler after the addition of the
HP aCC support.

------- Forwarded Message

From:     Joe Buck <jbuck@Synopsys.COM>
To:       law@cygnus.com
cc:       Marc.Espie@liafa.jussieu.fr, egcs@egcs.cygnus.com,
	  egcs-bugs@egcs.cygnus.com
Date:     Fri, 26 Feb 99 11:13:29 PST
Subject:  Re: Interactions between c++filter and assembler output

[ c++filt barfs on .directive mangled_symbol,something_else ]

> This seems like a bug in c++filt to me.  I'd generally prefer to fix the
> bug rather than hack up the assembly code to avoid the bug :-)

The bug in the demangler was introduced by the HP aCC support.  Here's a
code fragment from the main program in libiberty/cplus-dem.c

	  /* Try to read a label.  */
	  while (c != EOF && (isalnum(c) || c == '_' || c == '$' || c == '.' ||
                              c == '<' || c == '>' || c == '#' || c == ',' || c
 == '*' || c == '&' ||
                              c == '[' || c == ']' || c == ':' || c == '(' || c
 == ')'))
                              /* the ones in the 2nd & 3rd lines were added to 
handle
                                 HP aCC template specialization manglings */
	    {
	      if (i >= MBUF_SIZE-1)
		break;
	      mbuffer[i++] = c;
	      c = getchar ();
	    }

Note that ',' is considered a legal character that can appear in a mangled
symbol, plus all kinds of other troublesome characters (parentheses, etc).
Can all those strange characters really appear in HP aCC symbols?  I
don't seem to see them with my copy of HP aCC.

Perhaps this loop based just on single characters needs to be replaced
by regular expression matching?





------- End of Forwarded Message