This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] Save BP insn before posting event


Hi,

I found a little buglet with the breakpoint handling. If the debugger is sitting at a breakpoint and the user deletes the breakpoint, gij will not be able to continue execution of the application.

The attached patch fixes this little thinko.

Ok?

Keith

ChangeLog
2007-04-18  Keith Seitz  <keiths@redhat.com>

        * interpret-run.cc [insn_breakpoint]: Save the original
        insn for the breakpoint before posting the JVMTI notification.
Index: interpret-run.cc
===================================================================
--- interpret-run.cc	(revision 123960)
+++ interpret-run.cc	(working copy)
@@ -2600,18 +2600,19 @@
 	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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]