1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-30 03:32:36 +00:00

components/crashcatcher: if OPENMW_FULL_MEMDUMP is set, generate a full memory crashdump

[Bug #7924](https://gitlab.com/OpenMW/openmw/issues/#7924)
This commit is contained in:
Austin English 2024-05-06 20:54:13 -05:00
parent 2e971ec2e3
commit 50b2edc121

View File

@ -231,6 +231,7 @@ namespace Crash
void CrashMonitor::handleCrash(bool isFreeze)
{
DWORD processId = GetProcessId(mAppProcessHandle);
const char* env = getenv("OPENMW_FULL_MEMDUMP");
try
{
@ -268,6 +269,10 @@ namespace Crash
infos.ExceptionPointers = &exp;
infos.ClientPointers = FALSE;
MINIDUMP_TYPE type = (MINIDUMP_TYPE)(MiniDumpWithDataSegs | MiniDumpWithHandleData);
if (env)
type = static_cast<MINIDUMP_TYPE>(type | MiniDumpWithFullMemory);
miniDumpWriteDump(mAppProcessHandle, processId, hCrashLog, type, &infos, 0, 0);
}
catch (const std::exception& e)