rust debug之基於pdb

方法一:web

用visual studiowindows

 

步驟:visual-studio-code

安裝msvc工具鏈 rustup toolchain install stable-x86_64-pc-windows-msvcapp

切換到該工具鏈 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.71svisual-studio

 

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

而後你就能夠下斷電了this

 

方法二:用vscodedebug

參考連接 https://www.brycevandyk.com/debug-rust-on-windows-with-visual-studio-code-and-the-msvc-debugger/3d

步驟

安裝拓展 

  • 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

相關文章
相關標籤/搜索