From 50b2edc1214e413aaa40b6b16740cf3fd6b6e964 Mon Sep 17 00:00:00 2001 From: Austin English Date: Mon, 6 May 2024 20:54:13 -0500 Subject: [PATCH] components/crashcatcher: if OPENMW_FULL_MEMDUMP is set, generate a full memory crashdump [Bug #7924](https://gitlab.com/OpenMW/openmw/issues/#7924) --- components/crashcatcher/windows_crashmonitor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/crashcatcher/windows_crashmonitor.cpp b/components/crashcatcher/windows_crashmonitor.cpp index 10a9166384..3708283efa 100644 --- a/components/crashcatcher/windows_crashmonitor.cpp +++ b/components/crashcatcher/windows_crashmonitor.cpp @@ -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(type | MiniDumpWithFullMemory); + miniDumpWriteDump(mAppProcessHandle, processId, hCrashLog, type, &infos, 0, 0); } catch (const std::exception& e)