查看故障转储中的寄存器

发布于 2024-07-09 22:21:09 字数 76 浏览 15 评论 0原文

有没有办法在故障转储中查看每个堆栈帧中的寄存器内容? 寄存器窗口似乎包含异常发生时的寄存器,但能够在每个堆栈帧中查看它们的内容会很有用。

Is there a way to view the register contents in each stack frame in a crash dump?
The registers window seems to contain the registers when the exception occurred but it would be useful to be able to see their contents in each stack frame.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

睫毛溺水了 2024-07-16 22:21:09

根据调用约定,您可以获得一些保存在堆栈上的寄存器。 例如,在 cdecl 调用约定中,除了 EAX、ECX 之外的所有寄存器,和 EDX 需要由调用者或被调用者保存。 这三个寄存器是可破坏的,因此您通常无法从调用堆栈的较高层获取它们的值。 如果函数不使用必须保存的寄存器,则它不会保存它,但由于它不使用它,因此该寄存器在下一个更高的堆栈帧中具有相同的值。

Depending on the calling convention, you can get some of the registers which are saved on the stack. For example, in the cdecl calling convention, all of the registers except for EAX, ECX, and EDX are required to be saved, either by the caller or the callee. Those three registers are clobberable, so you generally won't be able to get their values from higher up in the call stack. If a function doesn't use a register that must be saved, then it won't save it, but since it doesn't use it, that register has the same value in the next higher stack frame.

憧憬巴黎街头的黎明 2024-07-16 22:21:09

经过一些研究和思考后,我意识到这可能是不可能的。 崩溃小型转储保存进程内存的某些区域(取决于传递给 MiniDumpWriteDump() 函数的标志)和足够的状态信息,以在调试器中重新创建崩溃发生的环境。 它没有每条指令甚至每个堆栈帧的处理器状态,它只知道异常发生时的处理器状态。

After doing some research and thinking about this a bit, I realized that it is probably not possible. A crash minidump saves certain areas of process memory (depending on the flags passed to the MiniDumpWriteDump() function) and enough state information to re-create the environment where the crash happened in a debugger. It does not have the processor state at each instruction or even at each stack frame, it only knows about the processor state when the exception occurred.

清风疏影 2024-07-16 22:21:09

在优化的构建中,确实堆栈中的一些信息可能会被丢弃,但是,您可以要求调试器尝试向您显示给定堆栈帧的信息。 首先执行“kn”查看带有帧编号的堆栈,然后尝试“.frame /c [frame]”或“.frame /r [frame]”。

查看帮助(“.hh”)以获取更多信息。

In optimized builds, it's true that some information down the stack may get tossed, however, you can ask the debugger to try and show you the information for a given stack frame. First do "kn" to see the stack with frame numbers, then try ".frame /c [frame]" or ".frame /r [frame]".

Check out the help (".hh") for more information.

§普罗旺斯的薰衣草 2024-07-16 22:21:09

我认为调试时也无法得到它。 您可以从寄存器获得的唯一值是它们在当前指令处的值。

I don't think you can get it either when debugging. The only value you can get from registers is their value at the current instruction.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文