如何在调试 MSVC ABI Rust 程序时检查变量值?
How can I inspect variable values while debugging MSVC ABI Rust programs?
我已经下载了 Rust 1.7.0 的 MSVC ABI 版本,并遵循了文档中的猜谜游戏部分。
我注意到构建使用本机工具链(在我的例子中是 Visual Studio 2015 更新 2),因此生成本机调试器(例如 WinDBG、CDB 或 Visual Studio调试器。我可以轻松设置断点,进入标准库源等等。
我不能做的是检查变量值。无论使用何种调试器,'Locals' 显示都是空的。
据我所知,Visual Rust/RustDT IDE 在使用 GDB 或 LLDB 作为后端时显示局部变量,而不是本机 Windows 调试引擎。我不完全确定我是否可以使用它们来调试为 MSVC ABI(使用 PDB 等)编译的 Rust 程序。
如果我想获得必要的调试经验,切换到 GNU ABI 是我唯一的选择吗?除此之外,是否有一种简单的方法可以从原始调试工具(寄存器、内存映射)映射到 Rust 符号(变量值)?
功能在实现之前不存在。 Rust 建立在 LLVM 之上,full PDB support has only recently been considered for LLVM. For now LLVM has only a limited PDB support, with the limitations best described on the Clang project's MSVC compatibility page. In my opinion, it's best to wait until the support is there, although for other programming languages interesting workarounds 已经实现。
我已经下载了 Rust 1.7.0 的 MSVC ABI 版本,并遵循了文档中的猜谜游戏部分。
我注意到构建使用本机工具链(在我的例子中是 Visual Studio 2015 更新 2),因此生成本机调试器(例如 WinDBG、CDB 或 Visual Studio调试器。我可以轻松设置断点,进入标准库源等等。
我不能做的是检查变量值。无论使用何种调试器,'Locals' 显示都是空的。
据我所知,Visual Rust/RustDT IDE 在使用 GDB 或 LLDB 作为后端时显示局部变量,而不是本机 Windows 调试引擎。我不完全确定我是否可以使用它们来调试为 MSVC ABI(使用 PDB 等)编译的 Rust 程序。
如果我想获得必要的调试经验,切换到 GNU ABI 是我唯一的选择吗?除此之外,是否有一种简单的方法可以从原始调试工具(寄存器、内存映射)映射到 Rust 符号(变量值)?
功能在实现之前不存在。 Rust 建立在 LLVM 之上,full PDB support has only recently been considered for LLVM. For now LLVM has only a limited PDB support, with the limitations best described on the Clang project's MSVC compatibility page. In my opinion, it's best to wait until the support is there, although for other programming languages interesting workarounds 已经实现。