Skip to content

Commit

Permalink
Revert "Linux: implement throwing exception from signal handlers"
Browse files Browse the repository at this point in the history
This reverts commit a42318c.
  • Loading branch information
eagleivg committed Nov 6, 2018
1 parent a38ba88 commit 57be360
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
endif()
endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive --std=c++17 -Wno-attributes -pipe -fvisibility=hidden -Wl,--no-undefined -fnon-call-exceptions")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive --std=c++17 -Wno-attributes -pipe -fvisibility=hidden -Wl,--no-undefined")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive") This is for the future versions
#set(CMAKE_CXX_STANDARD 14) #Otherwise adds -std=gnu++11 and breaks successful building
#set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down
8 changes: 4 additions & 4 deletions src/xrCore/xrDebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ void xrDebug::SetupExceptionHandler()
#else
const auto minidumpFlags = MiniDumpWithDataSegs | MiniDumpWithIndirectlyReferencedMemory;
#endif

BT_SetDumpType(minidumpFlags);
//BT_SetSupportEMail("[email protected]");
BT_SetSupportEMail("[email protected]");
Expand Down Expand Up @@ -817,7 +817,7 @@ static void unexpected_handler() { handler_base("unexpected program termination"
static void abort_handler(int signal) { handler_base("application is aborting"); }
static void floating_point_handler(int signal) { handler_base("floating point error"); }
static void illegal_instruction_handler(int signal) { handler_base("illegal instruction"); }
void segmentation_fault_handler(int signal) { throw std::runtime_error("segfault"); }
static void segmentation_fault_handler(int signal) { handler_base("segmentation fault"); }
static void termination_handler(int signal) { handler_base("termination with exit code 3"); }

void xrDebug::OnThreadSpawn()
Expand All @@ -843,12 +843,12 @@ void xrDebug::OnThreadSpawn()
std::set_unexpected(_terminate);
#endif
#else //WINDOWS
signal(SIGSEGV, sigsegv_handler);
std::set_terminate(_terminate);
signal(SIGABRT, abort_handler);
signal(SIGFPE, floating_point_handler);
signal(SIGILL, illegal_instruction_handler);
signal(SIGINT, 0);
signal(SIGTERM, termination_handler);
signal(SIGSEGV, segmentation_fault_handler);
#endif
}

Expand Down

0 comments on commit 57be360

Please sign in to comment.