From efa434d47b23ceb2edc87fcb898162b204fb7b92 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sun, 10 Jun 2018 13:15:31 +0200 Subject: [PATCH] - remove unused VectoredTryCatch --- src/swrenderer/drawers/r_thread.cpp | 9 --- src/swrenderer/drawers/r_thread.h | 3 - src/win32/i_crash.cpp | 108 ---------------------------- 3 files changed, 120 deletions(-) diff --git a/src/swrenderer/drawers/r_thread.cpp b/src/swrenderer/drawers/r_thread.cpp index 32e73683a..657960b17 100644 --- a/src/swrenderer/drawers/r_thread.cpp +++ b/src/swrenderer/drawers/r_thread.cpp @@ -203,15 +203,6 @@ void DrawerThreads::StopThreads() shutdown_flag = false; } -#ifndef WIN32 - -void VectoredTryCatch(void *data, void(*tryBlock)(void *data), void(*catchBlock)(void *data, const char *reason, bool fatal)) -{ - tryBlock(data); -} - -#endif - DrawerCommandQueue::DrawerCommandQueue(RenderMemory *frameMemory) : FrameMemory(frameMemory) { } diff --git a/src/swrenderer/drawers/r_thread.h b/src/swrenderer/drawers/r_thread.h index c09f62b4b..f75cc8436 100644 --- a/src/swrenderer/drawers/r_thread.h +++ b/src/swrenderer/drawers/r_thread.h @@ -97,8 +97,6 @@ public: virtual void Execute(DrawerThread *thread) = 0; }; -void VectoredTryCatch(void *data, void(*tryBlock)(void *data), void(*catchBlock)(void *data, const char *reason, bool fatal)); - class DrawerCommandQueue; typedef std::shared_ptr DrawerCommandQueuePtr; @@ -122,7 +120,6 @@ private: void WorkerMain(DrawerThread *thread); static DrawerThreads *Instance(); - static void ReportDrawerError(DrawerCommand *command, bool worker_thread, const char *reason, bool fatal); std::vector threads; diff --git a/src/win32/i_crash.cpp b/src/win32/i_crash.cpp index 9eeb92c3b..64ffc32bd 100644 --- a/src/win32/i_crash.cpp +++ b/src/win32/i_crash.cpp @@ -3341,111 +3341,3 @@ void DisplayCrashLog () } CloseTarFiles (); } - -///////////////////////////////////////////////////////////////////////////// - -namespace -{ - bool __declspec(thread) DrawerExceptionSetJumpResult; - CONTEXT __declspec(thread) DrawerExceptionSetJumpContext; - PVOID __declspec(thread) DrawerExceptionHandlerHandle; - const char __declspec(thread) *DrawerExceptionReason; - bool __declspec(thread) DrawerExceptionFatal; - - LONG WINAPI DrawerExceptionHandler(_EXCEPTION_POINTERS *exceptionInfo) - { - *exceptionInfo->ContextRecord = DrawerExceptionSetJumpContext; - - DrawerExceptionFatal = false; - switch (exceptionInfo->ExceptionRecord->ExceptionCode) - { - default: DrawerExceptionReason = "Unknown exception code"; break; - case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: DrawerExceptionReason = "Array bounds exceeded"; break; - case EXCEPTION_BREAKPOINT: DrawerExceptionReason = "Breakpoint"; break; - case EXCEPTION_DATATYPE_MISALIGNMENT: DrawerExceptionReason = "Datatype misalignment"; break; - case EXCEPTION_FLT_DENORMAL_OPERAND: DrawerExceptionReason = "Float denormal operand"; break; - case EXCEPTION_FLT_DIVIDE_BY_ZERO: DrawerExceptionReason = "Float divide by zero"; break; - case EXCEPTION_FLT_INEXACT_RESULT: DrawerExceptionReason = "Float inexact result"; break; - case EXCEPTION_FLT_INVALID_OPERATION: DrawerExceptionReason = "Float invalid operation"; break; - case EXCEPTION_FLT_OVERFLOW: DrawerExceptionReason = "Float overflow"; break; - case EXCEPTION_FLT_STACK_CHECK: DrawerExceptionReason = "Float stack check"; break; - case EXCEPTION_FLT_UNDERFLOW: DrawerExceptionReason = "Float underflow"; break; - case EXCEPTION_INT_DIVIDE_BY_ZERO: DrawerExceptionReason = "Int divide by zero"; break; - case EXCEPTION_INT_OVERFLOW: DrawerExceptionReason = "Int overflow"; break; - case EXCEPTION_INVALID_DISPOSITION: DrawerExceptionReason = "Invalid disposition"; break; - case EXCEPTION_NONCONTINUABLE_EXCEPTION: DrawerExceptionReason = "Noncontinuable exception"; break; - case EXCEPTION_PRIV_INSTRUCTION: DrawerExceptionReason = "Priv instruction"; break; - case EXCEPTION_SINGLE_STEP: DrawerExceptionReason = "Single step"; break; - case EXCEPTION_STACK_OVERFLOW: DrawerExceptionReason = "Stack overflow"; break; - - case EXCEPTION_ILLEGAL_INSTRUCTION: - DrawerExceptionReason = "Illegal instruction"; - DrawerExceptionFatal = true; - break; - - case EXCEPTION_ACCESS_VIOLATION: - if (exceptionInfo->ExceptionRecord->ExceptionInformation[0] == 0) - { - DrawerExceptionReason = "Read access violation"; - } - else if (exceptionInfo->ExceptionRecord->ExceptionInformation[0] == 1) - { - DrawerExceptionReason = "Write access violation"; - DrawerExceptionFatal = true; - } - else if (exceptionInfo->ExceptionRecord->ExceptionInformation[0] == 8) - { - DrawerExceptionReason = "User-mode data execution prevention (DEP) violation"; - DrawerExceptionFatal = true; - } - else - { - DrawerExceptionReason = "Unknown access violation"; - DrawerExceptionFatal = true; - } - break; - - case EXCEPTION_IN_PAGE_ERROR: - if (exceptionInfo->ExceptionRecord->ExceptionInformation[0] == 0) - { - DrawerExceptionReason = "In page read error"; - } - else if (exceptionInfo->ExceptionRecord->ExceptionInformation[0] == 1) - { - DrawerExceptionReason = "In page write error"; - DrawerExceptionFatal = true; - } - else if (exceptionInfo->ExceptionRecord->ExceptionInformation[0] == 8) - { - DrawerExceptionReason = "In page user-mode data execution prevention (DEP) error"; - DrawerExceptionFatal = true; - } - else - { - DrawerExceptionReason = "Unknown in page read error"; - DrawerExceptionFatal = true; - } - break; - } - - return EXCEPTION_CONTINUE_EXECUTION; - } -} - -void VectoredTryCatch(void *data, void(*tryBlock)(void *data), void(*catchBlock)(void *data, const char *reason, bool fatal)) -{ - DrawerExceptionSetJumpResult = false; - RtlCaptureContext(&DrawerExceptionSetJumpContext); - if (DrawerExceptionSetJumpResult) - { - RemoveVectoredExceptionHandler(DrawerExceptionHandlerHandle); - catchBlock(data, DrawerExceptionReason, DrawerExceptionFatal); - } - else - { - DrawerExceptionSetJumpResult = true; - DrawerExceptionHandlerHandle = AddVectoredExceptionHandler(1, DrawerExceptionHandler); - tryBlock(data); - RemoveVectoredExceptionHandler(DrawerExceptionHandlerHandle); - } -}