Multi-platform Crash Reporting for Qt Applications

I am building a multi-platform Qt application for which I would like the crash reporting system to generate a crash report when the user's computer crashes. At a later point, I should be able to view the stack trace with all the debug information from the crash report. I looked at google-breakpad.

But for this I feel like I need to switch to MSVC for windows. I am currently using MinGW for Windows and it will take me considerable time and effort to build all the libraries compiled with MSVC. Is there a way that I can use MinGW and still use google-breakpad? Or is there any other alternative that can work multiplatform and support mingw on windows?

+3


source to share


3 answers


libcrashreporter-qt "should provide easy integration of Google Breakpad crash reporting into a Qt application."



It contains fixes for the crossbar to make it possible with the MinGW tool combination.

+1


source


There is currently no MinGW support in Breakpad. I don't expect this to change anytime soon unless someone contributes to the port, since neither Google nor Mozilla is interested in MinGW. I don't know of any other crash reporting libraries that work in a cross-platform fashion, like Breakpad.



0


source


I don't know of an open source multi-platform crash reporting system other than google-breakpad. Even google-breakpad doesn't support MinGW, this is what I know, you can still get backtrace from your application. Project Dr. Mingw provide excellent dlls: mgwhelp.dll and exchndl.dll. To use you need:

  • compile with debug information. See Frequently Asked Questions in the Frequently Asked Questions section.
  • include mgwhelp.dll and exchndl.dll with your application programs
  • and load exchndl.dll when your application starts by explicitly calling LoadLibrary ("exchndl.dll")

For example, for example:

QFile drmingw("exchndl.dll");
if(drmingw.exists())
{// If don't want create reports just delete exchndl.dll from installer
    LoadLibrary(L"exchndl.dll");
}

      

After the crash, you will find a binary_name.RPT file with a backtrace in the same directory as the binary.

What else am I doing?

  • In debug models, release mode.
win32:!win32-msvc*{
    # Strip debug symbols.
    QMAKE_POST_LINK += objcopy --only-keep-debug bin/${TARGET} bin/${TARGET}.dbg &&
    QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} &&
    QMAKE_POST_LINK += objcopy --add-gnu-debuglink="bin/${TARGET}.dbg" bin/${TARGET}
}

      

  • Each run checks for the existence of the .RPT file and uploads or saves it to the reports directory. For example, I am using gist to collect reports.
0


source







All Articles