-
-
Notifications
You must be signed in to change notification settings - Fork 456
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linux: implement throwing exception from signal handlers
- Loading branch information
Showing
2 changed files
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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]"); | ||
|
@@ -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"); } | ||
static void segmentation_fault_handler(int signal) { handler_base("segmentation fault"); } | ||
void segmentation_fault_handler(int signal) { throw std::runtime_error("segfault"); } | ||
static void termination_handler(int signal) { handler_base("termination with exit code 3"); } | ||
|
||
void xrDebug::OnThreadSpawn() | ||
|
@@ -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 | ||
} | ||
|
||
|