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": [
                     "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?

1 Answer 1


Not that I know of. I do most of my debugging with the msg! macro and then inspect the program logs. See also this helpful Gist: https://gist.github.com/briangershon/89dfe197941c0abbd26db991ce350ce5

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.