StackFrame (Java SE 19 & JDK 19) (original) (raw)

All Superinterfaces:

[Locatable](Locatable.html "interface in com.sun.jdi"), [Mirror](Mirror.html "interface in com.sun.jdi")


The state of one method invocation on a thread's call stack. As a thread executes, stack frames are pushed and popped from its call stack as methods are invoked and then return. A StackFrame mirrors one such frame from a target VM at some point in its thread's execution. The call stack is, then, simply a List of StackFrame objects. The call stack can be obtained any time a thread is suspended through a call to ThreadReference.frames()

StackFrames provide access to a method's local variables and their current values.

The lifetime of a StackFrame is very limited. It is available only for suspended threads and becomes invalid once its thread is resumed.

Any method on StackFrame which takes StackFrame as an parameter may throwVMDisconnectedException if the target VM is disconnected and the VMDisconnectEvent has been or is available to be read from the EventQueue.

Any method on StackFrame which takes StackFrame as an parameter may throwVMOutOfMemoryException if the target VM has run out of memory.

Since:

1.3

Returns the values of all arguments in this frame.
Returns the values of multiple local variables in this frame.
[location](#location%28%29)()
Returns the Location of the current instruction in the frame.
void
Returns the value of 'this' for the current frame.
[thread](#thread%28%29)()
Returns the thread under which this frame's method is running.
Finds a LocalVariable that matches the given name and is visible at the current frame location.
Returns a list containing each LocalVariable that can be accessed from this frame's location.