windows下用vscode调试rust 常见问题

windows下用vscode调试rust

https://www.cnblogs.com/gelare/p/12704541.html

 

Windows上用VS Code调试Rust程序

https://blog.csdn.net/weixin_33709219/article/details/92672559

如何在 VSCode 中调试 Rust 代码

https://blog.csdn.net/oqzuser12345678999q/article/details/106834556

 

问题汇总:

4、设置断点有问题,可以安装一下Native Debug插件。

 

Windows下使用GDB + VS Code调试Rust程序

https://www.douban.com/group/topic/89086749/

https://download.csdn.net/download/zblhero/985647

https://blog.csdn.net/csdnnews/article/details/86570676

 

 

VSC 安装 Google Chrome Debugger 后出现Matches multiple schemas when only one must validate node 错误的解决方法

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插件。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值