![]() |
TrinityCore
|
#include <WheatyExceptionReport.h>
Classes | |
| struct | EnumerateSymbolsCallbackContext |
Public Member Functions | |
| WheatyExceptionReport () | |
| WheatyExceptionReport (WheatyExceptionReport const &)=delete | |
| WheatyExceptionReport (WheatyExceptionReport &&)=delete | |
| WheatyExceptionReport & | operator= (WheatyExceptionReport const &)=delete |
| WheatyExceptionReport & | operator= (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) |
| template<typename T > | |
| void | FormatOutputValueNumeric (char *buffer, size_t bufferSize, char const *format, LPCVOID address) |
| void | FormatOutputValue (char *pszCurrBuffer, BasicType basicType, DWORD64 length, PVOID pAddress, size_t bufferSize, size_t countOverride=0) |
| BasicType | GetBasicType (DWORD typeIndex, DWORD64 modBase) const |
| template<typename T > requires (std::is_scalar_v<T>) | |
| Optional< T > | DereferenceUnsafePointer (LPCVOID address) |
| int | Log (const TCHAR *format,...) |
| bool | StoreSymbol (DWORD type, DWORD_PTR offset) |
| void | ClearSymbols () |
| SymbolDetail & | PushSymbolDetail () |
| 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 §ion, 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 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< SymbolDetail > | m_symbolDetails |
| bool | m_alreadyCrashed |
| SRWLOCK | m_alreadyCrashedLock |
| pRtlGetVersion | RtlGetVersion |
Static Private Attributes | |
| static constexpr SIZE_T | m_tempPathBufferChars = 0x8000 |
Definition at line 379 of file WheatyExceptionReport.h.
|
private |
Definition at line 459 of file WheatyExceptionReport.h.
| WheatyExceptionReport::WheatyExceptionReport | ( | ) |
Definition at line 71 of file WheatyExceptionReport.cpp.
|
delete |
|
delete |
| WheatyExceptionReport::~WheatyExceptionReport | ( | ) |
Definition at line 97 of file WheatyExceptionReport.cpp.
References ClearSymbols(), m_previousCrtHandler, m_previousFilter, and m_tempPathBuffer.
|
staticprivate |
Definition at line 238 of file WheatyExceptionReport.cpp.
Referenced by PrintSystemInfo().
|
private |
Definition at line 274 of file WheatyExceptionReport.cpp.
References _GetWindowsVersionFromWMI(), RtlGetVersion, and ToTchar().
Referenced by PrintSystemInfo().
|
staticprivatenoexcept |
Definition at line 458 of file WheatyExceptionReport.cpp.
References Trinity::make_unique_ptr_with_deleter(), and ToTchar().
Referenced by _GetWindowsVersion().
|
private |
Definition at line 1950 of file WheatyExceptionReport.cpp.
References m_symbolDetails, and m_symbols.
Referenced by EnumerateSymbolsCallback(), and ~WheatyExceptionReport().
|
private |
Definition at line 1922 of file WheatyExceptionReport.cpp.
|
private |
Definition at line 1426 of file WheatyExceptionReport.cpp.
References btChar, btNoType, btStdString, btVoid, DataIsGlobal, DataIsStaticLocal, DataIsStaticMember, DumpTypeIndex(), FormatOutputValue(), GetBasicType(), m_process, m_symbolDetails, SymbolDetail::Name, Name, PopSymbolDetail(), SymbolDetail::Prefix, PushSymbolDetail(), rgBaseType, StoreSymbol(), SymbolDetail::Suffix, SymTagArrayType, SymTagBaseClass, SymTagBaseType, SymTagData, SymTagFunction, SymTagPointerType, SymTagTypedef, SymTagUDT, SymTagVTable, SymbolDetail::Type, SymbolDetail::Value, WER_MAX_ARRAY_ELEMENTS_COUNT, WER_MAX_NESTING_LEVEL, and WER_SMALL_BUFFER_SIZE.
Referenced by DumpTypeIndex(), and FormatSymbolValue().
|
staticprivate |
Definition at line 1148 of file WheatyExceptionReport.cpp.
References ClearSymbols(), FormatSymbolValue(), and WheatyExceptionReport::EnumerateSymbolsCallbackContext::report.
Referenced by WriteStackDetails().
|
private |
Definition at line 1778 of file WheatyExceptionReport.cpp.
References btChar, btFloat, btStdString, bufferSize, and m_process.
Referenced by DumpTypeIndex(), and FormatSymbolValue().
|
private |
Definition at line 1770 of file WheatyExceptionReport.cpp.
References bufferSize.
|
private |
Definition at line 1349 of file WheatyExceptionReport.cpp.
References WheatyExceptionReport::EnumerateSymbolsCallbackContext::context, CV_ALLREG_VFRAME, DumpTypeIndex(), FormatOutputValue(), GetBasicType(), GetIntegerRegisterValue(), m_symbolDetails, PopSymbolDetail(), PushSymbolDetail(), rgBaseType, WheatyExceptionReport::EnumerateSymbolsCallbackContext::sf, and SymTagFunction.
Referenced by EnumerateSymbolsCallback(), and GenerateExceptionReport().
|
private |
Definition at line 681 of file WheatyExceptionReport.cpp.
References ErrorMessage(), EXCEPTION_ASSERTION_FAILURE, FormatSymbolValue(), GetExceptionString(), GitRevision::GetFullVersion(), GetLogicalAddress(), m_process, m_tempPathBuffer, m_tempPathBufferChars, PrintSystemInfo(), printTracesForAllThreads(), PRSTRc, and WriteStackDetails().
|
private |
Definition at line 1897 of file WheatyExceptionReport.cpp.
References btNoType, and m_process.
Referenced by DumpTypeIndex(), and FormatSymbolValue().
|
staticprivate |
Definition at line 889 of file WheatyExceptionReport.cpp.
References EXCEPTION.
Referenced by GenerateExceptionReport().
|
staticprivate |
Definition at line 1159 of file WheatyExceptionReport.cpp.
References CPU_REG, CV_AMD64_AH, CV_AMD64_AL, CV_AMD64_AX, CV_AMD64_BH, CV_AMD64_BL, CV_AMD64_BP, CV_AMD64_BPL, CV_AMD64_BX, CV_AMD64_CH, CV_AMD64_CL, CV_AMD64_CX, CV_AMD64_DH, CV_AMD64_DI, CV_AMD64_DIL, CV_AMD64_DL, CV_AMD64_DX, CV_AMD64_EAX, CV_AMD64_EBP, CV_AMD64_EBX, CV_AMD64_ECX, CV_AMD64_EDI, CV_AMD64_EDX, CV_AMD64_ESI, CV_AMD64_ESP, CV_AMD64_R10, CV_AMD64_R10B, CV_AMD64_R10D, CV_AMD64_R10W, CV_AMD64_R11, CV_AMD64_R11B, CV_AMD64_R11D, CV_AMD64_R11W, CV_AMD64_R12, CV_AMD64_R12B, CV_AMD64_R12D, CV_AMD64_R12W, CV_AMD64_R13, CV_AMD64_R13B, CV_AMD64_R13D, CV_AMD64_R13W, CV_AMD64_R14, CV_AMD64_R14B, CV_AMD64_R14D, CV_AMD64_R14W, CV_AMD64_R15, CV_AMD64_R15B, CV_AMD64_R15D, CV_AMD64_R15W, CV_AMD64_R8, CV_AMD64_R8B, CV_AMD64_R8D, CV_AMD64_R8W, CV_AMD64_R9, CV_AMD64_R9B, CV_AMD64_R9D, CV_AMD64_R9W, CV_AMD64_RAX, CV_AMD64_RBP, CV_AMD64_RBX, CV_AMD64_RCX, CV_AMD64_RDI, CV_AMD64_RDX, CV_AMD64_RIP, CV_AMD64_RSI, CV_AMD64_RSP, CV_AMD64_SI, CV_AMD64_SIL, CV_AMD64_SP, CV_AMD64_SPL, CV_ARM64_FP, CV_ARM64_IP0, CV_ARM64_IP1, CV_ARM64_LR, CV_ARM64_SP, CV_ARM64_W0, CV_ARM64_W1, CV_ARM64_W10, CV_ARM64_W11, CV_ARM64_W12, CV_ARM64_W13, CV_ARM64_W14, CV_ARM64_W15, CV_ARM64_W16, CV_ARM64_W17, CV_ARM64_W18, CV_ARM64_W19, CV_ARM64_W2, CV_ARM64_W20, CV_ARM64_W21, CV_ARM64_W22, CV_ARM64_W23, CV_ARM64_W24, CV_ARM64_W25, CV_ARM64_W26, CV_ARM64_W27, CV_ARM64_W28, CV_ARM64_W29, CV_ARM64_W3, CV_ARM64_W30, CV_ARM64_W4, CV_ARM64_W5, CV_ARM64_W6, CV_ARM64_W7, CV_ARM64_W8, CV_ARM64_W9, CV_ARM64_WZR, CV_ARM64_X0, CV_ARM64_X1, CV_ARM64_X10, CV_ARM64_X11, CV_ARM64_X12, CV_ARM64_X13, CV_ARM64_X14, CV_ARM64_X15, CV_ARM64_X18, CV_ARM64_X19, CV_ARM64_X2, CV_ARM64_X20, CV_ARM64_X21, CV_ARM64_X22, CV_ARM64_X23, CV_ARM64_X24, CV_ARM64_X25, CV_ARM64_X26, CV_ARM64_X27, CV_ARM64_X28, CV_ARM64_X3, CV_ARM64_X4, CV_ARM64_X5, CV_ARM64_X6, CV_ARM64_X7, CV_ARM64_X8, CV_ARM64_X9, CV_ARM64_ZR, CV_REG_AH, CV_REG_AL, CV_REG_AX, CV_REG_BH, CV_REG_BL, CV_REG_BP, CV_REG_BX, CV_REG_CH, CV_REG_CL, CV_REG_CX, CV_REG_DH, CV_REG_DI, CV_REG_DL, CV_REG_DX, CV_REG_EAX, CV_REG_EBP, CV_REG_EBX, CV_REG_ECX, CV_REG_EDI, CV_REG_EDX, CV_REG_EIP, CV_REG_ESI, CV_REG_ESP, CV_REG_SI, CV_REG_SP, REG_E, REG_H, REG_L, REG_R, and REG_X.
Referenced by FormatSymbolValue().
|
staticprivate |
Definition at line 939 of file WheatyExceptionReport.cpp.
Referenced by GenerateExceptionReport(), and WriteStackDetails().
|
staticprivate |
Definition at line 1001 of file WheatyExceptionReport.cpp.
Referenced by WriteStackDetails().
|
staticprivate |
Definition at line 1009 of file WheatyExceptionReport.cpp.
Referenced by WriteStackDetails().
|
private |
Definition at line 1936 of file WheatyExceptionReport.cpp.
References m_reportFile.
|
delete |
|
delete |
|
private |
Definition at line 1964 of file WheatyExceptionReport.cpp.
References m_symbolDetails, and PrintSymbolDetail().
Referenced by DumpTypeIndex(), and FormatSymbolValue().
|
private |
Definition at line 1970 of file WheatyExceptionReport.cpp.
References SymbolDetail::empty(), SymbolDetail::Logged, m_reportFile, m_symbolDetails, SymbolDetail::Name, SymbolDetail::Prefix, PRSTRc, SymbolDetail::Suffix, SymbolDetail::Type, and SymbolDetail::Value.
Referenced by PopSymbolDetail(), and PushSymbolDetail().
|
private |
Definition at line 607 of file WheatyExceptionReport.cpp.
References _GetProcessorName(), and _GetWindowsVersion().
Referenced by GenerateExceptionReport().
| void WheatyExceptionReport::printTracesForAllThreads | ( | bool | bWriteVariables | ) |
Definition at line 631 of file WheatyExceptionReport.cpp.
References m_process, and WriteStackDetails().
Referenced by GenerateExceptionReport().
|
private |
Definition at line 1957 of file WheatyExceptionReport.cpp.
References m_symbolDetails, and PrintSymbolDetail().
Referenced by DumpTypeIndex(), and FormatSymbolValue().
|
private |
Definition at line 1945 of file WheatyExceptionReport.cpp.
References m_symbols.
Referenced by DumpTypeIndex().
|
noexcept |
Definition at line 118 of file WheatyExceptionReport.cpp.
References CrashFolder, EXCEPTION_ASSERTION_FAILURE, GitRevision::GetHash(), PRSTRc, PRSTRw, and STRING_VIEW_FMT_ARG.
|
static |
Definition at line 233 of file WheatyExceptionReport.cpp.
|
static |
Definition at line 112 of file WheatyExceptionReport.cpp.
|
private |
Definition at line 1020 of file WheatyExceptionReport.cpp.
References WheatyExceptionReport::EnumerateSymbolsCallbackContext::context, EnumerateSymbolsCallback(), GetLogicalAddress(), GetSymbolFromAddress(), GetSymbolLineFromAddress(), m_process, m_tempPathBuffer, m_tempPathBufferChars, PRSTRc, WheatyExceptionReport::EnumerateSymbolsCallbackContext::report, and WheatyExceptionReport::EnumerateSymbolsCallbackContext::sf.
Referenced by GenerateExceptionReport(), and printTracesForAllThreads().
|
private |
Definition at line 457 of file WheatyExceptionReport.h.
|
private |
Definition at line 458 of file WheatyExceptionReport.h.
|
private |
Definition at line 453 of file WheatyExceptionReport.h.
|
private |
Definition at line 451 of file WheatyExceptionReport.h.
Referenced by ~WheatyExceptionReport().
|
private |
Definition at line 450 of file WheatyExceptionReport.h.
Referenced by ~WheatyExceptionReport().
|
private |
Definition at line 454 of file WheatyExceptionReport.h.
Referenced by DumpTypeIndex(), FormatOutputValue(), GenerateExceptionReport(), GetBasicType(), printTracesForAllThreads(), and WriteStackDetails().
|
private |
Definition at line 452 of file WheatyExceptionReport.h.
Referenced by Log(), and PrintSymbolDetail().
|
private |
Definition at line 456 of file WheatyExceptionReport.h.
Referenced by ClearSymbols(), DumpTypeIndex(), FormatSymbolValue(), PopSymbolDetail(), PrintSymbolDetail(), and PushSymbolDetail().
|
private |
Definition at line 455 of file WheatyExceptionReport.h.
Referenced by ClearSymbols(), and StoreSymbol().
|
private |
Definition at line 448 of file WheatyExceptionReport.h.
Referenced by GenerateExceptionReport(), WriteStackDetails(), and ~WheatyExceptionReport().
|
staticconstexprprivate |
Definition at line 449 of file WheatyExceptionReport.h.
Referenced by GenerateExceptionReport(), and WriteStackDetails().
|
private |
Definition at line 460 of file WheatyExceptionReport.h.
Referenced by _GetWindowsVersion().