This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Demangling of method names and addr2line/c++filt
> > 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.
> > Andrew> Perhaps so. I can't help feeling, however, that there is a
> > Andrew> non-negligible probability that this will break some other
> > Andrew> platforms.
> >
> > I have that suspicion, too, though no facts to back it. Is it likely
> > that anybody would know? Maybe some binutils hacker.
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?)
2. For Win32, we explicitly set this property to "true".
[NOTE: Core Win32 and MSVCRT do not have a dladdr( ) and they cannot execute
addr2name.awk, so addr2line is the only source of these names to c++filt.
However, Cygwin has the capability to do both. I do not know enough about
it though to say how it should behave there...maybe someone like David
Billinghurst can help us out here.]
Ranjit.