mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
Unfortunately, the symbol resolution of boost::stacktrace is broken on FreeBSD, therefore fall back to using backtrace_symbols() to print the stack trace saved by Boost. Additionally, -D_GNU_SOURCE is required on FreeBSD for the _Unwind_Backtrace function used by boost::stacktrace.
26 lines
513 B
C++
26 lines
513 B
C++
/* Icinga 2 | (c) 2020 Icinga GmbH | GPLv2+ */
|
|
|
|
#ifndef STACKTRACE_H
|
|
#define STACKTRACE_H
|
|
|
|
#include <boost/stacktrace.hpp>
|
|
|
|
namespace icinga
|
|
{
|
|
|
|
class StackTraceFormatter {
|
|
public:
|
|
StackTraceFormatter(const boost::stacktrace::stacktrace &stack) : m_Stack(stack) {}
|
|
|
|
private:
|
|
const boost::stacktrace::stacktrace &m_Stack;
|
|
|
|
friend std::ostream &operator<<(std::ostream &os, const StackTraceFormatter &f);
|
|
};
|
|
|
|
std::ostream& operator<<(std::ostream& os, const StackTraceFormatter &f);
|
|
|
|
}
|
|
|
|
#endif /* STACKTRACE_H */
|