GrabBag/AppUtils/UIUtils/Inc/CrashHandler.h

29 lines
538 B
C
Raw Normal View History

2025-10-12 16:46:46 +08:00
#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