vscode-bazel
vscode-bazel copied to clipboard
Need Tutorial about Using the Starlark Debugger
Question: How to step debug bazel script? Similar question: how to debug bazel skylark script step by step with a debugger
According to Using the Starlark Debugger, I installed vscode-bazel on my Mac.
Currently, the Starlark Debugger can be used by right-clicking a build target in the Bazel Build Targets view and selecting "Build Target with Starlark Debugger". This will start the build inside the Visual Studio Code debugger (output will be redirected to the Debug Console pane) and it will pause on any breakpoints hit during execution.
When a Bazel thread is paused, you can step through Starlark code, add watch expressions, and execute arbitrary statements by typing them in the input area of the Debug Console.
Clicking the "Stop" button in the debugger will kill the Bazel process being debugger, allowing you to halt the current build. The Bazel server, however, will continue running.
By using a toy example, code from Bazel tutorial example
(base) ~/Documents/02_prj/bazel_tutorial/04_bzl_debug$ls -1
README
WORKSPACE
bazel-04_bzl_debug@
bazel-bin@
bazel-out@
bazel-testlogs@
src/
(base) ~/Documents/02_prj/bazel_tutorial/04_bzl_debug/src$ls -1
BUILD
bzl.bzl
greeting.cc
greeting.h
hello.cc
I have no idea how to launch Starlark Debugger. Please provide a step-by-step tutorial, especially screenshots of vscode.
don't have much experience with it, but this is the Bazel Build Targets view
