Class DebugStackTraceElement

java.lang.Object
com.oracle.truffle.api.debug.DebugStackTraceElement

public final class DebugStackTraceElement extends Object
Represents a trace element in the guest language stack trace. A guest language trace element consists of a name, the current source location and scopes containing local variables and arguments.

The difference between this class and DebugStackFrame is the limited life-time of DebugStackFrame, that is associated with a SuspendedEvent.

Since:
19.0
See Also:
  • Method Details

    • isInternal

      public boolean isInternal()
      Returns whether this trace element is a language implementation artifact.

      The decision to mark a method as internal is language-specific, reflects judgments about tool usability, and is subject to change.

      Since:
      19.0
    • isHost

      public boolean isHost()
      Returns true if this element is a host element. Host elements provide stack trace element, have no scope, and no source section.

      Host elements are provided only when host info is set to true.

      Since:
      20.3
      See Also:
    • getHostTraceElement

      public StackTraceElement getHostTraceElement()
      Provides a host element. Returns the host stack trace element if and only if this is host element.
      Returns:
      the host stack trace element, or null when not a host element.
      Since:
      20.3
      See Also:
    • getName

      public String getName()
      A description of the trace element. If the language does not provide such a description then null is returned.
      Since:
      19.0
    • getSourceSection

      public SourceSection getSourceSection()
      Returns the source section location of this trace element. The source section is null if the source location is not available.
      Since:
      19.0
    • getScope

      public DebugScope getScope()
      Get the current inner-most scope. The scope might not provide valid information if the execution path diverges from this trace element.
      Returns:
      the scope, or null when no language is associated with this frame location, or when no local scope exists.
      Since:
      19.0