Pol  Revision:4b29d2b
Pol::Clib::ExceptionParser Class Reference

#include <ExceptionParser.h>

Public Member Functions

 ExceptionParser ()
 
virtual ~ExceptionParser ()
 

Static Public Member Functions

static void configureProgramAbortReportingSystem (bool active, std::string server, std::string url, std::string reporter)
 Configures the bug reporting system. More...
 
static std::string getTrace ()
 Returns a string containing the current stack trace. More...
 
static void handleExceptionSignal (int signal)
 Handles exceptions. More...
 
static void initGlobalExceptionCatching ()
 Initiates globally the exception catching (signal handlers for Linux) More...
 
static void logAllStackTraces ()
 Logs stack traces of all threads to stdout and error output. More...
 
static bool programAbortReporting ()
 Returns true if the bug reporting is active. More...
 
static void reportProgramAbort (const std::string &stackTrace, const std::string &reason)
 Reports a program abort to the program devs. More...
 

Static Private Attributes

static bool m_programAbortReporting = false
 
static std::string m_programAbortReportingReporter = ""
 
static std::string m_programAbortReportingServer = ""
 
static std::string m_programAbortReportingUrl = ""
 
static std::string m_programStart = Pol::Clib::Logging::LogSink::getTimeStamp()
 

Detailed Description

Definition at line 10 of file ExceptionParser.h.

Constructor & Destructor Documentation

Pol::Clib::ExceptionParser::ExceptionParser ( )

Definition at line 435 of file ExceptionParser.cpp.

Pol::Clib::ExceptionParser::~ExceptionParser ( )
virtual

Definition at line 437 of file ExceptionParser.cpp.

Member Function Documentation

void Pol::Clib::ExceptionParser::configureProgramAbortReportingSystem ( bool  active,
std::string  server,
std::string  url,
std::string  reporter 
)
static

Configures the bug reporting system.

Definition at line 665 of file ExceptionParser.cpp.

Referenced by Pol::Core::PolConfig::read_pol_config().

string Pol::Clib::ExceptionParser::getTrace ( )
static

Returns a string containing the current stack trace.

Returns
the stack trace as multi-line string

Definition at line 442 of file ExceptionParser.cpp.

References MAX_STACK_TRACE_DEPTH, and MAX_STACK_TRACE_STEP_LENGTH.

Referenced by Pol::Clib::force_backtrace(), handleExceptionSignal(), Pol::Clib::handleStackTraceRequestLinux(), initGlobalExceptionCatching(), and Pol::Clib::passert_failed().

void Pol::Clib::ExceptionParser::handleExceptionSignal ( int  signal)
static

Handles exceptions.

inform the user about the program abort

use the program abort reporting system

Definition at line 367 of file ExceptionParser.cpp.

References Pol::Clib::ProgramConfig::build_datetime(), Pol::Clib::ProgramConfig::build_target(), Pol::Clib::Logging::LogSink::getTimeStamp(), getTrace(), and reportProgramAbort().

Referenced by Pol::Clib::handleSignalLinux().

void Pol::Clib::ExceptionParser::initGlobalExceptionCatching ( )
static

Initiates globally the exception catching (signal handlers for Linux)

Definition at line 621 of file ExceptionParser.cpp.

References getTrace(), Pol::Clib::handleSignalLinux(), Pol::Clib::handleStackTraceRequestLinux(), and logAllStackTraces().

Referenced by Pol::Clib::ProgramMain::start().

void Pol::Clib::ExceptionParser::logAllStackTraces ( )
static

Logs stack traces of all threads to stdout and error output.

Definition at line 603 of file ExceptionParser.cpp.

References Pol::threadhelp::ThreadMap::CopyContents(), and Pol::threadhelp::threadmap.

Referenced by Pol::Clib::force_backtrace(), initGlobalExceptionCatching(), and Pol::Core::threadstatus_thread().

bool Pol::Clib::ExceptionParser::programAbortReporting ( )
static

Returns true if the bug reporting is active.

Definition at line 674 of file ExceptionParser.cpp.

Referenced by Pol::Clib::passert_failed(), and Pol::Core::PolConfig::report_program_aborts().

void Pol::Clib::ExceptionParser::reportProgramAbort ( const std::string &  stackTrace,
const std::string &  reason 
)
static

Reports a program abort to the program devs.

Parameters
stackTracethe stack trace of the abort
reasona descriptive text about the reason for the abort

set some default values if the abort occurs too early and pol.cfg wasn't parsed yet

Definition at line 317 of file ExceptionParser.cpp.

References Pol::Clib::ProgramConfig::build_datetime(), Pol::Clib::ProgramConfig::build_target(), and Pol::Clib::Logging::LogSink::getTimeStamp().

Referenced by handleExceptionSignal(), and Pol::Clib::passert_failed().

Member Data Documentation

bool Pol::Clib::ExceptionParser::m_programAbortReporting = false
staticprivate

Definition at line 56 of file ExceptionParser.h.

std::string Pol::Clib::ExceptionParser::m_programAbortReportingReporter = ""
staticprivate

Definition at line 59 of file ExceptionParser.h.

std::string Pol::Clib::ExceptionParser::m_programAbortReportingServer = ""
staticprivate

Definition at line 57 of file ExceptionParser.h.

std::string Pol::Clib::ExceptionParser::m_programAbortReportingUrl = ""
staticprivate

Definition at line 58 of file ExceptionParser.h.

std::string Pol::Clib::ExceptionParser::m_programStart = Pol::Clib::Logging::LogSink::getTimeStamp()
staticprivate

Definition at line 60 of file ExceptionParser.h.


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