[*] fix minidump writing
This commit is contained in:
parent
238874cf8c
commit
b3ed716e94
@ -181,7 +181,10 @@ namespace Aurora::Debug
|
||||
static bool forceFail {false};
|
||||
_EXCEPTION_POINTERS ptrs;
|
||||
StackTrace ret;
|
||||
CONTEXT ctx;
|
||||
CONTEXT ctx {};
|
||||
EXCEPTION_RECORD ex {};
|
||||
|
||||
ctx.ContextFlags = CONTEXT_ALL;
|
||||
|
||||
if (!GetThreadContext(GetCurrentThread(), &ctx))
|
||||
{
|
||||
@ -193,8 +196,11 @@ namespace Aurora::Debug
|
||||
Exit::PostLevel(AuThreads::GetThread(), Aurora::Exit::ETriggerLevel::eFatalException);
|
||||
}
|
||||
|
||||
ptrs.ExceptionRecord = {};
|
||||
ex.ExceptionCode = 0x1337;
|
||||
|
||||
ptrs.ExceptionRecord = &ex;
|
||||
ptrs.ContextRecord = &ctx;
|
||||
|
||||
HandleFatal(fatal, &ptrs);
|
||||
}
|
||||
|
||||
|
@ -277,10 +277,10 @@ namespace Aurora::Debug
|
||||
void SaveMinidump(_EXCEPTION_POINTERS *ExceptionInfo, bool isFatal)
|
||||
{
|
||||
bool ok {};
|
||||
MINIDUMP_EXCEPTION_INFORMATION info;
|
||||
MINIDUMP_EXCEPTION_INFORMATION info {};
|
||||
info.ThreadId = GetCurrentThreadId();
|
||||
|
||||
info.ClientPointers = ExceptionInfo != nullptr;
|
||||
info.ClientPointers = false;
|
||||
info.ExceptionPointers = ExceptionInfo;
|
||||
|
||||
static const DWORD flags = MiniDumpWithFullMemory |
|
||||
@ -316,7 +316,7 @@ namespace Aurora::Debug
|
||||
ok = MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, (MINIDUMP_TYPE)flags, &info, nullptr, nullptr);
|
||||
if (!ok)
|
||||
{
|
||||
AuLogWarn("Couldn't write minidump");
|
||||
AuLogWarn("Couldn't write minidump: {:x}", GetLastError());
|
||||
goto miniDumpOut;
|
||||
}
|
||||
|
||||
@ -334,6 +334,16 @@ namespace Aurora::Debug
|
||||
|
||||
if (isFatal)
|
||||
{
|
||||
try
|
||||
{
|
||||
Grug::GrugFlushFlushs();
|
||||
Grug::GrugFlushWrites();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
__fastfail('fokd');
|
||||
}
|
||||
}
|
||||
@ -346,13 +356,18 @@ namespace Aurora::Debug
|
||||
AuString utf8Path;
|
||||
MINIDUMP_EXCEPTION_INFORMATION info;
|
||||
|
||||
if (fatal)
|
||||
{
|
||||
AuDebug::AddMemoryCrunch();
|
||||
}
|
||||
|
||||
auto ok = AuIOFS::GetProfileDomain(path); // < could throw inside
|
||||
if (!ok)
|
||||
{
|
||||
path = ".\\";
|
||||
}
|
||||
|
||||
info.ClientPointers = true;
|
||||
info.ClientPointers = false;
|
||||
info.ThreadId = GetCurrentThreadId();
|
||||
info.ExceptionPointers = ExceptionInfo;
|
||||
|
||||
@ -388,7 +403,7 @@ namespace Aurora::Debug
|
||||
ok = MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, (MINIDUMP_TYPE)flags, &info, nullptr, nullptr);
|
||||
if (!ok)
|
||||
{
|
||||
AuLogWarn("Couldn't write minidump");
|
||||
AuLogWarn("Couldn't write minidump: {:x}", GetLastError());
|
||||
goto miniMiniDumpOut;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user