Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::CrashHandler Class Reference

#include <elm/debug/CrashHandler.h>

+ Inheritance diagram for elm::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

Constructor & Destructor Documentation

elm::CrashHandler::CrashHandler ( void  )
protected

Protected constructor to avoid multiple declaration.

virtual elm::CrashHandler::~CrashHandler ( void  )
protectedvirtual

Member Function Documentation

void elm::CrashHandler::cleanup ( void  )
virtual

This function is called when the handler is removed.

Reimplemented in elm::NoCrashHandler.

References DEBUG, INT, and mode().

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

void elm::CrashHandler::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 handle().

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

CrashHandler * elm::CrashHandler::get ( void  )
static

Get the current crash handler.

Returns
Current crash handler.
void elm::CrashHandler::handle ( void  )
virtual

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

Reimplemented in elm::NoCrashHandler, and elm::GDBCrashHandler.

Referenced by crash().

static mode_t elm::CrashHandler::mode ( void  )
static

Referenced by cleanup(), set(), and setup().

void elm::CrashHandler::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 cleanup(), mode(), and setup().

void elm::CrashHandler::setup ( void  )
virtual

This function is called when the handler is installed.

Reimplemented in elm::NoCrashHandler.

References DEBUG, elm::handle_SIGABRT(), elm::handle_SIGFPE(), elm::handle_SIGILL(), elm::handle_SIGINT(), elm::handle_SIGSEGV(), INT, and mode().

Referenced by set().

Member Data Documentation

const t::uint32 elm::CrashHandler::DEBUG = 0x01
static

Referenced by cleanup(), and setup().

CrashHandler elm::CrashHandler::DEFAULT
static

Singleton of the default crash handler.

const t::uint32 elm::CrashHandler::INT = 0x02
static

Referenced by cleanup(), and setup().


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