icinga2/lib/base/stacktrace.hpp

39 lines
569 B
C++
Raw Normal View History

/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
#ifndef STACKTRACE_H
#define STACKTRACE_H
2014-05-25 10:23:35 -04:00
#include "base/i2-base.hpp"
2018-01-04 12:24:45 -05:00
#include <iosfwd>
2013-03-15 13:21:29 -04:00
namespace icinga
{
/**
* A stacktrace.
*
* @ingroup base
*/
2017-12-31 01:22:16 -05:00
class StackTrace
{
public:
StackTrace();
#ifdef _WIN32
2013-03-14 18:52:52 -04:00
explicit StackTrace(PEXCEPTION_POINTERS exi);
#endif /* _WIN32 */
2013-03-16 16:18:53 -04:00
void Print(std::ostream& fp, int ignoreFrames = 0) const;
static void StaticInitialize();
private:
void *m_Frames[64];
int m_Count;
};
2017-12-31 01:22:16 -05:00
std::ostream& operator<<(std::ostream& stream, const StackTrace& trace);
}
#endif /* UTILITY_H */