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