步骤1: 安装 VSCode 扩展 打开VSCode。 打开扩展市场(侧边栏点击扩展图标,或者快捷键Ctrl+Shift+X)。 搜索并安装CodeLLDB扩展。这个扩展提供了 Rust 和其他语言的调试支持。 扩展名称:CodeLLDB 安装完成后,你的 VSCode 就具备了调试功能。 步骤2: 安装 Rust 调试工具 确保你已经安装了 Rust 工具链。你可以通过运...
结果导致vscode设置的断点不能被命中。 最终查明原因是rustc默认不生成debug symbol,需要用rustc -g xxx.rs才能生成。-g = -C debuginfo=2, rust codegen参数参考如下: Codegen Options - The rustc book 测试了下,cargo build默认是带debug symbol的,可以使用cargo build --release去掉。 debug symbol确认方法...
通过使用VSCode 的 Remote - SSH 扩展,你可以轻松在 Windows 上连接到 Ubuntu 服务器进行 Rust 开发。这样你可以利用 Ubuntu 服务器的强大工具链和环境,同时通过 VSCode 保持高效的开发工作流。
Microsoft C++(ms-vscode.cpptools) –on Windows CodeLLDB(vadimcn.vscode-lldb) –on macOS/Linux If you forget to install one of these extensions, rust-analyzer will provide a notification with links to the VS Code Marketplace when you try to start a debug session. ...
3. 配置vscode开发环境 3.1. 安装 debug 插件CodeLLDB 插件安装完,用 vscode 打开上文创建的 hello 工程的目录,打开源文件 src\main.rs,按 F5 进行调试,下拉框选 LLDB ,关闭出现的报错窗口后,会再弹出自动创建 launch.json 的对话框,点“yes”,然后再 F5 进行调试就会成功,如下图所示: ...
这将生成一个名为.vscode/launch.json的文件,其中包含用于调试Rust程序的配置信息。设置断点:在你的Rust源代码文件中,单击行号旁边的空白区域以设置断点。你可以在多个地方设置断点。启动调试器:在"运行和调试"侧边栏选项卡中,从下拉菜单中选择你刚刚创建的Rust调试配置(通常名为"Launch"或"Debug"),然后点击绿色的"...
打开.vscode/ws.code-workspace 添加一个断点 选择你的调试启动配置 按F5 示例的文件夹结构: Cargo.toml [package]name="vscode_debug_example"version="0.1.0"authors=["Forrest Smith <forrestthewoods@gmail.com>"]edition="2018"[dependencies]microprofile="0.0.2"rand="0.6.5" ...
Rust: VSCode debug设置 Rust: VSCode debug设置 前提 切换到msvc toolchain by rustup default stable-x86_64-pc-windows-msvc 步骤 Install Rust and VS Code This should go without saying. Install VS Code Extensions You'll need to install an extension. Which one depends on your...
用同样的方法再安装 rust-analyzer 和 Native Debug 两个扩展。 重新启动 VSCode,Rust 的开发环境就搭建好了。 现在新建一个文件夹,如 runoob-greeting。 在VSCode 中打开新建的文件夹: 打开文件夹之后选择菜单栏中的"终端"-"新建终端",会打开一个新的终端: ...