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]
Other format: [Raw text]

Re: PATCH: Fix demangler in symbol versioning


"H. J. Lu" <hjl@lucon.org> writes:

> 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?

Sorry.  My referent was unclear.  I meant that I saw how a call to
cplus_demangle (sym, DMGL_JAVA) was equivalent to a call to
java_demangle_v3 (sym).

> > 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)"

Well, I get

(gdb) call cplus_demangle ("_ZN4java3awt10ScrollPane7addImplEPNS0_9ComponentEPNS_4lang6ObjectEi", 0)
$1 = 0x0
(gdb) call cplus_demangle ("_ZN4java3awt10ScrollPane7addImplEPNS0_9ComponentEPNS_4lang6ObjectEi", 4)
$2 = 0x80ec100 "java.awt.ScrollPane.addImpl(java.awt.Component, java.lang.Object, int)"
(gdb)  call java_demangle_v3 ("_ZN4java3awt10ScrollPane7addImplEPNS0_9ComponentEPNS_4lang6ObjectEi")
$3 = 0x80ec188 "java.awt.ScrollPane.addImpl(java.awt.Component, java.lang.Object, int)"

In other words, it works for me.  I'm using fully updated sources as
of right now.

Ian


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