#include <FatalSignals.h>
Definition at line 22 of file FatalSignals.h.
Static Public Member Functions | |
static void | init (const char *appname) |
Set up the debugging stack dump handler for all fatal signals. | |
static void | cancel () |
Cancel registered fatal handlers. | |
static void | set_core_dir (const char *dir) |
Set the directory to chdir to before dumping core in the case of a fatal signal. | |
static void | die () __attribute__((noreturn)) |
Print a stack trace and die. | |
Static Protected Member Functions | |
static void | handler (int sig) |
Fatal signal handler. | |
Static Protected Attributes | |
static const char * | appname_ = "(unknown app)" |
The app name to put in the stack trace printout. | |
static const char * | core_dir_ = NULL |
The directory to chdir() into before dumping core. | |
static bool | in_abort_handler_ = false |
Flag set in the abort/quit handler when we deliver the signal to other threads. |
void oasys::FatalSignals::init | ( | const char * | appname | ) | [static] |
Set up the debugging stack dump handler for all fatal signals.
Definition at line 36 of file FatalSignals.cc.
References appname_, and handler().
Referenced by oasys::UnitTester::init(), and dtn::DTND::main().
void oasys::FatalSignals::cancel | ( | ) | [static] |
Cancel registered fatal handlers.
Definition at line 48 of file FatalSignals.cc.
Referenced by die().
static void oasys::FatalSignals::set_core_dir | ( | const char * | dir | ) | [inline, static] |
Set the directory to chdir to before dumping core in the case of a fatal signal.
Definition at line 38 of file FatalSignals.h.
References core_dir_.
void oasys::FatalSignals::die | ( | ) | [static] |
Print a stack trace and die.
Definition at line 128 of file FatalSignals.cc.
References oasys::Breaker::break_here(), cancel(), core_dir_, and oasys::StackTrace::print_current_trace().
void oasys::FatalSignals::handler | ( | int | sig | ) | [static, protected] |
Fatal signal handler.
Definition at line 59 of file FatalSignals.cc.
References oasys::Thread::all_threads_, appname_, core_dir_, oasys::Thread::current(), FATAL, in_abort_handler_, oasys::Thread::max_live_threads_, oasys::StackTrace::print_current_trace(), snprintf(), and oasys::Thread::thread_id().
Referenced by init().
const char * oasys::FatalSignals::appname_ = "(unknown app)" [static, protected] |
const char * oasys::FatalSignals::core_dir_ = NULL [static, protected] |
The directory to chdir() into before dumping core.
Definition at line 56 of file FatalSignals.h.
Referenced by die(), handler(), and set_core_dir().
bool oasys::FatalSignals::in_abort_handler_ = false [static, protected] |
Flag set in the abort/quit handler when we deliver the signal to other threads.
Definition at line 60 of file FatalSignals.h.
Referenced by handler().