在Windows上实现堆栈跟踪 [英] Implementing a stack trace on Windows

查看:103
本文介绍了在Windows上实现堆栈跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我编写的游戏实施崩溃报告工具,我想为报告提供(相当)详细的本机堆栈跟踪。我已经实现了在GNU / Linux上,但我在Windows上遇到麻烦。以下是我试图工作的示例代码:

I'm implementing a crash reporting tool for a game I'm writing, and I'd like to provide a (fairly) detailed native stack trace for the report. I've already implemented this on GNU/Linux, but I'm having trouble on Windows. Here's some sample code I tried to get working:

http:// pastebin.com/m30b50f76

每次调用SymFromAddr时,都会出现尝试访问无效地址的错误。有没有人有使用StackWalk64 / SymFromAddr及其亲属的经验?

Each time I call SymFromAddr, I get the error "Attempt to access invalid address." Does anyone have experience with using StackWalk64/SymFromAddr and their kin?

谢谢,
Rob

Thanks, Rob

推荐答案

为什么不捕获minidump并将其与报告一起发送?您可以在调试器中自己重建堆栈跟踪,并且您将获得所有本地变量以及其他线程的所有堆栈。

Why not just capture a minidump and send that along with the report? You can rebuild the stack trace yourself in the debugger and you'll get all of your local variables as well as all of the stacks for the other threads.

此外,认为错误是因为您缺少程序的符号(PDB)。

Also, I think that error is because you're missing the symbols(PDB) for your program.

这篇关于在Windows上实现堆栈跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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