[RFA] Update PC values for JVMTI stack tracing code
Kyle Galloway
kgallowa@redhat.com
Mon Apr 16 19:36:00 GMT 2007
Since the PC values stored in _Jv_InterpFrame are only updated when an
exception can be thrown, it is possible that the location value obtained
when getting a stack trace can be incorrect. Since threads can be
suspended any time through ThreadReference.Suspend, it is necessary that
the stack tracing code have access to the value of the PC in the
interpreter at all times. This patch pins the PC with a pointer in
_Jv_InterpFrame when debugging, and provides a method to retrieve the PC
value for use in stack tracing code. This corrects a problem with
eclipse not updating the source line display properly as well.
ChangeLog
2007-04-16 Kyle Galloway <kgallowa@redhat.com>
* include/java-interp.h (_Jv_InterpFrame) Add pointer to the
interpreter PC.
(<init>): Add a pointer to the interpreter PC as a parameter with
default value NULL.
(get_pc): New method.
* interpret-run.cc: If debugging, pass a pointer to the PC when
creating the stack frame.
* jvmti.cc (_Jv_JVMTI_GetStackTrace): Call _Jv_InterpFrame::get_pc
to get the PC.
Questions/comments/concerns?
Thanks,
Kyle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pcptr.patch
Type: text/x-patch
Size: 2783 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20070416/e35282f4/attachment.bin>
More information about the Java-patches
mailing list