Package com.oracle.truffle.api.debug
Class DebugContext
java.lang.Object
com.oracle.truffle.api.debug.DebugContext
Representation of a polyglot context in a guest language execution.
- Since:
- 0.30
-
Method Summary
Modifier and TypeMethodDescriptionEvaluate the given code in this context.Get a parent context of this context, if any.<T> T
runInContext
(Supplier<T> run) Run supplied operations in this context.
-
Method Details
-
evaluate
Evaluate the given code in this context.- Parameters:
code
- the code to evaluatelanguageId
- the language to evaluate the code in- Returns:
- result of the evaluation
- Since:
- 0.30
-
runInContext
Run supplied operations in this context. Use it to call methods onDebugValue
that was obtained fromevaluate(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
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
-