From b113c6fe62f275367ee6e274562c5b79e442df29 Mon Sep 17 00:00:00 2001 From: kseitz Date: Thu, 25 Jan 2007 00:40:45 +0000 Subject: * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121155 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/ChangeLog | 6 ++++++ libjava/interpret-run.cc | 29 +++++++++++++++++++++++++++-- libjava/interpret.cc | 7 ++++++- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 6b6749d4678..cfd061a0f05 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2007-01-24 Keith Seitz + + * 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 * prims.cc (_Jv_RunMain): Send JVMTI event notifications diff --git a/libjava/interpret-run.cc b/libjava/interpret-run.cc index 26cc4a616dd..95037903810 100644 --- a/libjava/interpret-run.cc +++ b/libjava/interpret-run.cc @@ -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 (method), + location); + JvAssert (bp != NULL); + + pc_t opc = reinterpret_cast (bp->getInsn ()); + +#ifdef DIRECT_THREADED + goto *(opc->insn); +#else + goto *(insn_target[*opc]); +#endif } } catch (java::lang::Throwable *ex) diff --git a/libjava/interpret.cc b/libjava/interpret.cc index dc63cc868e7..075a15a22db 100644 --- a/libjava/interpret.cc +++ b/libjava/interpret.cc @@ -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 #include +#include +#include "jvmti-int.h" + #include +#include +#include #ifdef INTERPRETER -- cgit v1.2.1