You need to create a symbolic link of the node-litesmv which allows you to write litesvm in TS
Please clone this.
git clone https://github.com/procdump/litesvm
cd litesvm/crates/node-litesvm && yarn && yarn build -- --features sbpf-debuggerFinally in order for the Typescript tests to use the enhanced version of LiteSVM we've just built, create a symbolic link to it at the root directory of the anchor workspace. Be sure to use full path:
ln -s /path/to/enhanced/litesvm/crates/node-litesvm/litesvm local-litesvmGo into your test cases — either tests/anchor_cpi.ts or programs/program_a/tests/test_cpi.rs.
Above the test cases, there should be a Sbpf Debug or Sbpf Debug All CodeLens button.
- After clicking the button, it will start compiling your program using
anchor build, and then launch the LLDB debugger, where you can begin debugging. - It is recommended to use only the
continuecommand to skip stepping into built-in code and focus on debugging your own program.
In the workspace, you can find a native_apps directory where you can also test the debugger.
Make sure to open the specific project folder (e.g., one inside native_apps) as your workspace root in VS Code — Gimlet requires the project to be opened at the root level to detect and run correctly.