public final class DebugStackFrame extends Object implements Iterable<DebugValue>
name, the current source location and
scopes containing local variables and arguments. Furthermore it allows to
evaluate guest language expressions in the lexical context of a particular
frame.
Debug stack frames are only valid as long as suspended events are valid.
Suspended events are valid as long while the originating SuspendedCallback is still
executing. All methods of the frame throw IllegalStateException if they become invalid.
Depending on the method, clients may access the stack frame only on the execution thread where
the suspended event of the stack frame was created and the notification was received. For some
methods, access from other threads may throw IllegalStateException. Please see the
javadoc of the individual method for details.
SuspendedEvent.getStackFrames(),
SuspendedEvent.getTopStackFrame()| Modifier and Type | Method and Description |
|---|---|
DebugValue |
eval(String code)
Evaluates the given code in the state of the current execution and in the same guest language
as the current language is defined in.
|
String |
getName()
A description of the AST (expected to be a method or procedure name in most languages) that
identifies the AST for the benefit of guest language programmers using tools; it might
appear, for example in the context of a stack dump or trace and is not expected to be called
often.
|
DebugScope |
getScope()
Get the current inner-most scope.
|
SourceSection |
getSourceSection()
Returns the source section of the location where the debugging session was suspended.
|
boolean |
isInternal()
Returns whether this stack frame is a language implementation artifact that should be hidden
during normal guest language debugging, for example in stack traces.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, iterator, spliteratorpublic boolean isInternal()
Language implementations sometimes create method calls internally that do not correspond to anything explicitly written by a programmer, for example when the body of a looping construct is implemented as callable block. Language implementors mark these methods as internal.
Clients of the debugging API should assume that displaying internal frames is unlikely to help programmers debug guest language programs and might possibly create confusion. However, clients may choose to display all frames, for example in a special mode to support development of programming language implementations.
The decision to mark a method as internal is language-specific, reflects judgments about tool usability, and is subject to change.
This method is thread-safe.
public String getName()
null is
returned.
This method is thread-safe.
public SourceSection getSourceSection()
null if the source location is not available.
This method is thread-safe.
public DebugScope getScope()
This method is not thread-safe and will throw an IllegalStateException if called on
another thread than it was created with.
public DebugValue eval(String code)
This method is not thread-safe and will throw an IllegalStateException if called on
another thread than it was created with.
code - the code to evaluate