aboutsummaryrefslogtreecommitdiff
path: root/src/shared/WheatyExceptionReport.h
diff options
context:
space:
mode:
authormaximius <none@none>2009-10-17 15:51:44 -0700
committermaximius <none@none>2009-10-17 15:51:44 -0700
commite585187b248f48b3c6e9247b49fa07c6565d65e5 (patch)
tree637c5b7ddacf41040bef4ea4f75a97da64c6a9bc /src/shared/WheatyExceptionReport.h
parent26b5e033ffde3d161382fc9addbfa99738379641 (diff)
*Backed out changeset 3be01fb200a5
--HG-- branch : trunk
Diffstat (limited to 'src/shared/WheatyExceptionReport.h')
-rw-r--r--src/shared/WheatyExceptionReport.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/shared/WheatyExceptionReport.h b/src/shared/WheatyExceptionReport.h
index a2ff31aefa8..33fb4bc5b0e 100644
--- a/src/shared/WheatyExceptionReport.h
+++ b/src/shared/WheatyExceptionReport.h
@@ -1,12 +1,15 @@
#ifndef _WHEATYEXCEPTIONREPORT_
#define _WHEATYEXCEPTIONREPORT_
+
#include <dbghelp.h>
+
#if _MSC_VER < 1400
# define countof(array) (sizeof(array) / sizeof(array[0]))
#else
# include <stdlib.h>
# define countof _countof
#endif // _MSC_VER < 1400
+
enum BasicType // Stolen from CVCONST.H in the DIA 2.0 SDK
{
btNoType = 0,
@@ -28,6 +31,7 @@ enum BasicType // Stolen from CVCON
btBSTR = 30,
btHresult = 31
};
+
const char* const rgBaseType[] =
{
" <user defined> ", // btNoType = 0,
@@ -63,14 +67,18 @@ const char* const rgBaseType[] =
" BSTR ", // btBSTR = 30,
" HRESULT " // btHresult = 31
};
+
class WheatyExceptionReport
{
public:
+
WheatyExceptionReport();
~WheatyExceptionReport();
+
// entry point where control comes on an unhandled exception
static LONG WINAPI WheatyUnhandledExceptionFilter(
PEXCEPTION_POINTERS pExceptionInfo);
+
static void printTracesForAllThreads();
private:
// where report info is extracted and generated
@@ -78,23 +86,33 @@ class WheatyExceptionReport
static void PrintSystemInfo();
static BOOL _GetWindowsVersion(TCHAR* szVersion, DWORD cntMax);
static BOOL _GetProcessorName(TCHAR* sProcessorName, DWORD maxcount);
+
// Helper functions
static LPTSTR GetExceptionString(DWORD dwCode);
static BOOL GetLogicalAddress(PVOID addr, PTSTR szModule, DWORD len,
DWORD& section, DWORD_PTR& offset);
+
static void WriteStackDetails(PCONTEXT pContext, bool bWriteVariables, HANDLE pThreadHandle);
+
static BOOL CALLBACK EnumerateSymbolsCallback(PSYMBOL_INFO,ULONG, PVOID);
+
static bool FormatSymbolValue(PSYMBOL_INFO, STACKFRAME *, char * pszBuffer, unsigned cbBuffer);
+
static char * DumpTypeIndex(char *, DWORD64, DWORD, unsigned, DWORD_PTR, bool & , char*);
+
static char * FormatOutputValue(char * pszCurrBuffer, BasicType basicType, DWORD64 length, PVOID pAddress);
+
static BasicType GetBasicType(DWORD typeIndex, DWORD64 modBase);
+
static int __cdecl _tprintf(const TCHAR * format, ...);
+
// Variables used by the class
static TCHAR m_szLogFileName[MAX_PATH];
static LPTOP_LEVEL_EXCEPTION_FILTER m_previousFilter;
static HANDLE m_hReportFile;
static HANDLE m_hProcess;
};
+
extern WheatyExceptionReport g_WheatyExceptionReport; // global instance of class
#endif //WheatyExceptionReport