This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[RFA/JVMTI] SingleStep notification
- From: Keith Seitz <keiths at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: Mon, 29 Jan 2007 12:16:53 -0800
- Subject: [RFA/JVMTI] SingleStep notification
Hello,
The attach patch adds the JVMTI event notification for single step. It's
pretty straightforward: according to the spec, "If a single step event
or breakpoint event is triggered at the current location, the event is
defined to occur immediately before the code at the current location is
executed."
Comments/questions/concerns?
Keith
ChangeLog
2007-01-29 Keith Seitz <keiths@redhat.com>
* interpret-run.cc (NEXT_INSN): Add JVMTI single step
notification.
Index: interpret-run.cc
===================================================================
--- interpret-run.cc (revision 121189)
+++ interpret-run.cc (working copy)
@@ -248,7 +248,20 @@
#ifdef DIRECT_THREADED
-#define NEXT_INSN goto *((pc++)->insn)
+#define NEXT_INSN \
+ do \
+ { \
+ if (JVMTI_REQUESTED_EVENT (SingleStep)) \
+ { \
+ JNIEnv *env = _Jv_GetCurrentJNIEnv (); \
+ jmethodID method = meth->self; \
+ jlocation loc = meth->insn_index (pc); \
+ _Jv_JVMTI_PostEvent (JVMTI_EVENT_SINGLE_STEP, thread, \
+ env, method, loc); \
+ } \
+ goto *((pc++)->insn); \
+ } \
+ while (0)
#define INTVAL() ((pc++)->int_val)
#define AVAL() ((pc++)->datum)
@@ -281,7 +294,18 @@
#else
-#define NEXT_INSN goto *(insn_target[*pc++])
+#define NEXT_INSN \
+ do \
+ { \
+ if (JVMTI_REQUESTED_EVENT (SingleStep)) \
+ { \
+ JNIEnv *env = _Jv_GetCurrentJNIEnv (); \
+ jmethodID method = meth->self; \
+ jlocation loc = meth->insn_index (pc); \
+ _Jv_JVMTI_PostEvent (JVMTI_EVENT_SINGLE_STEP, thread, \
+ env, method, loc); \
+ } \
+ goto *(insn_target[*pc++])
#define GET1S() get1s (pc++)
#define GET2S() (pc += 2, get2s (pc- 2))