Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/142.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ Qt应用程序和googlebreakpad_C++_Qt_Google Breakpad - Fatal编程技术网

C++ Qt应用程序和googlebreakpad

C++ Qt应用程序和googlebreakpad,c++,qt,google-breakpad,C++,Qt,Google Breakpad,我目前正在使用一个试图将BreakPad集成到Qt应用程序中的应用程序。我找到了一个页面,帮助我解决了一些初始设置和怪癖 对于实际的异常,我仍然无法让它工作。我创建了一个演示应用程序,它也有同样的问题。以下是我要测试的步骤。我现在正在调试中测试 构建应用程序运行dump_syms.exe BreakpadTest.pdb>BreakpadTest.sym 运行应用程序并生成转储文件 运行minidump\u stackwalk dumpfile.dmp symbols>out.txt 2>&1

我目前正在使用一个试图将BreakPad集成到Qt应用程序中的应用程序。我找到了一个页面,帮助我解决了一些初始设置和怪癖

对于实际的异常,我仍然无法让它工作。我创建了一个演示应用程序,它也有同样的问题。以下是我要测试的步骤。我现在正在调试中测试

  • 构建应用程序运行dump_syms.exe BreakpadTest.pdb>BreakpadTest.sym
  • 运行应用程序并生成转储文件
  • 运行minidump\u stackwalk dumpfile.dmp symbols>out.txt 2>&1
  • Check out.txt以获取放置BreakpadTest.sym的文件路径
  • 将BreakpadTest.sym文件移动到正确的位置
  • 再次运行minidump\u 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
    
    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
    
    这很好,也是我想要的。但当我实际导致badFunc()出现异常时

    我得到以下输出

    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
    
    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
    
    这不是发生异常的实际堆栈跟踪。关于哪里出了问题,或者我如何更改它以获得实际堆栈,有什么想法吗

    演示应用程序

    我最近也遇到了同样的麻烦。我从许多地方收集资源,把我发现的所有东西都放在一起

    可能影响堆栈输出的一个因素是编译应用程序时使用的优化级别。强制创建调试符号并不重要。如果应用任何优化,堆栈有时会出现错误,因此您可以尝试禁用Qt项目(
    *.pro
    文件)中的优化,如下所示:

    CONFIG *= force_debug_info
    QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO -= -O2
    

    这是使用breakpad的一个隐藏面,文档中没有提到。我在使用它()时遇到了问题,但是当我们被迫禁用优化时,崩溃报告器有什么意义呢!?