| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Devel::Chitin::Location; |
|
2
|
|
|
|
|
|
|
|
|
3
|
35
|
|
|
35
|
|
621
|
use strict; |
|
|
35
|
|
|
|
|
60
|
|
|
|
35
|
|
|
|
|
818
|
|
|
4
|
35
|
|
|
35
|
|
145
|
use warnings; |
|
|
35
|
|
|
|
|
52
|
|
|
|
35
|
|
|
|
|
1159
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.16'; |
|
7
|
|
|
|
|
|
|
|
|
8
|
35
|
|
|
35
|
|
147
|
use Carp; |
|
|
35
|
|
|
|
|
51
|
|
|
|
35
|
|
|
|
|
14672
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
|
11
|
394
|
|
|
394
|
0
|
365475
|
my $class = shift; |
|
12
|
394
|
|
|
|
|
3322
|
my %props = @_; |
|
13
|
|
|
|
|
|
|
|
|
14
|
394
|
|
|
|
|
1743
|
my @props = $class->_required_properties; |
|
15
|
394
|
|
|
|
|
1137
|
foreach my $prop ( @props ) { |
|
16
|
1576
|
50
|
|
|
|
3861
|
unless (exists $props{$prop}) { |
|
17
|
0
|
|
|
|
|
0
|
Carp::croak("$prop is a required property"); |
|
18
|
|
|
|
|
|
|
} |
|
19
|
|
|
|
|
|
|
} |
|
20
|
|
|
|
|
|
|
|
|
21
|
394
|
|
|
|
|
1118
|
my $self = bless \%props, $class; |
|
22
|
394
|
|
|
|
|
2116
|
return $self; |
|
23
|
|
|
|
|
|
|
} |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub _required_properties { |
|
26
|
497
|
|
|
497
|
|
2027
|
qw( package filename line subroutine ); |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub _optional_properties { |
|
30
|
103
|
|
|
103
|
|
233
|
qw( callsite ); |
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub at_end { |
|
34
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
|
35
|
0
|
|
0
|
|
|
0
|
return (($self->package eq 'Devel::Chitin::exiting') |
|
36
|
|
|
|
|
|
|
&& |
|
37
|
|
|
|
|
|
|
($self->subroutine eq 'Devel::Chitin::exiting::at_exit')); |
|
38
|
|
|
|
|
|
|
} |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub current { |
|
41
|
0
|
|
|
0
|
0
|
0
|
my $class = shift; |
|
42
|
0
|
|
|
|
|
0
|
my %props = @_; |
|
43
|
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
0
|
for (my $i = 0; ; $i++) { |
|
45
|
0
|
|
|
|
|
0
|
my @caller = caller($i); |
|
46
|
0
|
0
|
|
|
|
0
|
last unless @caller; |
|
47
|
0
|
0
|
|
|
|
0
|
if ($caller[3] eq 'DB::DB') { |
|
48
|
0
|
|
|
|
|
0
|
@props{'package','filename','line'} = @caller[0,1,2]; |
|
49
|
0
|
|
|
|
|
0
|
$props{subroutine} = (caller($i+1))[3]; |
|
50
|
0
|
|
|
|
|
0
|
$props{callsite} = get_callsite($i); |
|
51
|
0
|
|
|
|
|
0
|
last; |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
} |
|
54
|
0
|
|
|
|
|
0
|
return $class->new(%props); |
|
55
|
|
|
|
|
|
|
} |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub _make_accessors { |
|
58
|
69
|
|
|
69
|
|
177
|
my $package = shift; |
|
59
|
69
|
|
|
|
|
140
|
my @accessor_names; |
|
60
|
69
|
|
|
|
|
228
|
@accessor_names = ( $package->_required_properties, $package->_optional_properties ); |
|
61
|
69
|
100
|
|
|
|
227
|
if ($package ne __PACKAGE__) { |
|
62
|
|
|
|
|
|
|
# called as a class method by a subclass |
|
63
|
34
|
|
|
|
|
66
|
my %base_class_accessors = map { $_ => 1 } (_required_properties(), _optional_properties()); |
|
|
170
|
|
|
|
|
299
|
|
|
64
|
34
|
|
|
|
|
90
|
@accessor_names = grep { ! $base_class_accessors{$_} } @accessor_names; |
|
|
204
|
|
|
|
|
365
|
|
|
65
|
|
|
|
|
|
|
} |
|
66
|
|
|
|
|
|
|
|
|
67
|
69
|
|
|
|
|
155
|
foreach my $acc ( @accessor_names ) { |
|
68
|
209
|
|
|
1645
|
|
559
|
my $sub = sub { return shift->{$acc} }; |
|
|
1645
|
|
|
|
|
5890
|
|
|
69
|
209
|
|
|
|
|
396
|
my $subname = "${package}::${acc}"; |
|
70
|
35
|
|
|
35
|
|
229
|
no strict 'refs'; |
|
|
35
|
|
|
|
|
78
|
|
|
|
35
|
|
|
|
|
4747
|
|
|
71
|
209
|
|
|
|
|
252
|
*{$subname} = $sub; |
|
|
209
|
|
|
|
|
1755
|
|
|
72
|
|
|
|
|
|
|
} |
|
73
|
|
|
|
|
|
|
} |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub get_callsite { undef } |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
BEGIN { |
|
78
|
35
|
|
|
35
|
|
252
|
__PACKAGE__->_make_accessors(); |
|
79
|
|
|
|
|
|
|
|
|
80
|
35
|
|
|
|
|
48
|
local $@; |
|
81
|
35
|
50
|
|
|
|
75
|
my $site = eval { require Devel::Callsite && Devel::Callsite::callsite() }; |
|
|
35
|
|
|
|
|
13343
|
|
|
82
|
35
|
50
|
|
|
|
20463
|
if ($site) { |
|
83
|
35
|
|
|
|
|
68
|
my $get_callsite_name = join('::', __PACKAGE__, 'get_callsite'); |
|
84
|
35
|
|
|
35
|
|
202
|
no strict 'refs'; |
|
|
35
|
|
|
|
|
55
|
|
|
|
35
|
|
|
|
|
980
|
|
|
85
|
35
|
|
|
35
|
|
270
|
no warnings 'redefine'; |
|
|
35
|
|
|
|
|
70
|
|
|
|
35
|
|
|
|
|
1938
|
|
|
86
|
35
|
|
|
|
|
980
|
*$get_callsite_name = \&Devel::Callsite::callsite; |
|
87
|
|
|
|
|
|
|
} |
|
88
|
|
|
|
|
|
|
} |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
1; |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
__END__ |