1 #ifndef _WHEATYEXCEPTIONREPORT_
2 #define _WHEATYEXCEPTIONREPORT_
4 #if PLATFORM == PLATFORM_WINDOWS && !defined(__MINGW32__)
13 #define countof _countof
15 #define WER_MAX_ARRAY_ELEMENTS_COUNT 10
16 #define WER_MAX_NESTING_LEVEL 5
17 #define WER_LARGE_BUFFER_SIZE 1024 * 128
123 if (!formatted.empty())
128 formatted +=
" = " +
Value;
155 PEXCEPTION_POINTERS pExceptionInfo);
174 static bool FormatSymbolValue(PSYMBOL_INFO, STACKFRAME64 *,
char * pszBuffer,
unsigned cbBuffer);
202 typedef NTSTATUS(NTAPI*
pRtlGetVersion)(PRTL_OSVERSIONINFOW lpVersionInformation);
213 #endif // _WHEATYEXCEPTIONREPORT_
void format(BasicFormatter< Char > &f, const Char *&format_str, const T &value)
Definition: format.h:2963
bool HasChildren
Definition: WheatyExceptionReport.h:143
bool Logged
Definition: WheatyExceptionReport.h:142
static HANDLE m_hProcess
Definition: WheatyExceptionReport.h:196
static LPTSTR GetExceptionString(DWORD dwCode)
Definition: WheatyExceptionReport.cpp:590
const char *const rgBaseType[]
Definition: WheatyExceptionReport.h:58
static BasicType GetBasicType(DWORD typeIndex, DWORD64 modBase)
Definition: WheatyExceptionReport.cpp:1335
static void PrintSystemInfo()
Definition: WheatyExceptionReport.cpp:399
Definition: WheatyExceptionReport.h:32
static pRtlGetVersion RtlGetVersion
Definition: WheatyExceptionReport.h:203
Definition: WheatyExceptionReport.h:34
DWORD_PTR _offset
Definition: WheatyExceptionReport.h:109
std::string Type
Definition: WheatyExceptionReport.h:138
static BOOL _GetProcessorName(TCHAR *sProcessorName, DWORD maxcount)
Definition: WheatyExceptionReport.cpp:186
void * HANDLE
Definition: CascPort.h:146
static char * PrintSymbolDetail(char *pszCurrBuffer)
Definition: WheatyExceptionReport.cpp:1445
static std::stack< SymbolDetail > symbolDetails
Definition: WheatyExceptionReport.h:198
const size_t bufferSize
Definition: RASession.h:31
DWORD _type
Definition: WheatyExceptionReport.h:108
std::string Prefix
Definition: WheatyExceptionReport.h:137
static BOOL CALLBACK EnumerateSymbolsCallback(PSYMBOL_INFO, ULONG, PVOID)
Definition: WheatyExceptionReport.cpp:826
static LONG WINAPI WheatyUnhandledExceptionFilter(PEXCEPTION_POINTERS pExceptionInfo)
Definition: WheatyExceptionReport.cpp:104
static BOOL GetLogicalAddress(PVOID addr, PTSTR szModule, DWORD len, DWORD §ion, DWORD_PTR &offset)
Definition: WheatyExceptionReport.cpp:639
SymbolDetail()
Definition: WheatyExceptionReport.h:115
std::string Suffix
Definition: WheatyExceptionReport.h:139
static void GenerateExceptionReport(PEXCEPTION_POINTERS pExceptionInfo)
Definition: WheatyExceptionReport.cpp:473
Definition: WheatyExceptionReport.h:27
Definition: WheatyExceptionReport.h:26
Definition: WheatyExceptionReport.h:146
#define MAX_PATH
Definition: CascPort.h:160
#define false
Definition: CascPort.h:18
char TCHAR
Definition: CascPort.h:148
std::set< SymbolPair > SymbolPairs
Definition: WheatyExceptionReport.h:111
Definition: WheatyExceptionReport.h:37
int LONG
Definition: CascPort.h:138
static TCHAR m_szLogFileName[MAX_PATH]
Definition: WheatyExceptionReport.h:191
static bool stackOverflowException
Definition: WheatyExceptionReport.h:199
SymbolPair(DWORD type, DWORD_PTR offset)
Definition: WheatyExceptionReport.h:96
WheatyExceptionReport()
Definition: WheatyExceptionReport.cpp:74
Definition: WheatyExceptionReport.h:52
#define WINAPI
Definition: CascPort.h:163
static void FormatOutputValue(char *pszCurrBuffer, BasicType basicType, DWORD64 length, PVOID pAddress, size_t bufferSize, size_t countOverride=0)
Definition: WheatyExceptionReport.cpp:1256
Definition: WheatyExceptionReport.h:46
Definition: WheatyExceptionReport.h:48
Definition: WheatyExceptionReport.h:55
Definition: WheatyExceptionReport.h:47
Definition: WheatyExceptionReport.h:53
BasicType
Definition: WheatyExceptionReport.h:19
static BOOL _GetWindowsVersion(TCHAR *szVersion, DWORD cntMax)
Definition: WheatyExceptionReport.cpp:225
Definition: WheatyExceptionReport.h:54
static LPTOP_LEVEL_EXCEPTION_FILTER m_previousFilter
Definition: WheatyExceptionReport.h:193
std::string Value
Definition: WheatyExceptionReport.h:141
Definition: WheatyExceptionReport.h:51
static char * PopSymbolDetail(char *pszCurrBuffer)
Definition: WheatyExceptionReport.cpp:1438
Definition: WheatyExceptionReport.h:24
Definition: WheatyExceptionReport.h:113
unsigned long DWORD_PTR
Definition: CascPort.h:140
Definition: WheatyExceptionReport.h:41
Definition: WheatyExceptionReport.h:49
Definition: WheatyExceptionReport.h:35
static HANDLE m_hReportFile
Definition: WheatyExceptionReport.h:194
static void WriteStackDetails(PCONTEXT pContext, bool bWriteVariables, HANDLE pThreadHandle)
Definition: WheatyExceptionReport.cpp:704
Definition: WheatyExceptionReport.h:25
static void ClearSymbols()
Definition: WheatyExceptionReport.cpp:1423
bool empty() const
Definition: WheatyExceptionReport.h:132
static bool alreadyCrashed
Definition: WheatyExceptionReport.h:200
Definition: WheatyExceptionReport.h:23
bool operator<(const SymbolPair &other) const
Definition: WheatyExceptionReport.h:102
NTSTATUS(NTAPI * pRtlGetVersion)(PRTL_OSVERSIONINFOW lpVersionInformation)
Definition: WheatyExceptionReport.h:202
static int __cdecl heapprintf(const TCHAR *format, va_list argptr)
Definition: WheatyExceptionReport.cpp:1406
unsigned int DWORD
Definition: CascPort.h:139
float length(float v)
Definition: vectorMath.h:208
Definition: WheatyExceptionReport.h:22
static void printTracesForAllThreads(bool)
Definition: WheatyExceptionReport.cpp:423
WheatyExceptionReport g_WheatyExceptionReport
Definition: WheatyExceptionReport.cpp:70
static bool StoreSymbol(DWORD type, DWORD_PTR offset)
Definition: WheatyExceptionReport.cpp:1418
DataKind
Definition: WheatyExceptionReport.h:44
std::string Name
Definition: WheatyExceptionReport.h:140
static SymbolPairs symbols
Definition: WheatyExceptionReport.h:197
Definition: WheatyExceptionReport.h:36
std::string ToString()
Definition: WheatyExceptionReport.h:117
static bool FormatSymbolValue(PSYMBOL_INFO, STACKFRAME64 *, char *pszBuffer, unsigned cbBuffer)
Definition: WheatyExceptionReport.cpp:857
Definition: WheatyExceptionReport.h:31
static int __cdecl _tprintf(const TCHAR *format,...)
Definition: WheatyExceptionReport.cpp:1375
static TCHAR m_szDumpFileName[MAX_PATH]
Definition: WheatyExceptionReport.h:192
Definition: WheatyExceptionReport.h:21
static std::mutex alreadyCrashedLock
Definition: WheatyExceptionReport.h:201
Definition: WheatyExceptionReport.h:30
static char * DumpTypeIndex(char *, DWORD64, DWORD, unsigned, DWORD_PTR, bool &, const char *, char *, bool, bool)
Definition: WheatyExceptionReport.cpp:933
static int __cdecl stackprintf(const TCHAR *format, va_list argptr)
Definition: WheatyExceptionReport.cpp:1394
Definition: WheatyExceptionReport.h:28
~WheatyExceptionReport()
Definition: WheatyExceptionReport.cpp:94
Definition: WheatyExceptionReport.h:38
Type
Type of JSON value.
Definition: rapidjson.h:642
static HANDLE m_hDumpFile
Definition: WheatyExceptionReport.h:195
Definition: WheatyExceptionReport.h:29
Definition: WheatyExceptionReport.h:94
Definition: WheatyExceptionReport.h:50
static DWORD_PTR DereferenceUnsafePointer(DWORD_PTR address)
Definition: WheatyExceptionReport.cpp:1359
static char * PushSymbolDetail(char *pszCurrBuffer)
Definition: WheatyExceptionReport.cpp:1430
Definition: WheatyExceptionReport.h:33