Simple Rust app which shows how to debug a Rust program in Visual Studio Code
- Install 'rust-analyzer' VS Code Extension
- Install 'CodeLLDB' VS Code Extension (for MacOS) or 'Microsoft C++' VS Code Extension for Windows
- Run 'cargo new <project_name>' from Terminal to create new Rust Project
- Run 'code <project_name>' from Terminal to open that project in VS Code
- Click on Run & Debug tab in VS Code
- Click on "Show all automatic debug configurations"
- Click on "Add configuration" in dropdown.
- Choose 'LLDB'
- Click 'Yes' on the dialog box that pops up.
- This will generate a new '.vscode/launch.json' file which will allow debugging.
- Set any breakpoints you need in the source.
- Go to the Run & Debug tab on VS Code.
- Click the Green arrow on the top to start running.