This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Interactions between c++filter and assembler output
- To: law at cygnus dot com
- Subject: Re: Interactions between c++filter and assembler output
- From: Joe Buck <jbuck at Synopsys dot COM>
- Date: Fri, 26 Feb 99 11:13:29 PST
- Cc: Marc dot Espie at liafa dot jussieu dot fr, egcs at egcs dot cygnus dot com, egcs-bugs at egcs dot cygnus dot com
[ 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?