MIRA
Classes | Public Member Functions | Static Public Member Functions | Friends | List of all members
CallStack Class Reference

Encapsulates unix call stack functionality. More...

#include <error/CallStack.h>

Classes

struct  Symbol
 Contains all information of a single function symbol in the call stack. More...
 

Public Member Functions

 CallStack ()
 Constructor that creates an empty call stack. More...
 
 CallStack (const CallStack &other)
 Copy-Constructor. More...
 
const CallStackoperator= (const CallStack &other)
 Assignment operator with similar behaviour as copy-constructor. More...
 
template<typename Reflector >
void reflect (Reflector &r)
 
const Symboloperator[] (std::size_t i) const
 Returns the i-th symbol of the call stack. More...
 
std::size_t size () const
 Returns the size of the call stack. More...
 

Static Public Member Functions

static CallStack backtrace (std::size_t maxSize=10, std::size_t stackStart=1)
 Creates the call stack object that contains the callstack starting at the current address of the instruction pointer. More...
 

Friends

MIRA_BASE_EXPORT std::ostream & operator<< (std::ostream &os, const CallStack &stack)
 Prints the whole stack into a stream in a similar format as the GDB. More...
 

Detailed Description

Encapsulates unix call stack functionality.

It allows to retrieve the current call stack with all symbols to the functions. The stack can be printed to a stream in a similar format as in the GDB using the << operator.

Constructor & Destructor Documentation

◆ CallStack() [1/2]

CallStack ( )
inline

Constructor that creates an empty call stack.

◆ CallStack() [2/2]

CallStack ( const CallStack other)
inline

Copy-Constructor.

Member Function Documentation

◆ operator=()

const CallStack& operator= ( const CallStack other)

Assignment operator with similar behaviour as copy-constructor.

◆ reflect()

void reflect ( Reflector &  r)
inline

◆ operator[]()

const Symbol& operator[] ( std::size_t  i) const

Returns the i-th symbol of the call stack.

◆ size()

std::size_t size ( ) const
inline

Returns the size of the call stack.

◆ backtrace()

static CallStack backtrace ( std::size_t  maxSize = 10,
std::size_t  stackStart = 1 
)
static

Creates the call stack object that contains the callstack starting at the current address of the instruction pointer.

Friends And Related Function Documentation

◆ operator<<

MIRA_BASE_EXPORT std::ostream& operator<< ( std::ostream &  os,
const CallStack stack 
)
friend

Prints the whole stack into a stream in a similar format as the GDB.


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