bazelbuild/starlark

Debug Starlark Program Directly

wulixzCN opened this issue · 2 comments

I am using Starlark language to develop the project recently.
I wanna know can I debug the Starlark Program directly?
I read some documents like bazel, starlark debugger,etc. but no result...
Ask for help.

Bazel, which uses the Java implementation of Starlark, has a BUILD-file debugger, which uses some hooks in the interpreter, but there is no debugger for pure Starlark outside of Bazel. You could build one by modifying the Bazel code, though I would not regard the debug API as stable, and there is certainly a lot of room for improvement.

(In the Go implementation of Starlark, I once started work on a debugger but put it aside and don't expect to return to it any time soon.)

There is actually a DAP debugger in the Rust Starlark code - https://github.com/facebookexperimental/starlark-rust/tree/main/starlark/bin/dap is the code, but it's hard to integrate with projects that extend Starlark. But you can debug a pure-Starlark program.