OpenWalnut  1.5.0dev
Public Member Functions | Static Public Member Functions | List of all members
WSegmentationFault Class Reference

Base exception class for handling segmentation faults. More...

#include <WSegmentationFault.h>

+ Inheritance diagram for WSegmentationFault:
+ Collaboration diagram for WSegmentationFault:

Public Member Functions

 WSegmentationFault (const std::string &msg="Segmentation Fault")
 Default constructor. More...
 
virtual ~WSegmentationFault () throw ()
 Destructor. More...
 
- Public Member Functions inherited from WException
 WException (const std::string &msg=std::string())
 Default constructor. More...
 
 WException (const std::exception &e)
 Copy a std::exception and encapsulate it. More...
 
virtual ~WException () throw ()
 Destructor. More...
 
virtual const char * what () const throw ()
 Returns the message string set on throw. More...
 
std::string getTrace () const
 Prints the trace of the call chain which caused this exception. More...
 
std::string getBacktrace () const
 Returns a call stacktrace. More...
 

Static Public Member Functions

static int getSignalNumber () throw ()
 Defines signal type to handle. More...
 
static void installSignalHandler () throw ()
 Installs this exception as signal handler for SIGSEGV. More...
 
- Static Public Member Functions inherited from WException
static void disableBacktrace ()
 Function disables backtraces. More...
 

Additional Inherited Members

- Protected Attributes inherited from WException
std::string m_msg
 Message given during throw. More...
 
std::list< std::string > m_trace
 Stack trace for identifying the source where this exception came from. More...
 
- Static Protected Attributes inherited from WException
static bool noBacktrace = false
 True if the backtrace should NOT be printed. More...
 

Detailed Description

Base exception class for handling segmentation faults.

It throws segmentation faults as exceptions. Please remember that SIGSEGV is not recoverable, which means it can NOT be catched! Also note that this will only work on Linux.

Definition at line 78 of file WSegmentationFault.h.

Constructor & Destructor Documentation

◆ WSegmentationFault()

WSegmentationFault::WSegmentationFault ( const std::string &  msg = "Segmentation Fault")
explicit

Default constructor.

Parameters
msgname of the exception. mostly the default "Segmentation Fault"

Definition at line 29 of file WSegmentationFault.cpp.

References WException::m_msg.

◆ ~WSegmentationFault()

WSegmentationFault::~WSegmentationFault ( )
throw (
)
virtual

Destructor.

Definition at line 36 of file WSegmentationFault.cpp.

Member Function Documentation

◆ getSignalNumber()

int WSegmentationFault::getSignalNumber ( )
throw (
)
static

Defines signal type to handle.

Returns
The signal number.

Definition at line 41 of file WSegmentationFault.cpp.

◆ installSignalHandler()

void WSegmentationFault::installSignalHandler ( )
throw (
)
static

Installs this exception as signal handler for SIGSEGV.

This will just work on Linux.

Definition at line 50 of file WSegmentationFault.cpp.


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