public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [RFA] Save BP insn before posting event
@ 2007-04-19  3:36 Keith Seitz
  2007-04-19 23:55 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Keith Seitz @ 2007-04-19  3:36 UTC (permalink / raw)
  To: Java Patch List

[-- Attachment #1: Type: text/plain, Size: 456 bytes --]

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.

[-- Attachment #2: save-bp-insn.patch --]
[-- Type: text/x-patch, Size: 909 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA] Save BP insn before posting event
  2007-04-19  3:36 [RFA] Save BP insn before posting event Keith Seitz
@ 2007-04-19 23:55 ` Tom Tromey
  2007-04-20  0:06   ` Keith Seitz
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2007-04-19 23:55 UTC (permalink / raw)
  To: Keith Seitz; +Cc: Java Patch List

>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:

Keith> 2007-04-18  Keith Seitz  <keiths@redhat.com>
Keith>          * interpret-run.cc [insn_breakpoint]: Save the original
Keith>          insn for the breakpoint before posting the JVMTI notification.

Ok, thanks.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA] Save BP insn before posting event
  2007-04-19 23:55 ` Tom Tromey
@ 2007-04-20  0:06   ` Keith Seitz
  0 siblings, 0 replies; 3+ messages in thread
From: Keith Seitz @ 2007-04-20  0:06 UTC (permalink / raw)
  To: Java Patch List

Tom Tromey wrote:
>>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:
> 
> Keith> 2007-04-18  Keith Seitz  <keiths@redhat.com>
> Keith>          * interpret-run.cc [insn_breakpoint]: Save the original
> Keith>          insn for the breakpoint before posting the JVMTI notification.
> 
> Ok, thanks.

Done. Thank you for taking a look.

Keith

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-04-20  0:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-19  3:36 [RFA] Save BP insn before posting event Keith Seitz
2007-04-19 23:55 ` Tom Tromey
2007-04-20  0:06   ` Keith Seitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).