Demangling of method names and addr2line/c++filt
Andrew Haley
aph@redhat.com
Sat Feb 15 10:00:00 GMT 2003
Ranjit Mathew writes:
> > > The final logic then simply looks like:
> > >
> > > if ( usingAddr2Line && (USER_LABEL_PREFIX[0]=='_'))
> > > /* Explicitly pass "-n" to c++filt */
> > >
> > > IMHO, this looks like the safest approach.
> > >
> > > If this is OK, I can work towards a patch for this.
> >
> > Excellent.
>
> I spoke too soon...
>
> First off, USER_LABEL_PREFIX is not easily made available to libgcj
> and I could not see an easy way to get GCC's config.h (which
> includes target-specific headers that really define
> USER_LABEL_PREFIX, that too guarded by an "IN_GCC" definition)
> included in, say, natNameFinder.cc.
>
> More seriously though, the c++filt process is created only once in
> NameFinder.java for an entire stack of addresses which could
> potentially come from various sources (addr2line, addr2name.awk,
> interpreter and dladdr).
>
> Either we can spawn c++filt individually for each address (totally
> gross!), or we can prefix USER_LABEL_PREFIX to symbols given by
> addr2line before passing it to c++filt (somewhat less gross).
>
> It looks gross either way to me and not worth the effort - your
> reflection data based scheme is much more reliable and would work
> even if the binary is stripped. Except of course that Win32 would
> be using SJLJ and wouldn't benefit from it until somehow DWARF2 is
> brought back in... :-(
>
> I could just distribute a MinGW-specific binary with "-n" passed to
> c++filt as default...
Oh, I give up.
Let's pass "-n" always, but only check this in to the trunk, not 3.3.
If any other system breaks we'll find out about it.
Andrew.
More information about the Java
mailing list