Skip navigation links
GraalVM Truffle Java API Reference
1.0.0-rc13-dev

84a80c90728eb05a4e4a362ced325cd2a8fd889d

Package com.oracle.truffle.api.debug

The debug package contains a debugger API that can be used to install breakpoints, step through and control the execution of Truffle guest language applications.

See: Description

Package com.oracle.truffle.api.debug Description

The debug package contains a debugger API that can be used to install breakpoints, step through and control the execution of Truffle guest language applications. The debug package is designed to be used with multiple languages and multiple threads executing at the same time.

Getting started using the debugger

First the debugger instance needs to be discovered using a Truffle guest language with Debugger.find(com.oracle.truffle.api.TruffleLanguage.Env). Next a debugger session needs to be started with Debugger.startSession(SuspendedCallback) providing a callback that will be invoked whenever the execution is suspended. The debugger client can either install a breakpoint or suspend the current or next execution. Whenever the execution is suspended and the callback is invoked the client can decide step into, step out or step over the next statements. For a usage example please refer to DebuggerSession and Breakpoint.

Enable Debugging for your Truffle guest language

The platform's core support for debugging is language-agnostic. A language implementation enables debugging by supplying extra information in every AST that configures debugger behavior for code written in that particular language.

This extra information is expressed using so called tags. Tags can be applied to AST nodes by implementing the InstrumentableNode.hasTag(Class) method. The debugger requires the guest language to implement statement and call tags from the set of standard Truffle tags. Please refer to StandardTags on how to implement them.

Since:
0.8 or older
Skip navigation links
GraalVM Truffle Java API Reference
1.0.0-rc13-dev

84a80c90728eb05a4e4a362ced325cd2a8fd889d

Copyright © 2012, 2019, Oracle and/or its affiliates. All rights reserved.