aboutsummaryrefslogtreecommitdiff
path: root/libjava/interpret-run.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/interpret-run.cc')
-rw-r--r--libjava/interpret-run.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/libjava/interpret-run.cc b/libjava/interpret-run.cc
index b8c88af..649b1bd 100644
--- a/libjava/interpret-run.cc
+++ b/libjava/interpret-run.cc
@@ -2600,18 +2600,19 @@ details. */
Thread *thread = Thread::currentThread ();
JNIEnv *jni_env = _Jv_GetCurrentJNIEnv ();
- _Jv_JVMTI_PostEvent (JVMTI_EVENT_BREAKPOINT, thread, jni_env,
- method, location);
-
- // Continue execution
+ // Save the insn here since the breakpoint could be removed
+ // before the JVMTI notification returns.
using namespace gnu::gcj::jvmti;
Breakpoint *bp
= BreakpointManager::getBreakpoint (reinterpret_cast<jlong> (method),
location);
JvAssert (bp != NULL);
-
pc_t opc = reinterpret_cast<pc_t> (bp->getInsn ());
+ _Jv_JVMTI_PostEvent (JVMTI_EVENT_BREAKPOINT, thread, jni_env,
+ method, location);
+
+ // Continue execution
#ifdef DIRECT_THREADED
goto *(opc->insn);
#else