This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: c++filt and addr2line [was Re: c++filt causing flashing consolewindows]
Andrew Haley wrote:
> Ranjit Mathew writes:
> > Øyvind Harboe wrote:
> > > Is there a way I can turn off the invocation of "c++filt"
> > > from my compiled app?
> >
> > See:
> >
> > http://gcc.gnu.org/onlinedocs/gcj/libgcj-Runtime-Properties.html
> >
> > and the *.NameFinder.* properties. In particular,
> > "gnu.gcj.runtime.NameFinder.demangle" and
> > "gnu.gcj.runtime.NameFinder.use_addr2line".
> >
> > I seem to remember that libiberty has the demangler
> > functions and perhaps we can directly use that instead
> > of invoking c++filt.
>
> addr2line can now do its own demangling, so we could dispense with
> c++filt in some cases. However, symbols in shared objects are
> retrieved by dlsym(), so we still need to demangle that.
I was thinking of cp_demangle( ) in libiberty/cp-demangle.c.
It would ensure that we are always up to date with
the state of the art in demangling and not be affected by
older c++filt executables on the user machine which do
not understand "style=java".
> > Ditto for using libbfd v/s invoking addr2line,
>
> This idea seems to come up once or twice a year.
>
> The problem is not technical: it is legal. We cannot do this unless
> the licences of libbfd and libiberty are changed. libiberty is LGPL,
> which might be OK in some cases, but it is not the same as
> GPL+exception. We can't license libgcj under two licences.
But we (GCJ/libgcj and the rest of GCC) already use lots
of functions from libiberty! For example, I was the one
who submitted a patch to use the "xregex" functions
from libiberty for systems that do not have their
own regex functions in libc.
> line number information. Many people want to keep this.
> Line numbers are the only remaining reason for all this
> machinery.
Hmmm...only for generating line numbers then, do we
need addr2line. That should be OK, I guess.
Ranjit.
--
Ranjit Mathew Email: rmathew AT hotmail DOT com
Bangalore, INDIA. Web: http://ranjitmathew.tripod.com/