PATCH: Fix demangler in symbol versioning

H. J. Lu hjl@lucon.org
Thu Dec 4 23:53:00 GMT 2003


On Thu, Dec 04, 2003 at 05:07:51PM -0500, Ian Lance Taylor wrote:
> Daniel Jacobowitz <drow@mvista.com> writes:
> 
> > > >    if (head->mask & BFD_ELF_VERSION_JAVA_TYPE)
> > > >      {
> > > > -      java_sym = cplus_demangle (sym, DMGL_JAVA);
> > > > +      java_sym = java_demangle_v3 (sym);
> > > >        if (!java_sym)
> > > >  	java_sym = sym;
> > > >      }
> > > 
> > > I'm puzzled as to how this could ever have worked.  I think you can
> > > only demangle Java via cplus_demangle() if you call
> > > cplus_demangle_set_style().  But perhaps I am missing something.
> > 
> > I am fairly certain it used to work.  A change here might explain
> > problems Ulrich Weigand saw in the GDB Java testsuite...
> 
> Ah, you're right, now I see how it works.

How? Where does gdb use Java symbol versioning script?

> 
> H.J., I don't see why this part of the patch is needed.  When
> cplus_demangle() is called with DMGL_JAVA, it simply turns around and
> calls java_demangle_v3() anyhow.

I got:

# gdb ld-new
(gdb) b main
Breakpoint 1 at 0x8057382: file
/export/linux/src/binutils/binutils/ld/ldmain.c, line 173.
(gdb) r
Starting program: /usr/local/bin/ld
 
Breakpoint 1, main (argc=1, argv=0xbfff9b64)
    at /export/linux/src/binutils/binutils/ld/ldmain.c:173
173       long start_time = get_run_time ();
(gdb) call cplus_demangle ("_ZN4java3awt10ScrollPane7addImplEPNS0_9ComponentEPNS_4lang6ObjectEi", 0)
$1 = 0x0
(gdb) call cplus_demangle ("_ZN4java3awt10ScrollPane7addImplEPNS0_9ComponentEPNS_4lang6ObjectEi", 4)
$3 = 0x0
(gdb) call java_demangle_v3 ("_ZN4java3awt10ScrollPane7addImplEPNS0_9ComponentEPNS_4lang6ObjectEi")
$4 = 0x80ff148 "java.awt.ScrollPane.addImpl(java.awt.Component,
java.lang.Object, int)"


H.J.



More information about the Binutils mailing list