ClickHouse/dbms/src/Common/StackTrace.h
2017-06-23 08:39:27 +03:00

23 lines
367 B
C++

#pragma once
#include <string>
#define STACK_TRACE_MAX_DEPTH 32
/// Lets you get a stacktrace
class StackTrace
{
public:
/// The stacktrace is captured when the object is created
StackTrace();
/// Print to string
std::string toString() const;
private:
using Frame = void*;
Frame frames[STACK_TRACE_MAX_DEPTH];
size_t frames_size;
};