Leosac  0.8.0
Open Source Access Control
Leosac::Tools::Stacktrace Class Reference

Store information about a stacktrace at a given point in the program execution. More...

#include <Stacktrace.hpp>

+ Collaboration diagram for Leosac::Tools::Stacktrace:

Classes

struct  Frame
 

Public Member Functions

 Stacktrace (uint skip)
 Build a new stacktrace. More...
 
std::string str (int max_frames=10) const
 

Private Attributes

std::vector< Framestack_
 We use a vector to represent the stack so we can iterate on the frames. More...
 

Detailed Description

Store information about a stacktrace at a given point in the program execution.

The stacktrace represents the states at the time the object was instancied. This object can then be moved around or copied.

The reason for this class to be is because struct backtrace_state * from GCC's libbacktrace cannot be moved around.

Warning
This class will be a no-op if its not compiled with GCC.

Definition at line 42 of file Stacktrace.hpp.

Constructor & Destructor Documentation

◆ Stacktrace()

Stacktrace::Stacktrace ( uint  skip)

Build a new stacktrace.

Parameters
skipThe number of stackframe to skip.

Definition at line 36 of file Stacktrace.cpp.

Member Function Documentation

◆ str()

std::string Stacktrace::str ( int  max_frames = 10) const

Definition at line 68 of file Stacktrace.cpp.

Member Data Documentation

◆ stack_

std::vector<Frame> Leosac::Tools::Stacktrace::stack_
private

We use a vector to represent the stack so we can iterate on the frames.

Definition at line 77 of file Stacktrace.hpp.


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