This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

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?






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