我目前正在与一个应用程序合作,试图将BreakPad集成到一个Qt应用程序中。我找到了一个页面,帮助我完成了初始设置和瑕疵。
https://github.com/JPNaude/dev_notes/wiki/Using-Google-Breakpad-with-Qt
我仍然无法解决实际异常的问题。我创建了一个演示应用程序,它也遇到了同样的问题。以下是我测试时遵循的步骤。我现在正在进行调试测试。
- 构建应用程序 Run dump_syms.exe BreakpadTest.pdb > BreakpadTest.sym
- 运行应用程序并生成转储文件
- 运行 minidump_stackwalk dumpfile.dmp symbols > out.txt 2>&1
- 检查out.txt中的文件路径以放置BreakpadTest.sym
- 将BreakpadTest.sym文件移动到正确的位置
- 再次运行minidump_stackwalk dumpfile.dmp symbols > out.txt 2>&1
这会留下一个out.txt文件。
当我在我的演示应用程序中调用dumpFunc时,它会执行此代码
Breakpad::CrashHandler::instance()->writeMinidump();
我获得了以下输出
Thread 0 (crashed)
0 BreakpadTest.exe!Breakpad::CrashHandler::writeMinidump() [crashhandler.cpp : 118 + 0xb]
eip = 0x00c03a44 esp = 0x00affe18 ebp = 0x00affe48 ebx = 0x009fe000
esi = 0x00c01960 edi = 0x00c01960 eax = 0x00affaf0 ecx = 0x00affaf0
edx = 0x00affdbc efl = 0x00000216
Found by: given as instruction pointer in context
1 BreakpadTest.exe!dumpFunc() [main.cpp : 13 + 0xb]
eip = 0x00c0364f esp = 0x00affe50 ebp = 0x00affe50
Found by: call frame info
2 BreakpadTest.exe!main [main.cpp : 25 + 0x4]
eip = 0x00c03746 esp = 0x00affe58 ebp = 0x00affea0
Found by: call frame info
3 BreakpadTest.exe!WinMain [qtmain_win.cpp : 113 + 0xc]
eip = 0x00c14d3d esp = 0x00affea8 ebp = 0x00affed4
Found by: call frame info
4 BreakpadTest.exe!invoke_main [exe_common.inl : 94 + 0x1a]
eip = 0x00c13b7e esp = 0x00affedc ebp = 0x00affeec
Found by: call frame info
5 BreakpadTest.exe!__scrt_common_main_seh [exe_common.inl : 253 + 0x4]
eip = 0x00c13a00 esp = 0x00affef4 ebp = 0x00afff44
Found by: call frame info
6 BreakpadTest.exe!__scrt_common_main [exe_common.inl : 295 + 0x4]
eip = 0x00c1389d esp = 0x00afff4c ebp = 0x00afff4c
Found by: call frame info
7 BreakpadTest.exe!WinMainCRTStartup [exe_winmain.cpp : 16 + 0x4]
eip = 0x00c13b98 esp = 0x00afff54 ebp = 0x00afff54
Found by: call frame info
8 kernel32.dll + 0x162c3
eip = 0x76c962c4 esp = 0x00afff5c ebp = 0x00afff68
Found by: call frame info
9 ntdll.dll + 0x60fd8
eip = 0x77850fd9 esp = 0x00afff70 ebp = 0x00afffb0
Found by: previous frame's frame pointer
10 ntdll.dll + 0x60fa3
eip = 0x77850fa4 esp = 0x00afffb8 ebp = 0x00afffc0
Found by: previous frame's frame pointer
这很好,也是我想要的。但当我使用badFunc()时实际上引发了一个异常。
int *myNull = NULL;
*myNull = 42;
我得到了以下输出
Thread 0 (crashed)
0 ntdll.dll + 0x6e5fc
eip = 0x7785e5fc esp = 0x00eff09c ebp = 0x00eff10c ebx = 0x00000001
esi = 0x00000000 edi = 0x00000368 eax = 0x00000000 ecx = 0x6d278097
edx = 0x00000000 efl = 0x00000206
Found by: given as instruction pointer in context
1 KERNELBASE.dll + 0xcad51
eip = 0x74d7ad52 esp = 0x00eff114 ebp = 0x00eff120
Found by: previous frame's frame pointer
2 BreakpadTest.exe!google_breakpad::ExceptionHandler::WriteMinidumpOnHandlerThread(_EXCEPTION_POINTERS *,MDRawAssertionInfo *) [exception_handler.cc : 720 + 0x11]
eip = 0x009f72d0 esp = 0x00eff128 ebp = 0x00eff138
Found by: previous frame's frame pointer
3 BreakpadTest.exe!google_breakpad::ExceptionHandler::HandleException(_EXCEPTION_POINTERS *) [exception_handler.cc : 504 + 0xd]
eip = 0x009f6d71 esp = 0x00eff140 ebp = 0x00eff178
Found by: call frame info
4 KERNELBASE.dll + 0x15d411
eip = 0x74e0d412 esp = 0x00eff180 ebp = 0x00eff20c
Found by: call frame info
5 ntdll.dll + 0x9e0bc
eip = 0x7788e0bd esp = 0x00eff214 ebp = 0x00effa10
Found by: previous frame's frame pointer
6 ntdll.dll + 0x60fa3
eip = 0x77850fa4 esp = 0x00effa18 ebp = 0x00effa20
Found by: previous frame's frame pointer
这不是实际抛出异常的堆栈跟踪。有什么想法,或者如何更改以获取实际的堆栈跟踪?
演示应用程序 http://s000.tinyupload.com/?file_id=26352983283926785193