How can I peek at the stack and registers

54 Views Asked by At

I would like to step through an executing Java method and view the local program stack and registers. For example if a PUSH instruction is executed, I want to see the value on the top of the stack, the stack depth, the values under that one, etc. Is there any way to capture that in Java?

1

There are 1 best solutions below

1
On

Suspend a thread, access its stack-frame and query current state using StackFrame object.