- Open VS Code Marketplace
- Search for Gimlet or click here
- Install the extension
- Restart VS Code if necessary
Note: Run
Gimlet: Run Setupin the Command Palette to verify all requirements.
Compile your program with debug symbols:
cargo-build-sbf --tools-version v1.54 --debug --arch v1Note: Re-run this command whenever you change your program code.
Run your test with the debugger enabled:
SBF_DEBUG_PORT=1212 SBF_TRACE_DIR=$PWD/target/sbf/trace cargo test --features sbpf-debuggerThis starts the test with a gdbstub listening on the specified TCP port, which Gimlet will connect to.
- Open the test file in VS Code — you'll see CodeLens buttons above test functions:
Sbpf Debug→ for individual Rust testsSbpf Debug All→ for TypeScript test suites
- Click the button to connect Gimlet and start step-by-step debugging.
Gimlet will automatically:
- Scan
target/deploy/debug/for compiled.soand.debugfiles - Connect to the gdbstub via
gdb-remoteon the configured TCP port - Load the correct
.debugELF binary into LLDB for symbol resolution
- Set breakpoints in your Solana program source code before or after connecting
- Use the VS Code debug controls to step through, continue, and inspect variables
For a comprehensive list of LLDB commands and their usage, refer to the official LLDB Commands Documentation.