On Tue, May 17, 2011 at 12:08 PM, Mark Roos <[email protected]> wrote: > It looks like JVMTI supports this but I have not been able to find a Java > class which gives access to the > apis that look interesting. > > Is this the right way to go? > > Does anyone know of some existing work that I could leverage?
There's a couple directions possible... Thobias Ivarsson, of the Jython project, hacked for a short amount of time on a native library that binds the JVMTI functions for frame inspection/mutation to JNI entry points, so they could be called from Java. I'm not sure where that code lives now. I have also used JDI to do frame inspection from within the same JVM. It works reasonably well, but as you might expect it's not the fastest thing in the world. Here's a sample, where I implemented ObjectSpace (heap-walking looking for specific object types) entirely in Java using JDI: https://github.com/headius/jdi_objectspace Because JDI only gets mirror references to objects int the remote JVM, I was actually *forced* to use the frame modification capabilities. I can confirm that it works. I have also had an interest for some time in using one of the various FFI layers (JNA, JFFI) to bind the JVMTI/JNI functions directly, allowing you to call them consistently from Java code. So far I have not made any progress on that. - Charlie _______________________________________________ mlvm-dev mailing list [email protected] http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
