TrinityCore
Loading...
Searching...
No Matches
WheatyExceptionReport Class Reference

#include <WheatyExceptionReport.h>

Classes

struct  EnumerateSymbolsCallbackContext
 

Public Member Functions

 WheatyExceptionReport ()
 
 WheatyExceptionReport (WheatyExceptionReport const &)=delete
 
 WheatyExceptionReport (WheatyExceptionReport &&)=delete
 
WheatyExceptionReportoperator= (WheatyExceptionReport const &)=delete
 
WheatyExceptionReportoperator= (WheatyExceptionReport &&)=delete
 
 ~WheatyExceptionReport ()
 
LONG UnhandledExceptionFilterImpl (PEXCEPTION_POINTERS pExceptionInfo) noexcept
 
void printTracesForAllThreads (bool bWriteVariables)
 

Static Public Member Functions

static LONG WINAPI WheatyUnhandledExceptionFilter (PEXCEPTION_POINTERS pExceptionInfo)
 
static void __cdecl WheatyCrtHandler (wchar_t const *expression, wchar_t const *function, wchar_t const *file, unsigned int line, uintptr_t pReserved)
 

Private Types

typedef NTSTATUS(NTAPI * pRtlGetVersion) (PRTL_OSVERSIONINFOW lpVersionInformation)
 

Private Member Functions

void GenerateExceptionReport (PEXCEPTION_POINTERS pExceptionInfo)
 
void PrintSystemInfo ()
 
BOOL _GetWindowsVersion (TCHAR *szVersion, DWORD cntMax)
 
void WriteStackDetails (PCONTEXT pContext, bool bWriteVariables, HANDLE pThreadHandle)
 
bool FormatSymbolValue (PSYMBOL_INFO, EnumerateSymbolsCallbackContext *)
 
void DumpTypeIndex (DWORD64, DWORD, DWORD_PTR, bool &, char const *, char const *, bool, bool)
 
BasicType GetBasicType (DWORD typeIndex, DWORD64 modBase) const
 
int Log (const TCHAR *format,...)
 
bool StoreSymbol (DWORD type, DWORD_PTR offset)
 
void ClearSymbols ()
 
SymbolDetailPushSymbolDetail ()
 
void PopSymbolDetail ()
 
void PrintSymbolDetail ()
 

Static Private Member Functions

static BOOL _GetWindowsVersionFromWMI (TCHAR *szVersion, DWORD cntMax) noexcept
 
static BOOL _GetProcessorName (TCHAR *sProcessorName, DWORD maxcount)
 
static LPCTSTR GetExceptionString (DWORD dwCode)
 
static BOOL GetLogicalAddress (PVOID addr, PTSTR szModule, DWORD len, DWORD &section, DWORD_PTR &offset)
 
static BOOL GetSymbolFromAddress (HANDLE hProcess, DWORD64 Address, ULONG InlineContext, PDWORD64 Displacement, PSYMBOL_INFO Symbol)
 
static BOOL GetSymbolLineFromAddress (HANDLE hProcess, DWORD64 qwAddr, ULONG InlineContext, PDWORD pdwDisplacement, PIMAGEHLP_LINE64 Line64)
 
static BOOL CALLBACK EnumerateSymbolsCallback (PSYMBOL_INFO, ULONG, PVOID)
 
static void FormatOutputValue (char *pszCurrBuffer, BasicType basicType, DWORD64 length, PVOID pAddress, size_t bufferSize, size_t countOverride=0)
 
static DWORD_PTR DereferenceUnsafePointer (DWORD_PTR address)
 
static Optional< DWORD_PTR > GetIntegerRegisterValue (PCONTEXT context, ULONG registerId)
 

Private Attributes

TCHAR * m_tempPathBuffer
 
LPTOP_LEVEL_EXCEPTION_FILTER m_previousFilter
 
_invalid_parameter_handler m_previousCrtHandler
 
FILE * m_reportFile
 
HANDLE m_dumpFile
 
HANDLE m_process
 
SymbolPairs m_symbols
 
std::stack< SymbolDetailm_symbolDetails
 
bool m_alreadyCrashed
 
SRWLOCK m_alreadyCrashedLock
 
pRtlGetVersion RtlGetVersion
 

Static Private Attributes

static constexpr SIZE_T m_tempPathBufferChars = 0x8000
 

Detailed Description

Definition at line 324 of file WheatyExceptionReport.h.

Member Typedef Documentation

◆ pRtlGetVersion

typedef NTSTATUS(NTAPI * WheatyExceptionReport::pRtlGetVersion) (PRTL_OSVERSIONINFOW lpVersionInformation)
private

Definition at line 399 of file WheatyExceptionReport.h.

Constructor & Destructor Documentation

◆ WheatyExceptionReport() [1/3]

WheatyExceptionReport::WheatyExceptionReport ( )

Definition at line 69 of file WheatyExceptionReport.cpp.

◆ WheatyExceptionReport() [2/3]

WheatyExceptionReport::WheatyExceptionReport ( WheatyExceptionReport const &  )
delete

◆ WheatyExceptionReport() [3/3]

WheatyExceptionReport::WheatyExceptionReport ( WheatyExceptionReport &&  )
delete

◆ ~WheatyExceptionReport()

WheatyExceptionReport::~WheatyExceptionReport ( )

Definition at line 95 of file WheatyExceptionReport.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ _GetProcessorName()

BOOL WheatyExceptionReport::_GetProcessorName ( TCHAR *  sProcessorName,
DWORD  maxcount 
)
staticprivate

Definition at line 236 of file WheatyExceptionReport.cpp.

+ Here is the caller graph for this function:

◆ _GetWindowsVersion()

BOOL WheatyExceptionReport::_GetWindowsVersion ( TCHAR *  szVersion,
DWORD  cntMax 
)
private

Definition at line 272 of file WheatyExceptionReport.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _GetWindowsVersionFromWMI()

BOOL WheatyExceptionReport::_GetWindowsVersionFromWMI ( TCHAR *  szVersion,
DWORD  cntMax 
)
staticprivatenoexcept

Definition at line 456 of file WheatyExceptionReport.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ClearSymbols()

void WheatyExceptionReport::ClearSymbols ( )
private

Definition at line 1908 of file WheatyExceptionReport.cpp.

+ Here is the caller graph for this function:

◆ DereferenceUnsafePointer()

DWORD_PTR WheatyExceptionReport::DereferenceUnsafePointer ( DWORD_PTR  address)
staticprivate

Definition at line 1878 of file WheatyExceptionReport.cpp.

+ Here is the caller graph for this function:

◆ DumpTypeIndex()

void WheatyExceptionReport::DumpTypeIndex ( DWORD64  modBase,
DWORD  dwTypeIndex,
DWORD_PTR  offset,
bool &  bHandled,
char const *  Name,
char const *  ,
bool  newSymbol,
bool  logChildren 
)
private

Definition at line 1440 of file WheatyExceptionReport.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EnumerateSymbolsCallback()

BOOL CALLBACK WheatyExceptionReport::EnumerateSymbolsCallback ( PSYMBOL_INFO  pSymInfo,
ULONG  ,
PVOID  UserContext 
)
staticprivate

Definition at line 1153 of file WheatyExceptionReport.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FormatOutputValue()

void WheatyExceptionReport::FormatOutputValue ( char *  pszCurrBuffer,
BasicType  basicType,
DWORD64  length,
PVOID  pAddress,
size_t  bufferSize,
size_t  countOverride = 0 
)
staticprivate

Definition at line 1783 of file WheatyExceptionReport.cpp.

+ Here is the caller graph for this function:

◆ FormatSymbolValue()

bool WheatyExceptionReport::FormatSymbolValue ( PSYMBOL_INFO  pSym,
EnumerateSymbolsCallbackContext pCtx 
)
private

Definition at line 1363 of file WheatyExceptionReport.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateExceptionReport()

void WheatyExceptionReport::GenerateExceptionReport ( PEXCEPTION_POINTERS  pExceptionInfo)
private

Definition at line 679 of file WheatyExceptionReport.cpp.

+ Here is the call graph for this function:

◆ GetBasicType()

BasicType WheatyExceptionReport::GetBasicType ( DWORD  typeIndex,
DWORD64  modBase 
) const
private

Definition at line 1854 of file WheatyExceptionReport.cpp.

+ Here is the caller graph for this function:

◆ GetExceptionString()

LPCTSTR WheatyExceptionReport::GetExceptionString ( DWORD  dwCode)
staticprivate

Definition at line 894 of file WheatyExceptionReport.cpp.

+ Here is the caller graph for this function:

◆ GetIntegerRegisterValue()

Optional< DWORD_PTR > WheatyExceptionReport::GetIntegerRegisterValue ( PCONTEXT  context,
ULONG  registerId 
)
staticprivate

Definition at line 1173 of file WheatyExceptionReport.cpp.

+ Here is the caller graph for this function:

◆ GetLogicalAddress()

BOOL WheatyExceptionReport::GetLogicalAddress ( PVOID  addr,
PTSTR  szModule,
DWORD  len,
DWORD &  section,
DWORD_PTR &  offset 
)
staticprivate

Definition at line 944 of file WheatyExceptionReport.cpp.

+ Here is the caller graph for this function:

◆ GetSymbolFromAddress()

BOOL WheatyExceptionReport::GetSymbolFromAddress ( HANDLE  hProcess,
DWORD64  Address,
ULONG  InlineContext,
PDWORD64  Displacement,
PSYMBOL_INFO  Symbol 
)
staticprivate

Definition at line 1006 of file WheatyExceptionReport.cpp.

+ Here is the caller graph for this function:

◆ GetSymbolLineFromAddress()

BOOL WheatyExceptionReport::GetSymbolLineFromAddress ( HANDLE  hProcess,
DWORD64  qwAddr,
ULONG  InlineContext,
PDWORD  pdwDisplacement,
PIMAGEHLP_LINE64  Line64 
)
staticprivate

Definition at line 1014 of file WheatyExceptionReport.cpp.

+ Here is the caller graph for this function:

◆ Log()

int WheatyExceptionReport::Log ( const TCHAR *  format,
  ... 
)
private

Definition at line 1894 of file WheatyExceptionReport.cpp.

+ Here is the caller graph for this function:

◆ operator=() [1/2]

WheatyExceptionReport & WheatyExceptionReport::operator= ( WheatyExceptionReport &&  )
delete

◆ operator=() [2/2]

WheatyExceptionReport & WheatyExceptionReport::operator= ( WheatyExceptionReport const &  )
delete

◆ PopSymbolDetail()

void WheatyExceptionReport::PopSymbolDetail ( )
private

Definition at line 1922 of file WheatyExceptionReport.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PrintSymbolDetail()

void WheatyExceptionReport::PrintSymbolDetail ( )
private

Definition at line 1928 of file WheatyExceptionReport.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PrintSystemInfo()

void WheatyExceptionReport::PrintSystemInfo ( )
private

Definition at line 605 of file WheatyExceptionReport.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printTracesForAllThreads()

void WheatyExceptionReport::printTracesForAllThreads ( bool  bWriteVariables)

Definition at line 629 of file WheatyExceptionReport.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PushSymbolDetail()

SymbolDetail & WheatyExceptionReport::PushSymbolDetail ( )
private

Definition at line 1915 of file WheatyExceptionReport.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StoreSymbol()

bool WheatyExceptionReport::StoreSymbol ( DWORD  type,
DWORD_PTR  offset 
)
private

Definition at line 1903 of file WheatyExceptionReport.cpp.

+ Here is the caller graph for this function:

◆ UnhandledExceptionFilterImpl()

LONG WheatyExceptionReport::UnhandledExceptionFilterImpl ( PEXCEPTION_POINTERS  pExceptionInfo)
noexcept

Definition at line 116 of file WheatyExceptionReport.cpp.

+ Here is the call graph for this function:

◆ WheatyCrtHandler()

void __cdecl WheatyExceptionReport::WheatyCrtHandler ( wchar_t const *  expression,
wchar_t const *  function,
wchar_t const *  file,
unsigned int  line,
uintptr_t  pReserved 
)
static

Definition at line 231 of file WheatyExceptionReport.cpp.

◆ WheatyUnhandledExceptionFilter()

LONG WINAPI WheatyExceptionReport::WheatyUnhandledExceptionFilter ( PEXCEPTION_POINTERS  pExceptionInfo)
static

Definition at line 110 of file WheatyExceptionReport.cpp.

◆ WriteStackDetails()

void WheatyExceptionReport::WriteStackDetails ( PCONTEXT  pContext,
bool  bWriteVariables,
HANDLE  pThreadHandle 
)
private

Definition at line 1025 of file WheatyExceptionReport.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_alreadyCrashed

bool WheatyExceptionReport::m_alreadyCrashed
private

Definition at line 397 of file WheatyExceptionReport.h.

◆ m_alreadyCrashedLock

SRWLOCK WheatyExceptionReport::m_alreadyCrashedLock
private

Definition at line 398 of file WheatyExceptionReport.h.

◆ m_dumpFile

HANDLE WheatyExceptionReport::m_dumpFile
private

Definition at line 393 of file WheatyExceptionReport.h.

◆ m_previousCrtHandler

_invalid_parameter_handler WheatyExceptionReport::m_previousCrtHandler
private

Definition at line 391 of file WheatyExceptionReport.h.

◆ m_previousFilter

LPTOP_LEVEL_EXCEPTION_FILTER WheatyExceptionReport::m_previousFilter
private

Definition at line 390 of file WheatyExceptionReport.h.

◆ m_process

HANDLE WheatyExceptionReport::m_process
private

Definition at line 394 of file WheatyExceptionReport.h.

◆ m_reportFile

FILE* WheatyExceptionReport::m_reportFile
private

Definition at line 392 of file WheatyExceptionReport.h.

◆ m_symbolDetails

std::stack<SymbolDetail> WheatyExceptionReport::m_symbolDetails
private

Definition at line 396 of file WheatyExceptionReport.h.

◆ m_symbols

SymbolPairs WheatyExceptionReport::m_symbols
private

Definition at line 395 of file WheatyExceptionReport.h.

◆ m_tempPathBuffer

TCHAR* WheatyExceptionReport::m_tempPathBuffer
private

Definition at line 388 of file WheatyExceptionReport.h.

◆ m_tempPathBufferChars

constexpr SIZE_T WheatyExceptionReport::m_tempPathBufferChars = 0x8000
staticconstexprprivate

Definition at line 389 of file WheatyExceptionReport.h.

◆ RtlGetVersion

pRtlGetVersion WheatyExceptionReport::RtlGetVersion
private

Definition at line 400 of file WheatyExceptionReport.h.


The documentation for this class was generated from the following files: