Soumya Das
Soumya Das

Reputation: 1665

Multi-platform crash reporting system for Qt applications

I am creating a multi-platform Qt application for which I would want a crash reporting system to generate a crash report whenever there's a crash on the user's computer. At a later point, I should be able to view the stack trace with all the debug info from the crash report. I have looked at google-breakpad.

But to use that it seems I need to shift to MSVC for windows. Right now I am using MinGW on windows and it would take me significant time & effort to get all the different libraries compiled with MSVC. Is there any way I can use MinGW and still be able to use google-breakpad? Or is there some other alternative which can work multiplatform and support mingw on windows?

Upvotes: 5

Views: 2433

Answers (3)

jturney
jturney

Reputation: 2559

libcrashreporter-qt "is supposed to provide an easy integration of Google Breakpad crash reporting into a Qt application".

It contains patches to breakpad to make it buildable with the MinGW toolchain.

Upvotes: 1

dismine
dismine

Reputation: 575

I don't know any open multi-platform crash report system except google-breakpad. Even google-breakpad doesn't support MinGW, it is what i know, you still can get backtrace from your application. Project Dr. Mingw provide great dlls: mgwhelp.dll and exchndl.dll. For using you need:

  • compile with debug information. See Dr. Mingw FAQ.
  • include mgwhelp.dll and exchndl.dll with your application binaries
  • and load exchndl.dll when your application starts by explicitly calling LoadLibrary("exchndl.dll")

For example like this:

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

After crash you will find file binary_name.RPT with backtrace at the same directory where binary is.

What else i do?

  • In release mode strip debug symbols.
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 check if .RPT file exist and send or save in report directory. For example i use gist for collecting reports.

Upvotes: 1

Ted Mielczarek
Ted Mielczarek

Reputation: 3967

There's currently no support for MinGW in Breakpad. I don't expect that to change anytime soon unless someone contributes the port since neither Google nor Mozilla have any interest in MinGW. I'm not aware of any other crash reporting libraries that work in a cross-platform fashion like Breakpad does.

Upvotes: 0

Related Questions