Skip to content

Commit

Permalink
C++ exceptions are severe, but don't assert EXCEPTION_SOFTWARE_ORIGIN…
Browse files Browse the repository at this point in the history
…ATE flag, so need a special case.
  • Loading branch information
rfortier committed Aug 25, 2024
1 parent b30c664 commit b568b66
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Code/client/CrashHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@ LONG WINAPI VectoredExceptionHandler(PEXCEPTION_POINTERS pExceptionInfo)

// Check for severe, not continuable and not software-originated exception
if (pExceptionInfo->ExceptionRecord->ExceptionCode >= 0x80000000 &&
pExceptionInfo->ExceptionRecord->ExceptionCode != 0xE06D7363 && // Sigh. C++ exceptions forgot the SOFTWARE_ORIGINATE flag.
(pExceptionInfo->ExceptionRecord->ExceptionFlags & EXCEPTION_SOFTWARE_ORIGINATE) == 0 &&
alreadyCrashed++ == 0)
{
spdlog::critical (__FUNCTION__ ": crash occurred!");

auto present = IsDebuggerPresent() ? "already" : "not";
spdlog::error(__FUNCTION__ ": debugger is {} present at critical exception time, code{:x}, address{}, flags {:x} ",
present,
spdlog::error(__FUNCTION__ ": exception code is {:x}, at address {}, flags {:x} ",
pExceptionInfo->ExceptionRecord->ExceptionCode,
pExceptionInfo->ExceptionRecord->ExceptionAddress,
pExceptionInfo->ExceptionRecord->ExceptionFlags);
Expand Down

0 comments on commit b568b66

Please sign in to comment.