https://www.forrestthewoods.com/blog/how-to-debug-rust-with-visual-studio-code/

 

 

Install Rust and VS Code

This should go without saying.

Install Rust
Install Visual Studio Code

Install VS Code Extensions

You'll need to install an extension. Which one depends on your platform.

C/C++ (Windows)
CodeLLDB (OS X / Linux)

It probably makes sense to go ahead and install the Rust extension as well.

 

Configure VS Code

Now that your tools are installed you need to configure your VS Code launch properties.

Click Debug -> Add Configuration
If you're on Windows then select C++ (Windows)
If you're on Mac or Linux then select LLDB: Custom Launch

This should create and open launch.json. You'll have to manually change the executable name under "program".

 

How to Debug Rust with Visual Studio Code

 

Next, you should verify breakpoints are enabled. Some readers have reporting needing to this do. Some machines have it enabled by default. ????‍♂️

How to Debug Rust with Visual Studio Code

 

That's it!

Add a breakpoint. Press F5 to launch. Voila!

相关文章:

  • 2022-12-23
  • 2021-11-11
  • 2021-06-19
  • 2022-12-23
  • 2021-06-05
  • 2021-07-01
  • 2022-12-23
  • 2022-02-13
猜你喜欢
  • 2021-10-24
  • 2021-09-20
  • 2022-02-01
  • 2021-10-14
  • 2022-12-23
  • 2021-11-01
  • 2022-12-23
相关资源
相似解决方案