Tested on macOS:
- Install the CodeLLDB VSCode extension. Unlike the debugger in the C/C++ extension, this allows to set breakpoints inside Zig "test" blocks (in the MS C/C++ extension debugger, breakpoints inside test blocks will be disabled once the debugger starts for unknown reasons.
- Set the
program
field with the build output, in this example it'shello
. Fulllaunch.json
looks like:
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug",
"program": "${workspaceFolder}/zig-out/bin/hello",
"args": [],
"cwd": "${workspaceFolder}",
}
]
}
That should be all, now set breakpoints in you code, and start the debugger in vscode.