debug: call abort when handling std::terminate

This commit is contained in:
Danny Robson 2018-09-12 14:09:44 +10:00
parent 09a690f2d3
commit 22b6b7e287

View File

@ -68,10 +68,10 @@ warn (const char *msg)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
static void abort_with_info (void) static void abort_with_trace (void)
{ {
LOG_ALERT ("aborting: %!", debug::backtrace {}); LOG_EMERGENCY ("aborting: %!", debug::backtrace {});
std::abort ();
} }
@ -79,7 +79,7 @@ static void abort_with_info (void)
void void
cruft::debug::init [[gnu::constructor]] (void) cruft::debug::init [[gnu::constructor]] (void)
{ {
std::set_terminate (abort_with_info); std::set_terminate (abort_with_trace);
if (!debug_enabled && !getenv ("DEBUG")) if (!debug_enabled && !getenv ("DEBUG"))
return; return;