line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#pragma once |
2
|
|
|
|
|
|
|
#include |
3
|
|
|
|
|
|
|
#include |
4
|
|
|
|
|
|
|
#include "string.h" |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
namespace panda { |
7
|
|
|
|
|
|
|
|
8
|
0
|
|
|
|
|
|
struct backtrace { |
9
|
|
|
|
|
|
|
static const constexpr int max_depth = 50; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
backtrace () noexcept; |
12
|
|
|
|
|
|
|
backtrace (const backtrace &other) noexcept; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
string get_trace_string () const; |
15
|
|
|
|
|
|
|
const std::vector& get_trace () const noexcept { return buffer; } |
16
|
|
|
|
|
|
|
|
17
|
0
|
0
|
|
|
|
|
virtual ~backtrace () {} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
private: |
20
|
|
|
|
|
|
|
std::vector buffer; |
21
|
|
|
|
|
|
|
}; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
template |
24
|
|
|
|
|
|
|
struct bt : T, backtrace { |
25
|
|
|
|
|
|
|
template |
26
|
|
|
|
|
|
|
bt (Args&&... args) noexcept : T(std::forward(args...)) {} |
27
|
|
|
|
|
|
|
}; |
28
|
|
|
|
|
|
|
|
29
|
0
|
0
|
|
|
|
|
struct exception : std::exception, backtrace { |
30
|
|
|
|
|
|
|
exception () noexcept; |
31
|
|
|
|
|
|
|
exception (const string& whats) noexcept; |
32
|
|
|
|
|
|
|
exception (const exception& oth) noexcept; |
33
|
|
|
|
|
|
|
exception& operator= (const exception& oth) noexcept; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
const char* what () const noexcept override; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
virtual string whats () const noexcept; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
private: |
40
|
|
|
|
|
|
|
mutable string _whats; |
41
|
|
|
|
|
|
|
}; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
} |