Demangling of method names and addr2line/c++filt

Andrew Haley aph@redhat.com
Fri Feb 14 08:41:00 GMT 2003


Ranjit Mathew writes:
 > >  > Andrew> Addr2line is broken -- it should do whatever is appropriate to
 > >  > Andrew> the default naming convention on the platform.  So, if gcc
 > >  > Andrew> doesn't need a special flag to make it add underscores,
 > >  > Andrew> addr2line should be able to demangle without needing a special
 > >  > Andrew> flag either.
 > >  >
 > >  > That's how it seems to me, too.  I'm not opposed to working around
 > >  > this in libgcj somehow, but we must also file a binutils bug report.
 > >  > Ranjit, could you do this?
 > >
 > > I don't think it's a binutils bug.  AFAICS the problem is that the
 > > addr2line that's in gcc doesn't play with the c++filt in binutils.
 > > The addr2line in binutils is OK.  I think...
 > 
 > AFAICT, there's no addr2line in GCC only a GCJ-specific addr2name.awk
 > script.

I knew I'd got that the wrong way round.  Anyway, the c++filt in gcc
doesn't play with te addr2line in binutils.

 > Ok. Based on Mark's suggestion a while ago, how does this sound:
 > 
 > 1. We modify gnu/gcj/runtime/Namefinder.java to pass "-n" to c++filt if
 >    the "gnu.gcj.runtime.strip_leading_underscore" system property is set
 >    to "true" - it would be "false" by default. (BTW, does it mean that we
 >    explicitly pass "-_" to c++filt otherwise?)

This seems rather complex, although I wouldn't argue against such a
patch.  Can we not make it a compile time rather than a runtime
choice?  We might be able to #include the same file that c++filt
includes.

Andrew.



More information about the Java mailing list