赞
踩
https://www.cnblogs.com/gelare/p/12704541.html
https://blog.csdn.net/weixin_33709219/article/details/92672559
https://blog.csdn.net/oqzuser12345678999q/article/details/106834556
问题汇总:
4、设置断点有问题,可以安装一下Native Debug插件。
https://www.douban.com/group/topic/89086749/
https://download.csdn.net/download/zblhero/985647
https://blog.csdn.net/csdnnews/article/details/86570676
https://blog.csdn.net/oh_futrue/article/details/104771914/
1.重启vsc
2.在Command Pallete里执行 "Developer: Reload Window"(不需要引号) 命令
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.json),自己修改program,设置要调试的程序。(安装visual studio)
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(Windows) 启动",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/rust/rust-test/r019echo-async/target/debug/r019echo-async.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false
}
]
}
选择C++(GDB/LLDB)时,会出现下面的信息,自己设置要调试的程序与gdb所在的路径。(安装 mingw64)
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) 启动",
"type": "cppdbg",
"request": "launch",
"program": "输入程序名称,例如 ${workspaceFolder}/a.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "/path/to/gdb",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
3、调试过程中,当要跟踪到rust内部代码时,会跳出如下提示框,这时需要建一个C:\rustc\b8cedc00407a4c56a3bda1ed605c6fc166655447的目录,并将用户目录下的.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src拷到前面的目录下。这样就能跟踪到内部代码了。
4、设置断点有问题,可以安装一下Native Debug插件。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。