[RFA/JVMTI] SetEventNotificationMode and SetEventCallbacks

Keith Seitz keiths@redhat.com
Fri Sep 1 19:01:00 GMT 2006


Hi,

Let me apologize ahead of time for posting a nearly 1,000 line patch. I 
promise not to do it again (at least today!)...

This patch implements the two JVMTI functions $subject. As you can 
imagine, JVMTI event notifications in libgcj are going to be quite 
invasive. Hoping to minimize the damage from this, I've adopted 
basically the same technique that I was using with JDWP and 
Jdwp::isDebugging.

Only this time, it's not just a simple boolean check. :-(

The proposed method for adding event notifications to libgcj would look 
something like this (e.g. ThreadEnd):

#include <jvmti.h>
#include "jvmti-int.h"

...

   if (JVMTI_REQUESTED_EVENT (ThreadEnd))
     {
        _Jv_JVMTI_PostEvent (JVMTI_EVENT_THREAD_END, ending_thread);
     }

and so on. _Jv_JVMTI_PostEvent uses stdargs so that additional 
event-specific parameters may be passed via the same interface.

If this patch is accepted, I think it would be wise to build it on 
several different architectures before committing to ensure no weirdness 
occurs which would break gcc bootstrapping.

Comments/questions/concerns?

Keith

ChangeLog
2006-09-01  Keith Seitz  <keiths@redhat.com>

         * jvmti.cc (_Jv_JVMTI_RequestedEvents): New global.
         (_Jv_JVMTI_DisposeEnvironment): Check for enabled events.
         (check_enabled_event): New function.
         (check_enabled_events): New function.
         (post_event): New function.
         (_Jv_JVMTI_SetEventNotificationMode): New function.
         (_Jv_JVMTI_SetEventCallbacks): New function.
         (_Jv_JVMTI_Interface): Define SetEventNotificationMode and
         SetEventCallbacks members.
         * include/jvmti-int.h: New file.
         * include/jvmti_md.h (EVENT_SLOTS) [__GCJ_JNI_IMP__]: Define.
         (_CLASSPATH_JVMTIENV_CONTENTS) [__GCJ_JNI_IMPL__]: Define.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jvmti-events.patch
Type: text/x-patch
Size: 27407 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20060901/7fa4a20a/attachment.bin>


More information about the Java-patches mailing list