OSDN Git Service

* interpret.cc (run_debug): Remove comment.
[pf3gnuchains/gcc-fork.git] / libjava / interpret-run.cc
index afabad2..f368745 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.
 
@@ -217,7 +217,7 @@ details.  */
     INSN_LABEL(invokespecial),
     INSN_LABEL(invokestatic),
     INSN_LABEL(invokeinterface),
-    0, /* Unused.  */
+    INSN_LABEL(breakpoint),
     INSN_LABEL(new),
     INSN_LABEL(newarray),
     INSN_LABEL(anewarray),
@@ -2463,6 +2463,36 @@ details.  */
 
       }
 #endif /* DIRECT_THREADED */
+
+    insn_breakpoint:
+      {
+       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)
     {