This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: A proposal to change cplus-dem.c.
- To: gcc at egcs dot cygnus dot com
- Subject: Re: A proposal to change cplus-dem.c.
- From: Stan Shebs <shebs at andros dot cygnus dot com>
- Date: 01 Oct 1999 11:13:13 -0700
- Newsgroups: cygnus.egcs
- Organization: Cygnus Solutions
- References: <199910011548.IAA05995@atrus.synopsys.com>
Joe Buck <jbuck@synopsys.COM> writes:
> > As you may have noticed, cplus-dem.c is kind of misleading. As of
> > today, it can demangle both C++ and Java.
>
> Actually, cplus-dem.c can do less than it could do before: it is no
> longer useful for demanging assembly code. The reason is that the
> addition of HP support means that commas may appear in mangled names,
> so that when cplus-dem.c sees a mangled symbol followed by a comma
> (in assembly code) it messes up. In essence, g++ users suffer because
> someone added support for the HP aCC compiler.
I'm curious, I hadn't heard of anyone running into a problem with
commas in mangled names before, and I'm unclear on how this can happen
in assembly code. Could you show a simple example please?
> The reason for the problem is that its logic for finding the end of a
> mangled symbol is too simplistic (accept any character that might appear
> in a mangled symbol). It needs to shift to something smarter. The most
> powerful and easy-to-maintain approach would be to use regular expressions.
That does seem logical. I wonder why the demangler doesn't do this
already...
Stan