line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Util::Trace; |
2
|
54
|
|
|
54
|
|
562
|
use strict; |
|
54
|
|
|
|
|
59
|
|
|
54
|
|
|
|
|
1140
|
|
3
|
54
|
|
|
54
|
|
139
|
use warnings; |
|
54
|
|
|
|
|
66
|
|
|
54
|
|
|
|
|
1696
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.000042'; |
6
|
|
|
|
|
|
|
|
7
|
54
|
|
|
54
|
|
197
|
use Test2::Util qw/get_tid/; |
|
54
|
|
|
|
|
60
|
|
|
54
|
|
|
|
|
1973
|
|
8
|
|
|
|
|
|
|
|
9
|
54
|
|
|
54
|
|
175
|
use Carp qw/confess/; |
|
54
|
|
|
|
|
63
|
|
|
54
|
|
|
|
|
2046
|
|
10
|
|
|
|
|
|
|
|
11
|
54
|
|
|
54
|
|
16341
|
use Test2::Util::HashBase qw{frame detail pid tid}; |
|
54
|
|
|
|
|
76
|
|
|
54
|
|
|
|
|
314
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub init { |
14
|
|
|
|
|
|
|
confess "The 'frame' attribute is required" |
15
|
135
|
100
|
|
135
|
0
|
444
|
unless $_[0]->{+FRAME}; |
16
|
|
|
|
|
|
|
|
17
|
134
|
100
|
|
|
|
419
|
$_[0]->{+PID} = $$ unless defined $_[0]->{+PID}; |
18
|
134
|
100
|
|
|
|
413
|
$_[0]->{+TID} = get_tid() unless defined $_[0]->{+TID}; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
172
|
|
|
172
|
0
|
132
|
sub snapshot { bless {%{$_[0]}}, __PACKAGE__ }; |
|
172
|
|
|
|
|
1201
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub debug { |
24
|
34
|
|
|
34
|
1
|
29
|
my $self = shift; |
25
|
34
|
100
|
|
|
|
56
|
return $self->{+DETAIL} if $self->{+DETAIL}; |
26
|
33
|
|
|
|
|
52
|
my ($pkg, $file, $line) = $self->call; |
27
|
33
|
|
|
|
|
125
|
return "at $file line $line"; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub alert { |
31
|
3
|
|
|
3
|
1
|
18
|
my $self = shift; |
32
|
3
|
|
|
|
|
4
|
my ($msg) = @_; |
33
|
3
|
|
|
|
|
11
|
warn $msg . ' ' . $self->debug . ".\n"; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub throw { |
37
|
5
|
|
|
5
|
1
|
11
|
my $self = shift; |
38
|
5
|
|
|
|
|
6
|
my ($msg) = @_; |
39
|
5
|
|
|
|
|
12
|
die $msg . ' ' . $self->debug . ".\n"; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
34
|
|
|
34
|
1
|
27
|
sub call { @{$_[0]->{+FRAME}} } |
|
34
|
|
|
|
|
76
|
|
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
1
|
1
|
3
|
sub package { $_[0]->{+FRAME}->[0] } |
45
|
1
|
|
|
1
|
1
|
4
|
sub file { $_[0]->{+FRAME}->[1] } |
46
|
1
|
|
|
1
|
1
|
2
|
sub line { $_[0]->{+FRAME}->[2] } |
47
|
1
|
|
|
1
|
1
|
3
|
sub subname { $_[0]->{+FRAME}->[3] } |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__END__ |