2019-08-23 11:56:54 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../../BeefySysLib/Common.h"
|
2020-05-28 07:25:25 -07:00
|
|
|
#include "../util/CritSect.h"
|
2019-08-23 11:56:54 -07:00
|
|
|
|
|
|
|
NS_BF_BEGIN
|
|
|
|
|
|
|
|
typedef void(*CrashInfoFunc)();
|
|
|
|
|
|
|
|
class CrashCatcher
|
|
|
|
{
|
2020-05-28 07:25:25 -07:00
|
|
|
public:
|
|
|
|
Array<CrashInfoFunc> mCrashInfoFuncs;
|
|
|
|
StringT<0> mCrashInfo;
|
|
|
|
bool mCrashed;
|
|
|
|
bool mInitialized;
|
|
|
|
CritSect mBfpCritSect;
|
|
|
|
EXCEPTION_POINTERS* mExceptionPointers;
|
|
|
|
LPTOP_LEVEL_EXCEPTION_FILTER mPreviousFilter;
|
|
|
|
bool mDebugError;
|
|
|
|
BfpCrashReportKind mCrashReportKind;
|
|
|
|
|
2019-08-23 11:56:54 -07:00
|
|
|
public:
|
|
|
|
CrashCatcher();
|
|
|
|
|
|
|
|
void Init();
|
|
|
|
void AddCrashInfoFunc(CrashInfoFunc crashInfoFunc);
|
|
|
|
void AddInfo(const StringImpl& str);
|
|
|
|
|
2019-09-12 09:47:19 -07:00
|
|
|
void Test();
|
2019-08-23 11:56:54 -07:00
|
|
|
void Crash(const StringImpl& str);
|
2020-05-28 07:25:25 -07:00
|
|
|
void SetCrashReportKind(BfpCrashReportKind crashReportKind);
|
|
|
|
|
|
|
|
static CrashCatcher* Get();
|
2019-08-23 11:56:54 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
NS_BF_END
|