简体   繁体   English

我怎样才能解释.stackdump文件?

[英]How can I interpret a .stackdump file?

this question is likely a repeat of Using a stackdump from Cygwin executable - but I'm a beginner, and I didn't understand the answers, or even parts of the question. 这个问题很可能重复使用来自Cygwin可执行文件的stackdump - 但我是初学者,我不理解答案,甚至是部分问题。

I'm pretty new to c++ and programming and I'm developing in NetBeans. 我是c ++和编程的新手,我在NetBeans中开发。 I'm working on some code that compiles just fine, but fails while running. 我正在编写一些编译得很好的代码,但是在运行时失败了。 If I use the debugger I get the following error: 如果我使用调试器,我会收到以下错误:

1 [main] all 6200 exception::handle: Exception: STATUS_ACCESS_VIOLATION
881 [main] all 6200 open_stackdumpfile: Dumping stack trace to all.exe.stackdump

I've managed to find the file all.exe.stackdump, and I can read it via notepad++, but I don't understand what it means. 我已经设法找到文件all.exe.stackdump,我可以通过记事本++阅读它,但我不明白这是什么意思。 I gather by the other question that there's a user friendly way to decode this file, but my best guess bash$ gdb all.exe.stackdump was ineffective. 我收集另一个问题,有一个用户友好的方式来解码这个文件,但我最好的猜测bash$ gdb all.exe.stackdump是无效的。 What's the best way for me to use this file in debugging? 在调试中使用此文件的最佳方法是什么?

Just in case it's helpful, here's the contents of all.exe.stackdump 为了防止它有用,这里是all.exe.stackdump的内容

Exception: STATUS_ACCESS_VIOLATION at eip=00434C41
eax=2003A2E4 ebx=0028A95C ecx=00000000 edx=0028A95C esi=0028A9B0 edi=00000000
ebp=0028A9C8 esp=0028A930 program=[redacted for privacy/security], pid 6200, thread main
cs=0023 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame     Function  Args
0028A9C8  00434C41  (00000000, 2003A4F0, 0028A9E8, 00000000)
0028A9E8  00436B14  (00000000, 2003A4F0, 0028AA28, 0028D000)
0028AAF8  004036A4  (0028AB80, 2003A2B0, 00000014, 00000003)
0028ABD8  00403FBC  (00000001, 0028AC00, 200280E8, 2003A189)
0028ACF8  61007535  (00000000, 0028CD78, 61006B20, 00000000)
End of stack trace

You can use the "Function" addresses as arguments to addr2line . 您可以使用“Function”地址作为addr2line参数。

addr2line -f -C -e main.exe 0xADD4355

Filter it using awk and pipe in all addresses: 在所有地址中使用awk和pipe过滤它:

awk '/^[0-9]/{print $2}' main.exe.stackdump | addr2line -f -C -e main.exe

If you see ?? 如果你看到?? 's instead of function names, you'll need to rebuild with debug symbols ( -g , -ggdb3 , ... ) 而不是函数名,你需要使用调试符号重建( -g-ggdb3...

This is a common problem for many guys; 对许多人来说,这是一个普遍的问题; and usually they will tell you use gdb. 通常他们会告诉你使用gdb。 However this is not always a reasonable answer. 然而,这并不总是一个合理的答案。 You mustn't re-compile it, since it isn't guaranteed the new build has same symbol addresses as the crashed one. 您不能重新编译它,因为不能保证新版本与崩溃的版本具有相同的符号地址。 There are several tools that could be helpful: objdump, addr2line, etc. You can do "objdump -D -S build.out > build.rasm.txt", and then search those functions addresses among the text. 有几个工具可能会有所帮助:objdump,addr2line等。您可以执行“objdump -D -S build.out> build.rasm.txt”,然后在文本中搜索这些函数地址。 Addr2line is also a good choice for identify those functions. Addr2line也是识别这些功能的不错选择。 If you are going to handle such crash problems often, it's suggested writing a script tool to help your work. 如果您要经常处理此类崩溃问题,建议您编写一个脚本工具来帮助您完成工作。

Good luck. 祝好运。

Another way to find the problematic line would be to use gdb on your binary file. 找到有问题的行的另一种方法是在二进制文件上使用gdb。 So run gdb first: gdb main.exe 所以先运行gdb: gdb main.exe

Inside gdb run: info line *0xADD4355 在gdb里面运行: info line *0xADD4355

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM