From 0749076760a34a2d6df11647cabbb7b3d2750765 Mon Sep 17 00:00:00 2001 From: kseitz Date: Fri, 20 Apr 2007 00:06:11 +0000 Subject: * interpret-run.cc [insn_breakpoint]: Save the original insn for the breakpoint before posting the JVMTI notification. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123985 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/interpret-run.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'libjava/interpret-run.cc') diff --git a/libjava/interpret-run.cc b/libjava/interpret-run.cc index b8c88af7827..649b1bd2486 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 (method), location); JvAssert (bp != NULL); - pc_t opc = reinterpret_cast (bp->getInsn ()); + _Jv_JVMTI_PostEvent (JVMTI_EVENT_BREAKPOINT, thread, jni_env, + method, location); + + // Continue execution #ifdef DIRECT_THREADED goto *(opc->insn); #else -- cgit v1.2.3