mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-19 20:24:59 +01:00
fix(simulation): no crash message box in test mode
The crash handler of WITHDUMPGEN builds (on by default) shows a message box before it writes the dump. It also gets the C++ exceptions nothing catches, since it replaces the CRT's unhandled exception filter. In test mode nobody is there to close the box, so a crashing test waited for it until whatever started it gave up (run.py after the case's timeout, 600 s by default). The dump is still written, the exit code is the exception's.
This commit is contained in:
2
EU07.cpp
2
EU07.cpp
@@ -73,6 +73,8 @@ LONG WINAPI CrashHandler(EXCEPTION_POINTERS *ExceptionInfo)
|
|||||||
MINIDUMP_TYPE dumpType = MINIDUMP_TYPE(MiniDumpWithFullMemory | MiniDumpWithHandleData | MiniDumpWithThreadInfo | MiniDumpWithUnloadedModules | MiniDumpWithIndirectlyReferencedMemory |
|
MINIDUMP_TYPE dumpType = MINIDUMP_TYPE(MiniDumpWithFullMemory | MiniDumpWithHandleData | MiniDumpWithThreadInfo | MiniDumpWithUnloadedModules | MiniDumpWithIndirectlyReferencedMemory |
|
||||||
MiniDumpWithFullMemoryInfo | MiniDumpWithTokenInformation);
|
MiniDumpWithFullMemoryInfo | MiniDumpWithTokenInformation);
|
||||||
|
|
||||||
|
// in test mode nobody is there to close the box, and the run would wait for it until killed
|
||||||
|
if (false == Global.test.enabled)
|
||||||
MessageBoxA(nullptr, "Simulator crash occured :(\n", "Simulator crashed :(", MB_ICONERROR);
|
MessageBoxA(nullptr, "Simulator crash occured :(\n", "Simulator crashed :(", MB_ICONERROR);
|
||||||
MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, dumpType, &dumpInfo, nullptr, nullptr);
|
MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, dumpType, &dumpInfo, nullptr, nullptr);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user