demangler, java, clinit, $E
Ian Lance Taylor
ian@wasabisystems.com
Sat Dec 20 15:55:00 GMT 2003
mec.gnu@mindspring.com (Michael Elizabeth Chastain) writes:
> There are also 127 names which did not demangle at all, even with
> "--format java". This happens with both old and new demangler.
> These worry me. I have appended the list.
...
> _ZN3org3xml3sax7helpers11NewInstance6class$$EPN4java4lang6StringE
I checked a patch into the gcc repository to demangle this sort of
name, in which the Java mangler inserted a '$' which is not counted in
the identifier length.
As I said in my message to gcc-patches:
As a side note, my guess is that adding the '$' is intended to make it
possible for Java routines to be implemented in C++. The C++ code
would simply append a '$' to the keyword, in order to be able to use
it in C++. Unfortunately, this won't work, because the C++ mangler
will count the '$' in the identifier length, unlike the Java mangler.
So if my guess about the intention is correct, then this is actually a
bug in the Java mangler. If the Java mangler is fixed to count the
'$' in the identifier length, then the patch below will only be needed
for older code. It will do no harm for newer code, except that in
extremely unusual situations it will demangle a symbol name which is
not actually a mangled name.
Ian
More information about the Gdb
mailing list