Skip to content

Simple Rust app which shows how to debug a Rust program in Visual Studio Code

Notifications You must be signed in to change notification settings

rekle/hello_rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hello Rust

Simple Rust app which shows how to debug a Rust program in Visual Studio Code

Initial Setup for Rust Debugging in VS Code

  1. Install 'rust-analyzer' VS Code Extension
  2. Install 'CodeLLDB' VS Code Extension (for MacOS) or 'Microsoft C++' VS Code Extension for Windows

Enabling Debug in a Rust Project

  1. Run 'cargo new <project_name>' from Terminal to create new Rust Project
  2. Run 'code <project_name>' from Terminal to open that project in VS Code
  3. Click on Run & Debug tab in VS Code
  4. Click on "Show all automatic debug configurations"
  5. Click on "Add configuration" in dropdown.
  6. Choose 'LLDB'
  7. Click 'Yes' on the dialog box that pops up.
  8. This will generate a new '.vscode/launch.json' file which will allow debugging.
  9. Set any breakpoints you need in the source.
  10. Go to the Run & Debug tab on VS Code.
  11. Click the Green arrow on the top to start running.

Links

About

Simple Rust app which shows how to debug a Rust program in Visual Studio Code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages