当前位置:Gxlcms > 数据库问题 > rust debug之基于pdb

rust debug之基于pdb

时间:2021-07-01 10:21:17 帮助过:5人阅读

方法一:

用visual studio

 

步骤:

安装msvc工具链 rustup toolchain install stable-x86_64-pc-windows-msvc

切换到该工具链 rustup default stable-x86_64-pc-windows-msvc

编译代码 F:\rust_test\t1>cargo build
   Compiling t1 v0.1.0 (F:\rust_test\t1)
    Finished dev [unoptimized + debuginfo] target(s) in 1.71s

 

调试F:\rust_test\t1>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe" F:\rust_test\t1\target\debug\t1.exe

然后你就可以下断电了

 

方法二:用vscode

参考链接 https://www.brycevandyk.com/debug-rust-on-windows-with-visual-studio-code-and-the-msvc-debugger/

步骤

安装拓展 

  • C/C++: Brings in support for debugging MSVC applications. Since we‘re using MSVC behind the scenes, this gives us some debugging support for our Rust programs.
  • Native Debug: Allows us to set breakpoints by clicking next to line numbers.

配置

技术图片

 

 

 技术图片

 

遗留问题

在debug的时候vscode总是找不到代码

但是goto definition是对的

 暂时解决方案: xcopy /c/d/e C:\Users\cutep\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust g:\rustc\fc50f328b0353b285421b8ff5d4100966387a997

 

rust debug之基于pdb

标签:files   x86_64   ring   uil   bsp   mmu   break   png   mpi   

人气教程排行