38 std::vector<std::pair<void*, std::string>> frames_;
63 void render(std::ostream& o,
bool line_info=
true)
const;
72 void addFrame(
void* addr,
const char* message);
83 struct sigaction sigact_;
85 std::map<int, struct sigaction> handled_;
Backtrace without line information. Can be rendered out when needed because rendering is slow.
BacktraceData & operator=(const BacktraceData &)=delete
Not copy-assignable.
void addFrame(void *addr, const char *message)
Adds a new frame to the top of the backtrace (which is progressively more shallow in the real stack)....
void render(std::ostream &o, bool line_info=true) const
Render the backtrace to a file.
BacktraceData()=default
Construct the backtrace.
BacktraceData(const BacktraceData &)=default
Copy constructable.
Backtrace printer. Registers a handler for certain fatal signals and dumps the backtrace if they occu...
~Backtrace()
Restore all handlers if they haven't been replaced a second time.
static BacktraceData getBacktrace()
Gets the current backtrace without rendering it.
static void dumpBacktrace(std::ostream &o)
Write the current backtrace to a stream.
void setAsHandler(int signum=SIGSEGV)
Set this as the handler for a signal.
Backtrace()
Default constructor.
Macros for handling exponential backoff.