mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Added: * CPU brand identifier * CPU clock speed * GPU device string * GPU device state flags * RAM total (physical/virtual) * RAM avail (physical/virtual)
52 lines
1.2 KiB
C++
52 lines
1.2 KiB
C++
#ifndef CRASHHANDLER_H
|
|
#define CRASHHANDLER_H
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// Purpose:
|
|
//-----------------------------------------------------------------------------
|
|
class CCrashHandler
|
|
{
|
|
public:
|
|
CCrashHandler();
|
|
~CCrashHandler();
|
|
|
|
void Lock() const { m_Mutex.lock(); };
|
|
void Unlock() const { m_Mutex.unlock(); };
|
|
|
|
void FormatCrash();
|
|
void FormatCallstack();
|
|
void FormatRegisters();
|
|
void FormatSystemInfo();
|
|
|
|
const char* ExceptionToString() const;
|
|
|
|
void SetExceptionPointers(EXCEPTION_POINTERS* pExceptionPointers) { m_pExceptionPointers = pExceptionPointers; };
|
|
|
|
void WriteFile();
|
|
void GetCallStack();
|
|
|
|
private:
|
|
|
|
void FormatExceptionAddress(LPCSTR pExceptionAddress = nullptr);
|
|
void FormatExceptionCode();
|
|
|
|
void FormatAPU(const char* pszRegister, DWORD64 nContent);
|
|
void FormatFPU(const char* pszRegister, M128A* pxContent);
|
|
|
|
bool IsPageAccessible() const;
|
|
|
|
private:
|
|
enum
|
|
{
|
|
NUM_FRAMES_TO_CAPTURE = 60
|
|
};
|
|
|
|
void* m_hExceptionHandler;
|
|
PVOID m_ppStackTrace[NUM_FRAMES_TO_CAPTURE];
|
|
EXCEPTION_POINTERS* m_pExceptionPointers;
|
|
WORD m_nCapturedFrames;
|
|
string m_svBuffer;
|
|
mutable std::mutex m_Mutex;
|
|
};
|
|
|
|
#endif // CRASHHANDLER_H
|