Skip to content

Debug in VSCode

Install Rust

Install LLVM

Install VSCode Extensions

  • CodeLLDB
  • rust-analyzer

Create launch.json

  • create .vscode/launch.json file
json
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Debug Rust with LLDB",
      "type": "lldb",
      "request": "launch",
      "program": "${workspaceFolder}/target/debug/hw.exe",
      "args": [],
      "cwd": "${workspaceFolder}",
      "preLaunchTask": "rust: cargo build"
    }
  ]
}
  • Install GNU Toolchain
bash
rustup toolchain install stable-x86_64-pc-windows-gnu
rustup default stable-x86_64-pc-windows-gnu