Is there a way to inspect the contents of the stack (both in terms of the values and the type of the values, and the current instruction point) programmatically on the JVM (even if it's vendor-specific)?
For example, I would like to inspect the current activation frame and extract the method name it belongs to, as well as stack variables. Furthermore, I would like to be able to iterate activation frames in this way.
Is this possible? At a first glance, the JVMTI seems to allow this, but its meant to be used as a native interface. It has been used to implement a Java library that can do these things, apparently - but this seems to be a bit dated. I was wondering if there is a solution integrated into the JVM api, or some other cross-platform JVM library that allows this.