interpret-run.cc [...]: Save the original insn for the breakpoint before posting...
authorKeith Seitz <keiths@redhat.com>
Fri, 20 Apr 2007 00:06:11 +0000 (00:06 +0000)
committerKeith Seitz <kseitz@gcc.gnu.org>
Fri, 20 Apr 2007 00:06:11 +0000 (00:06 +0000)
        * interpret-run.cc [insn_breakpoint]: Save the original
        insn for the breakpoint before posting the JVMTI notification.

From-SVN: r123985

libjava/ChangeLog
libjava/interpret-run.cc

index eb74cf830cdf5d5cf9f6943b35556b7c5f70a142..6e916a71b63735d98ab1db0a3c201985547b3759 100644 (file)
@@ -1,3 +1,8 @@
+2007-04-19  Keith Seitz  <keiths@redhat.com>
+
+       * interpret-run.cc [insn_breakpoint]: Save the original
+       insn for the breakpoint before posting the JVMTI notification.
+
 2007-04-19  Tom Tromey  <tromey@redhat.com>
 
        * gnu/javax/net/ssl/provider/SSLSocketFactoryImpl.h: Rebuilt.
index b8c88af78278c865f27cba843f6f6002d6365fb5..649b1bd2486702686101036b38c0e14373599c4e 100644 (file)
@@ -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