调试MSVC ABI Rust程序时如何检查变量值? [英] How can I inspect variable values while debugging MSVC ABI Rust programs?

查看:458
本文介绍了调试MSVC ABI Rust程序时如何检查变量值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经下载了MSN版本的Rust 1.7.0,并从文档中跟随猜测游戏部分。

I've downloaded the MSVC ABI version of Rust 1.7.0 and followed the guessing game section from the docs.

我注意到,builds使用本机工具链(在我的情况下Visual Studio 2015 Update 2),因此生成本机调试器(如WinDBG,CDB或Visual Studio调试器)可以使用的本机PDB(调试符号)。我可以轻松设置断点,进入标准库源码等。

I notice that the builds use the native toolchain (Visual Studio 2015 Update 2 in my case) and therefore generate native PDBs (debugging symbols) consumable by native debuggers, such as WinDBG, CDB or the Visual Studio debugger. I can easily set breakpoints, step into standard library source and so on.

我不能做的是检查变量值。不管使用的调试器是什么,本地显示为空。

What I cannot do is to inspect variable values. Regardless of the debugger used, the 'Locals' display is empty.

从我可以收集到的内容中,Visual Rust / RustDT IDE在使用GDB或LLDB时显示本地后端,而不是本机Windows调试引擎。我不完全确定是否可以使用这些来调试为MSVC ABI编译的Rust程序(使用PDB等)。

From what I can gather, the Visual Rust/RustDT IDEs display locals when using GDB or LLDB as a backend, not the native Windows debugging engine. I'm not entirely sure if I can use these to debug Rust programs compiled for MSVC ABI (with PDBs and so on).

如果我想要有必要的调试经验,我唯一的选择是切换到GNU ABI?除此之外,是否有一种简单的方法来从原始调试工具(寄存器,内存映射)映射到Rust符号(变量值)?

If I want to have the necessary debugging experience, is my only option to switch to the GNU ABI? Barring that, is there an easy way to map to Rust symbols (variable values) from the raw debugging tools (registers, memory map)?

推荐答案

功能在实施之前不存在。 Rust是建立在LLVM和全面的PDB支持最近才被考虑LLVM 。现在,LLVM只有一个有限的PDB支持,在 Clang项目的MSVC兼容性页面。在我看来,最好等到支持到位,虽然其他编程语言有趣的解决方法已经被实施。

Features don't exist until they're implemented. Rust is built upon LLVM and 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 have been implemented.

这篇关于调试MSVC ABI Rust程序时如何检查变量值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆