Configuring your editor
These steps are not required, and most of this isn't specific to Burn, but it's definitely helpful if you haven't already done it.
VSCode
Install the following extensions:
- rust-lang.rust-analyzer for Rust syntax and semantic analysis
- tamasfe.even-better-toml for TOML syntax and semantic analysis
- serayuzgur.crates for managing dependencies
- vadimcn.vscode-lldb for debugging
Setting up the Debugger
To use the debugger, follow these steps:
- Open
Command Palette
withCtrl+Shift+P
orF1
and typeLLDB: Generate Launch Configurations from Cargo.toml
then select it, this will generate a file that should be saved as.vscode/launch.json
. - Select the configuration from the "run and debug" side panel, then select the target from the list.
Since this repo has
debug = 0
in the rootCargo.toml
to speed up compilation, you need replace it withdebug = true
in the rootCargo.toml
when using a debugger and breakpoints withlaunch.json
settings. - Now you can enable breakpoints on code through IDE then start debugging the library/binary you want, like in the following example:
If you're creating a new library or binary, keep in mind to repeat step 1 to always keep a fresh list of targets.