vg
tools for working with variation graphs
Namespaces | Macros | Functions
crash.hpp File Reference
#include <functional>
#include <string>

Namespaces

 vg
 

Macros

#define crash_unless(condition)   crash_unless_impl((condition), #condition, __FILE__, __LINE__, __func__);
 User code should call this instead of assert. More...
 

Functions

void vg::enable_crash_handling ()
 Main should call this to turn on our stack tracing support. More...
 
void vg::set_crash_context (const std::string &message)
 User code should call this when it has context for a failure in its thread. More...
 
void vg::clear_crash_context ()
 User code should call this when it wants to clear context for a failure in its thread. More...
 
void vg::with_exception_handling (const std::function< void(void)> &body)
 User code should call this to get all its exceptions handled. More...
 
void vg::report_exception (const std::exception &ex)
 
void vg::crash_unless_impl (bool condition, const std::string &condition_string, const std::string &file, int line, const std::string &function)
 crash_unless calls into this function for a real implementation. More...
 

Detailed Description

Implementation for crash handling to create a stack trace when VG crashes. To use the crash handling system, call enable_crash_handling() early on in the program. When a crash occurs, you will recieve an error message with the stack trace. To get just a filename, you need to set the environment variable 'VG_FULL_TRACEBACK=0'.

Macro Definition Documentation

◆ crash_unless

#define crash_unless (   condition)    crash_unless_impl((condition), #condition, __FILE__, __LINE__, __func__);

User code should call this instead of assert.