From 25e7ce5750e97dc182df11e5590b00bfde433972 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 3 Jan 2026 20:41:17 +0100 Subject: [PATCH] impr: Disable exception wrapping as it causes a lot of slowdowns (cherry picked from commit 8fc2d6b225125382129dc197ff3786238f832f5d) --- lib/trace/CMakeLists.txt | 3 --- lib/trace/source/exceptions.cpp | 16 ---------------- 2 files changed, 19 deletions(-) diff --git a/lib/trace/CMakeLists.txt b/lib/trace/CMakeLists.txt index 28e93ad9d..814947f95 100644 --- a/lib/trace/CMakeLists.txt +++ b/lib/trace/CMakeLists.txt @@ -79,9 +79,6 @@ endif() if (IMHEX_TRACE_EXCEPTIONS) if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") - target_link_options(tracing ${LIBIMHEX_LIBRARY_TYPE_PUBLIC} "-Wl,--wrap=__cxa_throw") - target_compile_definitions(tracing ${LIBIMHEX_LIBRARY_TYPE_PRIVATE} HEX_WRAP_CXA_THROW) - target_link_options(tracing ${LIBIMHEX_LIBRARY_TYPE_PUBLIC} "-Wl,--wrap=_ZSt21__glibcxx_assert_failPKciS0_S0_") target_compile_definitions(tracing ${LIBIMHEX_LIBRARY_TYPE_PRIVATE} HEX_WRAP_GLIBCXX_ASSERT_FAIL) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") diff --git a/lib/trace/source/exceptions.cpp b/lib/trace/source/exceptions.cpp index 1d39ffded..9325c7705 100644 --- a/lib/trace/source/exceptions.cpp +++ b/lib/trace/source/exceptions.cpp @@ -30,22 +30,6 @@ namespace hex::trace { } -#if defined(HEX_WRAP_CXA_THROW) - - extern "C" { - - [[noreturn]] void __real___cxa_throw(void* thrownException, std::type_info* type, void (*destructor)(void*)); - [[noreturn]] void __wrap___cxa_throw(void* thrownException, std::type_info* type, void (*destructor)(void*)) { - if (hex::trace::s_threadExceptionCaptureEnabled) - hex::trace::s_lastExceptionStackTrace = hex::trace::getStackTrace(); - - __real___cxa_throw(thrownException, type, destructor); - } - - } - -#endif - #if defined(HEX_WRAP_GLIBCXX_ASSERT_FAIL) extern "C" {