[RFA/JVMTI] SetEventNotificationMode and SetEventCallbacks

Keith Seitz keiths@redhat.com
Thu Sep 21 00:26:00 GMT 2006


Tom Tromey wrote:

> Sorry it took me so long to get back to this.
> Please feel free to ping me if my delays are blocking you.

I could say the same thing! You're doing fine. Whenever there is a
pause, I just go clean up another patch. [It's amazing how much cleanup
I left myself. Man, I'm a slob! :-)]

> Keith> +      void (**callback)()
> Keith> +	= reinterpret_cast<void (**)()> (&e->env->callbacks) + index;
> 
> This looks invalid to me though I don't have a reference to the
> standard for it.  Could we use a pointer-to-member instead?
> Sorry to keep going around on this.

Okay, I've changed this to use offsetof. Since JNI already has the 
restriction that function pointers are the same size as void*, this next 
revision should be closer. [And there's certainly no need to apologize 
for making sure I'm a straight shooter. You keep "going around on 
[anything]" you like.]

One or two notes about how this patch differs from the previous (or even
the original):

o It locks the environment list whenever it is traversed. Methinks this 
is safest to prevent segfaulting if a thread using JVMTI disposes an 
environment while the JVMTI framework is posting an event or attempting 
to check for enabled events.

o It corrects some varargs bugs that I discovered while testing.

o It adds (in a separate patch) tests for this stuff.

Keith

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

         * jvmti.cc (_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.
         * testsuite/libjava.jvmti/events.java: New file.
         * testsuite/libjava.jvmti/events.out: New file.
         * testsuite/libjava.jvmti/natevents.cc: New file.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: jvmti-events-revised.patch
Type: text/x-patch
Size: 24760 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20060921/bd307129/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jvmti-events-tests.patch
Type: text/x-patch
Size: 21657 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20060921/bd307129/attachment-0001.bin>


More information about the Java-patches mailing list