CallStack

class CallStack

Call stack object.

The allocation of the stack must be static to prevent problems during out-of-memory scenario. That’s why we should not be using std::vector or similar.

Public Functions

explicit CallStack()

Build the call stack object with defined size.

void dump()

Dump the call stack objects to standard error.

void add(Msg *msg)

Add a message to a stack.

void remove(Msg *msg)

Remove a message from a stack.

int get_size() const

Get size of the call stack.

Msg *at(int idx) const

Get item at position idx

Public Static Functions

static void initialize()

Initialize the call stack capability.

This hooks to SIGABRT and SIGSEGV signals

struct Msg

Holds data for one call stack object.

Public Functions

Msg(const char *func)

Construct call stack object.

Parameters:

funcFunction name

Public Members

std::string msg

Message.