Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Ian Lance Taylor <ian@wasabisystems.com>
To: mec.gnu@mindspring.com (Michael Elizabeth Chastain)
Cc: gdb@sources.redhat.com, tromey@redhat.com
Subject: Re: demangler, java, clinit, $E
Date: Wed, 17 Dec 2003 03:52:00 -0000	[thread overview]
Message-ID: <m3llpc6qz1.fsf@gossamer.airs.com> (raw)
In-Reply-To: <20031217002907.3CA854B375@berman.michael-chastain.com>

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.

> DW.ref._ZN3org7eclipse3jdt4core8compiler21InvalidInputException6class$E

As far as I can tell, all the names which start with "DW.ref." are
created for debugging purposes.  I don't really know why.  See
dw2_force_const_mem() in gcc/dwarf2asm.c.  My thinking right now is
that these names should not be demangled.  They are not properly
mangled symbol names.

> _ZN3org3xml3sax7helpers11NewInstance6class$$EPN4java4lang6StringE

For some reason the Java mangler emits a '$' character after a member
name, if the name happens to be a C++ keyword with optional trailing
'$' characters.  I don't know why it bothers to do this.

I think this patch should lead to a correct demangling.

Ian

Index: cp-demangle.c
===================================================================
RCS file: /cvs/src/src/libiberty/cp-demangle.c,v
retrieving revision 1.40
diff -u -p -r1.40 cp-demangle.c
--- cp-demangle.c	16 Dec 2003 00:58:42 -0000	1.40
+++ cp-demangle.c	17 Dec 2003 03:48:13 -0000
@@ -1334,6 +1343,12 @@ d_identifier (di, len)
   name = d_str (di);
   d_advance (di, len);
 
+  /* A Java mangled name may have a trailing '$' if it is a C++
+     keyword.  We just ignore the '$'.  */
+  if ((di->options & DMGL_JAVA) != 0
+      && d_peek_char (di) == '$')
+    d_advance (di, 1);
+
   /* Look for something which looks like a gcc encoding of an
      anonymous namespace, and replace it with a more user friendly
      name.  */


  reply	other threads:[~2003-12-17  3:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-17  0:29 Michael Elizabeth Chastain
2003-12-17  3:52 ` Ian Lance Taylor [this message]
2003-12-17 16:17   ` Tom Tromey
2003-12-17 17:22     ` Ian Lance Taylor
2003-12-20 15:55 ` Ian Lance Taylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3llpc6qz1.fsf@gossamer.airs.com \
    --to=ian@wasabisystems.com \
    --cc=gdb@sources.redhat.com \
    --cc=mec.gnu@mindspring.com \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox