29 lines
538 B
C
29 lines
538 B
C
|
|
#ifndef CRASHHANDLER_H
|
||
|
|
#define CRASHHANDLER_H
|
||
|
|
|
||
|
|
#include <QString>
|
||
|
|
|
||
|
|
#ifdef Q_OS_WIN
|
||
|
|
#include <windows.h>
|
||
|
|
#ifdef _MSC_VER
|
||
|
|
#include <dbghelp.h>
|
||
|
|
#endif
|
||
|
|
#endif
|
||
|
|
|
||
|
|
class CrashHandler
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
static void registerCrashHandler();
|
||
|
|
static void setDumpPath(const QString& path);
|
||
|
|
static QString getDumpPath();
|
||
|
|
|
||
|
|
private:
|
||
|
|
static QString dumpPath;
|
||
|
|
static void crashHandlerFunction(int sig);
|
||
|
|
|
||
|
|
#ifdef Q_OS_WIN
|
||
|
|
static LONG WINAPI windowsCrashHandler(struct _EXCEPTION_POINTERS* exceptionInfo);
|
||
|
|
#endif
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif // CRASHHANDLER_H
|