enso/docs/debugger/dap.md
Pavel Marek 268e595ec1
Add Chrome devtools and DAP tools for debugging (#8344)
Adds chrome-inspector tool and Debug Adapter protocol tool for debugging Enso.

# Important Notes
The chrome devtools seems to be broken (tracked in https://github.com/oracle/graal/issues/7636). Even `graalpy --inspect ...` fails (Chrome devtools freezes after connecting to the server). This PR adds Debug adapter protocol tool for debugging as a workaround for chrome inspector. There is docs in [dap.md](https://github.com/enso-org/enso/pull/8344/files#diff-421574b50574cfe546e86d4b3d32d79b8b2087f2fe204f68e5cf2693af43bbe1)
2023-11-22 17:18:41 +00:00

1.3 KiB

Debug Adapter Protocol

Debug Adapter Protocol is yet another instrument available for a Truffle language. The DAP is a native protocol for VSCode and as such, works only via VSCode. To start Enso with DAP server waiting for a client to attach, launch enso via:

env JAVA_OPTS='-Dpolyglot.dap' ./built-distribution/enso-engine-*/enso-*/bin/enso --run *.enso

Once DAP server is started and ready for a client to be attached, the following output will be printed:

[Graal DAP] Starting server and listening on /127.0.0.1:4711

There is a Launch configuration in the repository in .vscode/launch.json with name Debug Adapter Protocol, you can start debugging via Run and Debug view by selecting the Debug adapter protocol configuration and pressing play: image

Another screenshot showing the DAP in action: image

Note that the port 4711 is the default port for DAP.