Patch: Use _Unwind_GetIPInfo in stacktrace.cc

Bryce McKinlay mckinlay@redhat.com
Thu Jul 6 23:23:00 GMT 2006


The new _Unwind_GetIPInfo function allows us to determine if a frame's 
IP points to the instruction following a call instruction, or to a 
faulting instruction itself. In the case where it points to a following 
instruction, we need to "roll back" the IP used in line-number lookup so 
that the line number is that of the call itself, not the next line.

Previously we would do this roll-back unconditionally, but this meant 
that exceptions generated by faults (eg NullPointerException) would 
sometimes show the wrong line number on their inner-most frame. Using 
_Unwind_GetIpInfo fixes this.

I'm also checking in a test case which verifies that stack trace line 
numbers are correct (now that it finally passes!). I'm checking this in 
to trunk.

Bryce



-------------- next part --------------
A non-text attachment was scrubbed...
Name: libjava-stacktrace-ipinfo.patch
Type: text/x-patch
Size: 4598 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20060706/08f79c4e/attachment.bin>


More information about the Java-patches mailing list