Classes | Macros | Variables
journalexception.h File Reference
#include <string>
#include <xstypes/xsexception.h>
#include "journaller.h"
#include <signal.h>
#include <cstring>
Include dependency graph for journalexception.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  JournalException
 An exception class that automatically includes stack dump information. More...
 

Macros

#define JLTHROW(msg)   do { std::ostringstream os; os << msg; throw JournalException(os.str()); } while(0)
 Use this macro to throw an exception that includes callstack information. More...
 
#define JOURNALCRASHES_BEGIN(journal)
 
#define JOURNALCRASHES_END(journal)
 
#define JOURNALCRASHES_SIGNAL_FUNCTIONS
 
#define JOURNALEXCEPTIONS_BEGIN(journal)   try {
 
#define JOURNALEXCEPTIONS_END_NOTHROW(journal)
 
#define JOURNALEXCEPTIONS_END_RETHROW(journal)
 

Variables

bool gOnExceptionGotoDebugger
 

Macro Definition Documentation

◆ JLTHROW

#define JLTHROW (   msg)    do { std::ostringstream os; os << msg; throw JournalException(os.str()); } while(0)

Use this macro to throw an exception that includes callstack information.

Definition at line 93 of file journalexception.h.

◆ JOURNALCRASHES_BEGIN

#define JOURNALCRASHES_BEGIN (   journal)
Value:
do { \
gSCJ = journal;\
struct sigaction act;\
memset(&act, 0, sizeof(act));\
act.sa_flags = SA_SIGINFO;\
act.sa_sigaction = &signal_handler;\
sigaction(SIGSEGV, &act, NULL);\
sigaction(SIGILL, &act, NULL);\
sigaction(SIGABRT, &act, NULL);\
sigaction(SIGFPE, &act, NULL);\
} while (0);

Definition at line 128 of file journalexception.h.

◆ JOURNALCRASHES_END

#define JOURNALCRASHES_END (   journal)

Definition at line 140 of file journalexception.h.

◆ JOURNALCRASHES_SIGNAL_FUNCTIONS

#define JOURNALCRASHES_SIGNAL_FUNCTIONS
Value:
Journaller *gSCJ = 0;\
extern "C" void signal_handler(int signal, siginfo_t *, void *)\
{\
if (gSCJ)\
{\
JLFATAL_NODEC(gSCJ, strsignal(signal));\
gSCJ->writeCallstack(JLL_Fatal);\
}\
_exit(-1);\
}

Definition at line 116 of file journalexception.h.

◆ JOURNALEXCEPTIONS_BEGIN

#define JOURNALEXCEPTIONS_BEGIN (   journal)    try {

Definition at line 149 of file journalexception.h.

◆ JOURNALEXCEPTIONS_END_NOTHROW

#define JOURNALEXCEPTIONS_END_NOTHROW (   journal)
Value:
} catch (JournalException& e) { JLERROR(journal, e.msg()); JLERROR_NODEC(journal, e.stack()); }\
catch (XsException& e) { JLERROR(journal, e.what()); }\
catch (std::exception& e) { JLERROR(journal, e.what()); }

Definition at line 152 of file journalexception.h.

◆ JOURNALEXCEPTIONS_END_RETHROW

#define JOURNALEXCEPTIONS_END_RETHROW (   journal)
Value:
} catch (JournalException& e) { JLERROR(journal, e.msg()); JLERROR_NODEC(journal, e.stack()); throw; }\
catch (XsException& e) { JLERROR(journal, e.what()); throw; }\
catch (std::exception& e) { JLERROR(journal, e.what()); throw; }

Definition at line 157 of file journalexception.h.

Variable Documentation

◆ gOnExceptionGotoDebugger

bool gOnExceptionGotoDebugger

When set to true, any caught exception at the C level will be passed on upward (ie to the debugger) When set to false, the exception handling stops at this level. This only applies to C level exceptions.

Definition at line 121 of file journalexception.cpp.

JLERROR_NODEC
#define JLERROR_NODEC(journal, msg)
Definition: journaller.h:259
Journaller
A journalling class for debugging applications.
Definition: journaller.h:79
JLL_Fatal
@ JLL_Fatal
only log fatal messages
Definition: journalloglevel.h:94
JournalException
An exception class that automatically includes stack dump information.
Definition: journalexception.h:78
JournalException::stack
const std::string & stack() const
The stack dump as it was at the time of object construction.
Definition: journalexception.cpp:107
JournalException::msg
const char * msg() const
The message as supplied to the constructor.
Definition: journalexception.cpp:101
JLERROR
#define JLERROR(journal, msg)
Definition: journaller.h:258


xsens_mti_driver
Author(s):
autogenerated on Sun Sep 3 2023 02:43:21