From 06b2bf0094eebd13b7f56ad5d9c485adecca7f06 Mon Sep 17 00:00:00 2001 From: Wojciech Figat Date: Tue, 3 Jan 2023 15:58:02 +0100 Subject: [PATCH] Add logging native exception stack trace on Windows when debugger is attached before going back to the crash location --- Source/Engine/Platform/Windows/WindowsPlatform.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Engine/Platform/Windows/WindowsPlatform.cpp b/Source/Engine/Platform/Windows/WindowsPlatform.cpp index 5ae55b24d..439a264e5 100644 --- a/Source/Engine/Platform/Windows/WindowsPlatform.cpp +++ b/Source/Engine/Platform/Windows/WindowsPlatform.cpp @@ -305,9 +305,12 @@ LONG CALLBACK SehExceptionHandler(EXCEPTION_POINTERS* ep) errorMsg += String::Format(TEXT("{:#x}"), (uint32)ep->ExceptionRecord->ExceptionCode); } - // Pause if debugging + // Log exception and return to the crash location when using debugger if (Platform::IsDebuggerPresent()) - { + { + LOG_STR(Error, errorMsg); + const String stackTrace = Platform::GetStackTrace(0, 60, ep); + LOG_STR(Error, stackTrace); return EXCEPTION_CONTINUE_SEARCH; }