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
- fill-labs.dependi for managing dependencies
- vadimcn.vscode-lldb for debugging
Setting up the Debugger
To use the debugger, follow these steps:
- Open
Command PalettewithCtrl+Shift+PorF1and typeLLDB: Generate Launch Configurations from Cargo.tomlthen 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 = 0in the rootCargo.tomlto speed up compilation, you need replace it withdebug = truein the rootCargo.tomlwhen using a debugger and breakpoints withlaunch.jsonsettings. - 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.