debug: call abort when handling std::terminate
This commit is contained in:
parent
09a690f2d3
commit
22b6b7e287
@ -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
|
||||
cruft::debug::init [[gnu::constructor]] (void)
|
||||
{
|
||||
std::set_terminate (abort_with_info);
|
||||
std::set_terminate (abort_with_trace);
|
||||
|
||||
if (!debug_enabled && !getenv ("DEBUG"))
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user