The Sparta Modeling Framework
Loading...
Searching...
No Matches
sparta::app::Backtrace Class Reference

Backtrace printer. Registers a handler for certain fatal signals and dumps the backtrace if they occur. More...

#include <Backtrace.hpp>

Public Member Functions

 Backtrace ()
 Default constructor.
 
 ~Backtrace ()
 Restore all handlers if they haven't been replaced a second time.
 
void setAsHandler (int signum=SIGSEGV)
 Set this as the handler for a signal.
 

Static Public Member Functions

static void dumpBacktrace (std::ostream &o)
 Write the current backtrace to a stream.
 
static BacktraceData getBacktrace ()
 Gets the current backtrace without rendering it.
 

Detailed Description

Backtrace printer. Registers a handler for certain fatal signals and dumps the backtrace if they occur.

Warning
Simulators using this feature should not be distributed to systems because backtrace printing code is highly platform-specific

Definition at line 81 of file Backtrace.hpp.

Member Function Documentation

◆ setAsHandler()

void sparta::app::Backtrace::setAsHandler ( int  signum = SIGSEGV)

Set this as the handler for a signal.

Note
This can be multiply called with different signals
Parameters
signumSignal to handle

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