9 #ifndef CPPCOMMON_SYSTEM_STACK_TRACE_H
10 #define CPPCOMMON_SYSTEM_STACK_TRACE_H
22 #define __STACK__ CppCommon::StackTrace()
46 { std::stringstream ss; ss << *
this;
return ss.str(); }
66 const std::vector<
Frame>&
frames() const noexcept {
return _frames; }
70 { std::stringstream ss; ss << *
this;
return ss.str(); }
76 std::vector<Frame> _frames;
Stack trace snapshot provider.
std::string string() const
Get string from the current stack trace snapshot.
friend std::ostream & operator<<(std::ostream &os, const StackTrace &stack_trace)
Output stack trace into the given output stream.
StackTrace(StackTrace &&) noexcept=default
StackTrace(int skip=0)
Capture the current stack trace snapshot.
const std::vector< Frame > & frames() const noexcept
Get stack trace frames.
StackTrace(const StackTrace &)=default
C++ Common project definitions.
Stack trace snapshot provider inline implementation.
friend std::ostream & operator<<(std::ostream &os, const Frame &frame)
Output stack trace frame into the given output stream.
std::string filename
Frame file name.
int line
Frame line number.
std::string string() const
Get string from the current stack trace frame.
std::string module
Frame module.
void * address
Frame address.