From: kseitz Date: Wed, 24 Jan 2007 22:44:08 +0000 (+0000) Subject: * prims.cc (_Jv_RunMain): Send JVMTI event notifications X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0cfb29d407bd9e8fe287e6744bce9140dd3de841;p=thirdparty%2Fgcc.git * prims.cc (_Jv_RunMain): Send JVMTI event notifications for VM_INIT and VM_DEATH instead of the JDWP notifications. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121143 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index a69d1da20213..6b6749d46789 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2007-01-24 Keith Seitz + + * prims.cc (_Jv_RunMain): Send JVMTI event notifications + for VM_INIT and VM_DEATH instead of the JDWP notifications. + 2007-01-24 Keith Seitz * gnu/classpath/jdwp/natVMVirtualMachine.cc diff --git a/libjava/prims.cc b/libjava/prims.cc index 00d547017f46..e205dbbe521b 100644 --- a/libjava/prims.cc +++ b/libjava/prims.cc @@ -32,6 +32,9 @@ details. */ #include #endif +#include +#include "jvmti-int.h" + #ifndef DISABLE_GETENV_PROPERTIES #include #include @@ -66,8 +69,6 @@ details. */ #include #include #include -#include -#include #include #ifdef USE_LTDL @@ -1583,10 +1584,9 @@ _Jv_RunMain (JvVMInitArgs *vm_args, jclass klass, const char *name, int argc, jdwp->join (); } - // Send VmInit - gnu::classpath::jdwp::event::VmInitEvent *event; - event = new gnu::classpath::jdwp::event::VmInitEvent (main_thread); - gnu::classpath::jdwp::Jdwp::notify (event); + // Send VMInit + if (JVMTI_REQUESTED_EVENT (VMInit)) + _Jv_JVMTI_PostEvent (JVMTI_EVENT_VM_INIT, main_thread); } catch (java::lang::Throwable *t) { @@ -1601,12 +1601,12 @@ _Jv_RunMain (JvVMInitArgs *vm_args, jclass klass, const char *name, int argc, _Jv_ThreadRun (main_thread); - // Notify debugger of VM's death - if (gnu::classpath::jdwp::Jdwp::isDebugging) + // Send VMDeath + if (JVMTI_REQUESTED_EVENT (VMDeath)) { - using namespace gnu::classpath::jdwp; - event::VmDeathEvent *event = new event::VmDeathEvent (); - Jdwp::notify (event); + java::lang::Thread *thread = java::lang::Thread::currentThread (); + JNIEnv *jni_env = _Jv_GetCurrentJNIEnv (); + _Jv_JVMTI_PostEvent (JVMTI_EVENT_VM_DEATH, thread, jni_env); } // If we got here then something went wrong, as MainThread is not