]> gcc.gnu.org Git - gcc.git/commitdiff
interpret.cc: Include gnu/gcj/jvmti/Breakpoint.h...
authorKeith Seitz <keiths@redhat.com>
Thu, 25 Jan 2007 00:40:45 +0000 (00:40 +0000)
committerKeith Seitz <kseitz@gcc.gnu.org>
Thu, 25 Jan 2007 00:40:45 +0000 (00:40 +0000)
        * interpret.cc: Include gnu/gcj/jvmti/Breakpoint.h,
        gnu/gcj/jvmti/BreakpointManager.h, jvmti.h, and jvmti-int.h
        * interpret-run.cc: Implement insn_breakpoint.

From-SVN: r121155

libjava/ChangeLog
libjava/interpret-run.cc
libjava/interpret.cc

index 6b6749d46789957cf4f8d4ef179ff96e9f59606e..cfd061a0f052ff6a2bda55b3596c7fc940a7c0a5 100644 (file)
@@ -1,3 +1,9 @@
+2007-01-24  Keith Seitz  <keiths@redhat.com>
+
+       * interpret.cc: Include gnu/gcj/jvmti/Breakpoint.h,
+       gnu/gcj/jvmti/BreakpointManager.h, jvmti.h, and jvmti-int.h
+       * interpret-run.cc: Implement insn_breakpoint.
+
 2007-01-24  Keith Seitz  <keiths@redhat.com>
 
        * prims.cc (_Jv_RunMain): Send JVMTI event notifications
index 26cc4a616ddc62c53ddb41c916607989b2a829ae..950379038102037b52891b0153812e85a203deac 100644 (file)
@@ -1,6 +1,6 @@
 // interpret-run.cc - Code to interpret bytecode
 
-/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation
 
    This file is part of libgcj.
 
@@ -2466,7 +2466,32 @@ details.  */
 
     insn_breakpoint:
       {
-       // nothing just yet
+       JvAssert (JVMTI_REQUESTED_EVENT (Breakpoint));
+
+       // Send JVMTI notification
+       using namespace ::java::lang;
+       jmethodID method = meth->self;
+       jlocation location = meth->insn_index (pc - 1);
+       Thread *thread = Thread::currentThread ();
+       JNIEnv *jni_env = _Jv_GetCurrentJNIEnv ();
+
+       _Jv_JVMTI_PostEvent (JVMTI_EVENT_BREAKPOINT, thread, jni_env,
+                            method, location);
+
+       // Continue execution
+       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 ());
+
+#ifdef DIRECT_THREADED
+       goto *(opc->insn);
+#else
+       goto *(insn_target[*opc]);
+#endif
       }
     }
   catch (java::lang::Throwable *ex)
index dc63cc868e7a5c227bec27d08c487bfe3125ce71..075a15a22db0f91a5e890b5e539e4b99cb464614 100644 (file)
@@ -1,6 +1,6 @@
 // interpret.cc - Code for the interpreter
 
-/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation
 
    This file is part of libgcj.
 
@@ -37,7 +37,12 @@ details.  */
 #include <execution.h>
 #include <java/lang/reflect/Modifier.h>
 
+#include <jvmti.h>
+#include "jvmti-int.h"
+
 #include <gnu/classpath/jdwp/Jdwp.h>
+#include <gnu/gcj/jvmti/Breakpoint.h>
+#include <gnu/gcj/jvmti/BreakpointManager.h>
 
 #ifdef INTERPRETER
 
This page took 0.061062 seconds and 5 git commands to generate.