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: A proposal to change cplus-dem.c.


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


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