[*] TODO: Fix and revert (this is already being rewritten. just need this to not break for now)

Reece, [16/09/2024 21:22]
need to finish audebug update on the laptop

Reece, [16/09/2024 21:22]
loading broken dlls (incl missing iat resolves) results in a telemetry deadlock

Reece, [16/09/2024 21:23]
win32 ldr lock is held while dbghelp tries to acquire lock
This commit is contained in:
Reece Wilson 2024-09-16 22:17:42 +01:00
parent 9acc56431a
commit 31193f6c4d

View File

@ -31,6 +31,8 @@
#include <WerApi.h>
#endif
#include <Aux_ulib.h>
static thread_local int gDebugLocked = 0;
namespace Aurora::Debug
@ -206,6 +208,21 @@ namespace Aurora::Debug
};
StackTrace backtrace;
BOOL bLocked {};
if (AuxUlibIsDLLSynchronizationHeld(&bLocked))
{
if (bLocked)
{
ParseStack(ExceptionInfo->ContextRecord, backtrace);
AuLogWarn("DLL Load NT Exception: 0x{:x}", ExceptionInfo->ExceptionRecord->ExceptionCode);
AuLogWarn("{}", StringifyStackTrace(backtrace));
gDebugLocked = 0;
return EXCEPTION_CONTINUE_SEARCH;
}
}
{
static bool bRunOnce {};
struct ArrowEx : Grug::Arrow
@ -245,9 +262,16 @@ namespace Aurora::Debug
CONTEXT ctx {};
ctx.ContextFlags = CONTEXT_ALL;
if (!GetThreadContext(GetCurrentThread(), &ctx))
if (ExceptionInfo->ContextRecord)
{
Debug::Panic();
ctx = *ExceptionInfo->ContextRecord;
}
else
{
if (!GetThreadContext(GetCurrentThread(), &ctx))
{
Debug::Panic();
}
}
AuVoidFunc doReportLocal;