diff options
author | Keith Seitz <kseitz@gcc.gnu.org> | 2007-01-31 23:25:39 +0000 |
---|---|---|
committer | Keith Seitz <kseitz@gcc.gnu.org> | 2007-01-31 23:25:39 +0000 |
commit | c6923d93eb220374aaa4d1880f74fb8bf178d7ea (patch) | |
tree | eb4277ca347ad0027cd2c3b4f8f751b457bc9b47 /libjava/interpret-run.cc | |
parent | f6671c9376c836de05883c3520d25e8f35a0fa1f (diff) | |
download | gcc-c6923d93eb220374aaa4d1880f74fb8bf178d7ea.tar.gz |
jvmti-int.h (JVMTI): Declare member "enabled".
* include/jvmti-int.h (JVMTI): Declare member "enabled".
* jvmti.cc (JVMTI): Add member "enabled".
(_Jv_GetJVMTIEnv): Mark JVMTI enabled.
* interpret.cc (_Jv_InterpMethod::ncode): Use JVMTI::enabled
instead of gnu::classpath::jdwp::Jdwp::isDebugging.
(_Jv_CompileMethod): If JVMTI is enabled, use run_debug
instead of run to compile the method.
* interpret-run.cc [DEBUG] (NEXT_INSN): Add JVMTI single step
notification.
From-SVN: r121442
Diffstat (limited to 'libjava/interpret-run.cc')
-rw-r--r-- | libjava/interpret-run.cc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libjava/interpret-run.cc b/libjava/interpret-run.cc index f3687459cb4..12d0b9a5683 100644 --- a/libjava/interpret-run.cc +++ b/libjava/interpret-run.cc @@ -248,7 +248,27 @@ details. */ #ifdef DIRECT_THREADED +#ifdef DEBUG +#undef NEXT_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) +#else +#undef NEXT_INSN #define NEXT_INSN goto *((pc++)->insn) +#endif + #define INTVAL() ((pc++)->int_val) #define AVAL() ((pc++)->datum) @@ -281,7 +301,22 @@ details. */ #else +#ifdef DEBUG +#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++]) +#else #define NEXT_INSN goto *(insn_target[*pc++]) +#endif #define GET1S() get1s (pc++) #define GET2S() (pc += 2, get2s (pc- 2)) |