vg
tools for working with variation graphs
Namespaces | Macros | Functions | Variables
crash.cpp File Reference
#include "crash.hpp"
#include "version.hpp"
#include <pthread.h>
#include <errno.h>
#include <cxxabi.h>
#include <execinfo.h>
#include <ucontext.h>
#include <dlfcn.h>
#include <cstring>
#include <limits.h>
#include <cstdlib>
#include <unistd.h>
#include <string>
#include <iostream>
#include <fstream>
#include <signal.h>
#include <backward.hpp>

Namespaces

 vg
 

Macros

#define _POSIX_C_SOURCE   200809L
 
#define _XOPEN_SOURCE   1
 
#define BACKWARD_HAS_DW   1
 

Functions

void vg::stacktrace_manually (ostream &out, int signalNumber, void *ip, void **bp)
 
void vg::emit_stacktrace (int signalNumber, siginfo_t *signalInfo, void *signalContext)
 Emit a stack trace when something bad happens. Add as a signal handler with sigaction. More...
 
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...
 

Variables

const char * vg::var = "VG_FULL_TRACEBACK"
 
bool vg::fullTrace = false
 
const char * vg::ISSUE_URL = "https://github.com/vgteam/vg/issues/new/choose"
 
thread_local std::string vg::stored_crash_context
 

Macro Definition Documentation

◆ _POSIX_C_SOURCE

#define _POSIX_C_SOURCE   200809L

◆ _XOPEN_SOURCE

#define _XOPEN_SOURCE   1

◆ BACKWARD_HAS_DW

#define BACKWARD_HAS_DW   1