Is there a way to use the VSCode debugger on a Solana Anchor program. For instance how could I add a breakpoint and stop execution on line 6 of the Tic-Tac-Toe program whenever I run the JS tests.
I have followed these steps:
- Installed LLDB and rust-analyzer extensions in VSCode.
- Created a launch.json file with following content:
{ "version": "0.2.0", "configurations": [ { "type": "lldb", "request": "launch", "name": "Debug unit tests in library 'tic-tac-toe'", "cargo": { "args": [ "test", "--package=tic-tac-toe" ], "filter": { "name": "tic-tac-toe", "kind": "lib" } }, "args": [], "cwd": "${workspaceFolder}" } ] }
But this seems to execute cargo test
instead of anchor test
. How can I configure the debugger to work with anchor test
?