选择Rust (CodeLLDB)作为调试环境。 VSCode 会在项目目录下生成.vscode/launch.json文件。它的基本配置如下: {"version":"0.2.0","configurations":[{"type":"lldb","request":"launch","name":"Debug Rust","program":"${workspaceFolder}/target/debug/my_project","args":[],"cwd":"${workspaceFolder}...
1、vscode安装插件 C/C++ (ms-vscode.cpptools),安装后运行Run->Start Debugging会出现C++(GDB/LLDB)与C++(Windows) 2、根据rust用的版本,如果用的是x86_64-pc-windows-msvc,调试时选择C++(Windows), 如果是x86_64-pc-windows-gnu,调试时选择C++(GDB/LLDB)。 选择C++(Windows)时, 会出现如下配置信息(launch...
1.下载rustup-init.exe(Rust安装工具) 点击下载rustup-initwin.rustup.rs 2. 使用镜像加速rustup安装 打开Powershell(Win+X +A)执行(执行完不要关闭,后面还会多次用到): [environment]::SetEnvironmentvariable("RUSTUP_DIST_SERVER", "https://mirrors.ustc.edu.cn/rust-static" , "User") [environme...
{ "version": "0.2.0", "configurations": [ { "name": "(Windows) Launch", "type": "cppvsdbg", "request": "launch", "program": "${workspaceRoot}/target/debug/foo.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceRoot}", "environment": [], "externalConsole": tru...
rust-analyzer C/C++ Native Debug Step1 点击"运行和调试", 选择C++(Windows) Step 2 在创建的配置文件, 修改program, 修改为项目编译后的exe路径 Step3 删除掉"console": "externalTerminal",(如果有的话) Step4 在上述文件中添加一行"preLaunchTask": "${defaultBuildTask}" ...
cargo new hello#创建一个名为hello的rust工程cdhello cargo build#构建cargo run#运行,看到输出hello world就没问题 3. 配置 vscode 开发环境 3.1. 安装 debug 插件 CodeLLDB 插件安装完,用 vscode 打开上文创建的 hello 工程的目录,打开源文件src\main.rs,按 F5 进行调试,下拉框选 LLDB ,关闭出现的报错窗口...
"name": "Debug", "program": "${workspaceFolder}/agent/src/ttt", "args": [], "cwd": "${workspaceFolder}", "preLaunchTask": "build_ttt" } ] } 二、配置preLaunchTask(其它文章配置default build task,使用rust:cargo build),个人用于尝试,简单配置了一个preLaunchTask,本来想简单尝试,没想到更复杂...
vscode调试rust 调试之前首先需要确认C++调试工具:例如linux下gdb或者windows下的vs。下面以windows为例 选中rs文件,这就F5,此时会弹出调试器,选择调试器。选择之后会默认在.vscode目录下创建launch.json,打开编辑...
安装这个 Rust 扩展也是很有必要的Rust extension。 配置VS Code 现在VS Code 工具已经安装完成,接下来需要配置你的 VS Code 启动项。 点击 调试 -> 添加配置 \ 如果你使用的是 Windows,选择C++ (Windows)\ 如果你使用的是 Mac/Linux,选择LLDB: Custom Launch ...