Class DebugContext

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

public final class DebugContext extends Object
Representation of a polyglot context in a guest language execution.
Since:
0.30
  • Method Details

    • evaluate

      public DebugValue evaluate(String code, String languageId)
      Evaluate the given code in this context.
      Parameters:
      code - the code to evaluate
      languageId - the language to evaluate the code in
      Returns:
      result of the evaluation
      Since:
      0.30
    • runInContext

      public <T> T runInContext(Supplier<T> run)
      Run supplied operations in this context. Use it to call methods on DebugValue that was obtained from evaluate(java.lang.String, java.lang.String).
      Type Parameters:
      T - a type of the return value of the supplier
      Parameters:
      run - a supplier representing operations to be run in this context
      Returns:
      the supplier's return value
      Since:
      0.30
    • getParent

      public DebugContext getParent()
      Get a parent context of this context, if any. This provides the hierarchy of inner contexts.
      Returns:
      a parent context, or null if there is no parent
      Since:
      0.30