[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gdb
Subject:    Demangling problem
From:       Jeffrey A Law <law () hurl ! cygnus ! com>
Date:       1999-02-27 5:17:17
Message-ID: 26131.920092606 () hurl ! cygnus ! com
[Download RAW message or body]



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





[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic