line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#include "PerlTrace.h" |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
using panda::string; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
namespace xs { |
6
|
|
|
|
|
|
|
|
7
|
12
|
|
|
|
|
|
string PerlTrace::to_string() const noexcept { |
8
|
12
|
|
|
|
|
|
string r; |
9
|
80
|
100
|
|
|
|
|
for (const auto& frame : frames) { |
10
|
68
|
|
|
|
|
|
r += frame->library; |
11
|
68
|
|
|
|
|
|
r += "::"; |
12
|
68
|
|
|
|
|
|
r += frame->name; |
13
|
68
|
|
|
|
|
|
r += "("; |
14
|
68
|
|
|
|
|
|
auto& args = frame->args; |
15
|
68
|
|
|
|
|
|
auto last = args.size() - 1; |
16
|
180
|
100
|
|
|
|
|
for (size_t i = 0; i < args.size(); ++i) { |
17
|
112
|
|
|
|
|
|
r += args[i]; |
18
|
112
|
100
|
|
|
|
|
if (i < last) { r += ", "; } |
19
|
|
|
|
|
|
|
} |
20
|
68
|
|
|
|
|
|
r += ")"; |
21
|
68
|
|
|
|
|
|
r += " at "; |
22
|
68
|
|
|
|
|
|
r += frame->file; |
23
|
68
|
|
|
|
|
|
r += ":"; |
24
|
68
|
|
|
|
|
|
r += string::from_number(frame->line_no, 10); |
25
|
68
|
|
|
|
|
|
r += "\n"; |
26
|
|
|
|
|
|
|
} |
27
|
12
|
|
|
|
|
|
return r; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
} |