]> git.tdb.fi Git - libs/core.git/blob - source/debug/backtrace.h
Add move semantics to Variant
[libs/core.git] / source / debug / backtrace.h
1 #ifndef MSP_DEBUG_BACKTRACE_H_
2 #define MSP_DEBUG_BACKTRACE_H_
3
4 #include <ostream>
5 #include <string>
6 #include <vector>
7 #include <msp/core/mspcore_api.h>
8
9 namespace Msp {
10 namespace Debug {
11
12 class MSPCORE_API Backtrace
13 {
14 public:
15         struct StackFrame
16         {
17                 void *address = nullptr;
18                 std::string file;
19                 std::string symbol;
20         };
21
22 private:
23         std::vector<StackFrame> frames;
24
25 public:
26         const std::vector<StackFrame> &get_frames() const { return frames; }
27
28         static Backtrace create();
29 };
30
31 MSPCORE_API std::ostream &operator<<(std::ostream &, const Backtrace &);
32 MSPCORE_API std::ostream &operator<<(std::ostream &, const Backtrace::StackFrame &);
33
34 } // namespace Debug
35 } // namespace Msp
36
37 #endif