From 54fba4d642ea44928eac4ef796c33319c09f6887 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Fri, 1 Jan 2021 20:52:10 -0500 Subject: [PATCH] - windows: create stub functions for the crash logger for ARM. this invites the possibility, hopefully, that if someone is inclined, to actually make one. it also cleans up the code a little bit for intel. --- src/CMakeLists.txt | 1 + src/common/engine/stats.h | 2 +- src/common/platform/win32/i_main.cpp | 12 ++++++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1f0c2664e..d81208556 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -455,6 +455,7 @@ if (NOT ${ZDOOM_TARGET_ARCH} MATCHES "arm" ) set (PLAT_WIN32_SOURCES ${PLAT_WIN32_SOURCES} common/platform/win32/i_crash.cpp ) endif() if (MSVC AND ${ZDOOM_TARGET_ARCH} MATCHES "arm") + set (PLAT_WIN32_SOURCES ${PLAT_WIN32_SOURCES} common/platform/win32/i_crash_arm.cpp ) add_definitions( -DNO_SSE -D__ARM__ -DRAPIDJSON_ENDIAN=RAPIDJSON_LITTLEENDIAN) endif() diff --git a/src/common/engine/stats.h b/src/common/engine/stats.h index 9ce5268a3..18b18f08f 100644 --- a/src/common/engine/stats.h +++ b/src/common/engine/stats.h @@ -36,7 +36,7 @@ #include "zstring.h" -#if !defined _WIN32 && !defined __APPLE__ +#if !defined _WIN32 && !defined __APPLE__ || (defined _WIN32 && !defined _M_ARM64) #ifdef NO_CLOCK_GETTIME class cycle_t diff --git a/src/common/platform/win32/i_main.cpp b/src/common/platform/win32/i_main.cpp index 1d59244c2..7207717ea 100644 --- a/src/common/platform/win32/i_main.cpp +++ b/src/common/platform/win32/i_main.cpp @@ -1076,9 +1076,7 @@ void CALLBACK ExitFatally (ULONG_PTR dummy) SetUnhandledExceptionFilter (ExitMessedUp); I_ShutdownGraphics (); RestoreConView (); -#ifndef _M_ARM64 DisplayCrashLog (); -#endif exit(-1); } @@ -1135,6 +1133,12 @@ LONG WINAPI CatchAllExceptions (LPEXCEPTION_POINTERS info) } return EXCEPTION_CONTINUE_EXECUTION; } +#else // !_M_ARM64 +// stub this function for ARM64 +LONG WINAPI CatchAllExceptions (LPEXCEPTION_POINTERS info) +{ + return EXCEPTION_CONTINUE_EXECUTION; +} #endif // !_M_ARM64 //========================================================================== @@ -1159,11 +1163,7 @@ static void infiniterecursion(int foo) // which offers the very important feature to open a debugger and see the crash in context right away. CUSTOM_CVAR(Bool, disablecrashlog, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) { -#ifndef _M_ARM64 SetUnhandledExceptionFilter(!*self ? CatchAllExceptions : nullptr); -#else - SetUnhandledExceptionFilter(nullptr); -#endif } //==========================================================================