This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Backtrace is broken without -g
- From: Andrew Haley <aph at cambridge dot redhat dot com>
- To: java at gcc dot gnu dot org
- Date: Fri, 6 Sep 2002 20:06:39 +0100 (BST)
- Subject: Backtrace is broken without -g
You'll all have seen the forward about addr2line being broken, at
least for all ELF targets. This means that we don't get a working
backtrace unless we compile with -g. Even if my patch to addr2line is
accepted immediately, it'll be a long while before all platforms are
updated.
I'm going to work on getting unwind info from the reflection data.
However, this won't get line numbers, for which we'll still need
addr2line.
This will also be useful for security. A security manager needs a
reliable way to determine the protection domain of each method
invocation on the stack, so a clean and reasonably efficient way to
walk the stack is needed. The present method of invoking external
programs is okay for debugging, but not for runtime security checks.
The brokenness of addr2line kills this as a workable technique in any
case.
Also, as a result of this we'll have an easy way to determine the
class of a caller, so I'll make Class.forName() work correctly.
One thing: this may have an impact on the reflection data in a
compiled file. What are our rules about maintaining backwards binary
compatibility? Do we need to make libgcj compatible with java
binaries compiled with an earlier compiler?
Andrew.