How to Debug Rust with Visual Studio Code

16 篇文章 0 订阅

 

 

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".

 

launch.json

 

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

Breakpoint settings

 

That's it!

Add a breakpoint. Press F5 to launch. Voila!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值