fire v0.19.0
Framework for sImulation and Reconstruction of Events
Exception.cxx File Reference

Definition of stack trace building functions. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <cxxabi.h>
#include <dlfcn.h>
#include <execinfo.h>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <string>
#include "fire/exception/Exception.h"
Include dependency graph for Exception.cxx:

Functions

static char * addr2line (const char *image, void *addr, bool color_output)
 Invokes addr2line utility to determine the function name and the line information from an address in the code segment. More...
 
static std::string Backtrace (int skip=1)
 Produce a stack backtrace with demangled function and method names. More...
 

Detailed Description

Definition of stack trace building functions.

Function Documentation

◆ addr2line()

static char * addr2line ( const char *  image,
void *  addr,
bool  color_output 
)
static

Invokes addr2line utility to determine the function name and the line information from an address in the code segment.

Note
This function is not fully tested or designed well.
Parameters
[in]image
[in]addrfunction address
[in]color_outputtrue if output should be colored
Returns
string holding function name and line

◆ Backtrace()

static std::string Backtrace ( int  skip = 1)
static

Produce a stack backtrace with demangled function and method names.

Note
Some backtraces are causing segmentation violations. Not sure why...
Parameters
[in]skipnumber of calls in the trace to skip from the bottom
Returns
string holding backtrace information