Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
CrashHandler Class Reference

#include <elm/debug/CrashHandler.h>

+ Inheritance diagram for CrashHandler:

Public Types

typedef t::uint32 mode_t
 

Public Member Functions

virtual void setup (void)
 
virtual void handle (void)
 
virtual void cleanup (void)
 

Static Public Member Functions

static void set (CrashHandler *handler, mode_t mode)
 
static CrashHandlerget (void)
 
static mode_t mode (void)
 
static void crash (void)
 

Static Public Attributes

static const t::uint32 DEBUG = 0x01
 
static const t::uint32 INT = 0x02
 
static CrashHandler DEFAULT
 

Protected Member Functions

 CrashHandler (void)
 
virtual ~CrashHandler (void)
 

Detailed Description

This allows to provide customized handler for program crash. Currently, there are only two: this default crash handler reverting to the program abort and the GDBCrashHandler.

Member Typedef Documentation

◆ mode_t

typedef t::uint32 mode_t

Constructor & Destructor Documentation

◆ CrashHandler()

CrashHandler ( void  )
inlineprotected

Protected constructor to avoid multiple declaration.

◆ ~CrashHandler()

virtual ~CrashHandler ( void  )
inlineprotectedvirtual

Member Function Documentation

◆ cleanup()

void cleanup ( void  )
virtual

This function is called when the handler is removed.

Reimplemented in NoCrashHandler.

References CrashHandler::DEBUG, CrashHandler::INT, and CrashHandler::mode().

Referenced by GDBCrashHandler::handle(), and CrashHandler::set().

◆ crash()

void crash ( void  )
static

Initiate the crash of the program.

Warning
no crash support is provided if the ELM_DEBUG environment variable is set to "no".

References CrashHandler::handle().

Referenced by elm::crash(), elm::handle_SIGABRT(), elm::handle_SIGFPE(), elm::handle_SIGILL(), elm::handle_SIGINT(), and elm::handle_SIGSEGV().

◆ get()

CrashHandler * get ( void  )
inlinestatic

Get the current crash handler.

Returns
Current crash handler.

◆ handle()

void handle ( void  )
virtual

This function is called when a crash need to be handled.

Reimplemented in NoCrashHandler, and GDBCrashHandler.

Referenced by CrashHandler::crash().

◆ mode()

static mode_t mode ( void  )
inlinestatic

◆ set()

void set ( CrashHandler handler,
mode_t  mode 
)
static

Set the current crash handler.

Parameters
handlerNew crash handler.
modeWorking mode of the handler (combination of DEBUG and KILL).

References CrashHandler::cleanup(), CrashHandler::mode(), and CrashHandler::setup().

Referenced by CrashMonitor::CrashMonitor(), and CrashMonitor::~CrashMonitor().

◆ setup()

void setup ( void  )
virtual

Member Data Documentation

◆ DEBUG

◆ DEFAULT

CrashHandler DEFAULT
static

Singleton of the default crash handler.

Referenced by CrashMonitor::CrashMonitor().

◆ INT


The documentation for this class was generated from the following files: