This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Static builds vs. printStackTrace info
> Maybe that has changed in the last 2 months, but back then, it worked if
> you didn't strip the binary (remove "-s"), added debugging support (add
> "-g" and had addr2line in PATH.
> But as I said, it might be different now...
> Marco
Yes, it is.
I'm using:
gnu.gcj.runtime.NameFinder.show_raw=true
which is new: see
http://gcc.gnu.org/ml/java-patches/2006-q2/msg00301.html
I'm also using:
gnu.gcj.runtime.NameFinder.use_addr2line=false
which should eliminate the requirement to put addr2line in the path.
I'm compiling with (in the dynamic case):
/var/local/gcc/$1/bin/gcj
--main=$2 -g -o $2.bin $2.java
-Dgnu.gcj.runtime.NameFinder.show_raw=true
-Dgnu.gcj.runtime.NameFinder.use_addr2line=false
and linking with (in the static case):
/var/local/gcc/$1/bin/gcj -g --verbose --main=$2
-Dgnu.gcj.runtime.NameFinder.show_raw=true
-Dgnu.gcj.runtime.NameFinder.use_addr2line=false
-o $2.bin -static -static-libgcc -save-temps $2.o
libgcjx.o -lstdc++ -L. -lX11
(all on one line in each case, with the program already compiled to an
object in the static case)
That's supposed to avoid using addr2line. It's also supposed to spit out an
address whenever no line number can be resolved, and that's not working for
me in the static case. The dynamic binary says things like
"Throw.main(./Throw.bin [8049060])", but the static one says
"Throw.main(Unknown Source)". I don't see in the code why static and
dynamic should be different. I've confirmed that the NameFinder properties
are being set properly in both dynamic and static, by compiling a "dump
system properties" program using the same compile scripts.