Conditionally calltrace in abort(3).
This commit is contained in:
parent
f6371bfcec
commit
6b790a3184
|
@ -22,6 +22,9 @@
|
|||
|
||||
*******************************************************************************/
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <calltrace.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(SORTIX_KERNEL)
|
||||
|
@ -38,6 +41,11 @@ extern "C" void abort(void)
|
|||
|
||||
extern "C" void abort(void)
|
||||
{
|
||||
struct stat st;
|
||||
if ( getenv("LIBC_DEBUG_CALLTRACE") || stat("/etc/calltrace", &st) == 0 )
|
||||
calltrace();
|
||||
if ( getenv("LIBC_DEBUG_LOOP") || stat("/etc/calltrace_loop", &st) == 0 )
|
||||
while ( true );
|
||||
// TODO: Send SIGABRT instead!
|
||||
_Exit(128 + 6);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue