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 throw
VMDisconnectedException 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 throw
VMOutOfMemoryException if the target VM has run out of memory.
| Modifier and Type | Method and Description |
|---|---|
| public List | Returns: a list containing aValue object for each argument
to this frame, in the order in which the arguments were
declared. If the method corresponding to this frame has
no arguments, an empty list is returned.Returns the values of all arguments in this frame. |
| public Value | Returns: theValue of the instance field.the variable)LocalVariable to be accessedGets the |
| public Map | getValues(List<? extends LocalVariable>
a list of variables)LocalVariable objects to be accessedReturns the values of multiple local variables in this frame. |
| public Location | Returns: theLocation of the current instruction.Redeclares com. Returns the |
| public void | setValue(LocalVariable
the field containing the requested value variable, Value the new value to assign value)Sets the |
| public ObjectReference | Returns: anObjectReference, or null if the frame represents
a native or static method.Returns the value of 'this' for the current frame. |
| public ThreadReference | Returns: aThreadReference which mirrors the frame's thread.Returns the thread under which this frame's method is running. |
| public LocalVariable | Returns: the matchingLocalVariable, or null if there is no
visible variable with the given name; frames in native methods
will always return null.the variable name to find name)Finds a |
| public List | Returns: the list ofLocalVariable objects currently visible;
the list will be empty if there are no visible variables;
specifically, frames in native methods will always return a
zero-length list.Returns a list containing each |
| getArgumentValues | back to summary |
|---|---|
| public List Returns the values of all arguments in this frame. Values are returned even if no local variable information is present.
| |
| getValue | back to summary |
|---|---|
| public Value getValue(LocalVariable variable) Gets the
| |
| getValues | back to summary |
|---|---|
| public Map Returns the values of multiple local variables in this frame.
Each variable must be valid for this frame's method and visible
according to the rules described in
| |
| location | back to summary |
|---|---|
| public Location location() Redeclares com. Returns the
| |
| setValue | back to summary |
|---|---|
| public void setValue(LocalVariable variable, Value value) throws InvalidTypeException, ClassNotLoadedException Sets the In the case of virtual threads, the target VM supports setting values of local variables when this frame is the topmost frame and the thread is suspended at an event. The target VM may support setting local variables in other cases. Object values must be assignment compatible with the variable type (This implies that the variable type must be loaded through the enclosing class's class loader). Primitive values must be either assignment compatible with the variable type or must be convertible to the variable type without loss of information. See JLS section 5.2 for more information on assignment compatibility.
| |
| thisObject | back to summary |
|---|---|
| public ObjectReference thisObject() Returns the value of 'this' for the current frame.
The
| |
| thread | back to summary |
|---|---|
| public ThreadReference thread() Returns the thread under which this frame's method is running.
| |
| visibleVariableByName | back to summary |
|---|---|
| public LocalVariable visibleVariableByName(String name) throws AbsentInformationException Finds a
| |
| visibleVariables | back to summary |
|---|---|
| public List Returns a list containing each Visibility is based on the code index of the current instruction of this StackFrame. Each variable has a range of byte code indices in which it is accessible. If this stack frame's method matches this variable's method and if the code index of this StackFrame is within the variable's byte code range, the variable is visible. A variable's byte code range is at least as large as the scope of that variable, but can continue beyond the end of the scope under certain circumstances:
| |