| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
#ifdef __cplusplus |
|
2
|
|
|
|
|
|
|
extern "C" { |
|
3
|
|
|
|
|
|
|
#endif |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
#include "ulib/util.h" |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
#ifdef __cplusplus |
|
8
|
|
|
|
|
|
|
} |
|
9
|
|
|
|
|
|
|
#endif |
|
10
|
|
|
|
|
|
|
|
|
11
|
2
|
|
|
|
|
|
static NV uu_time_v1(const struct_uu_t *in) { |
|
12
|
|
|
|
|
|
|
U64 sum; |
|
13
|
|
|
|
|
|
|
NV rv; |
|
14
|
|
|
|
|
|
|
|
|
15
|
2
|
|
|
|
|
|
sum = ((U64)in->v1.time_high_and_version & 0x0fff) << 48 |
|
16
|
2
|
|
|
|
|
|
| ((U64)in->v1.time_mid) << 32 |
|
17
|
2
|
|
|
|
|
|
| (U64)in->v1.time_low; |
|
18
|
2
|
|
|
|
|
|
sum -= 122192928000000000ULL; |
|
19
|
2
|
|
|
|
|
|
rv = (NV)sum / 10000000.0; |
|
20
|
|
|
|
|
|
|
|
|
21
|
2
|
|
|
|
|
|
return rv; |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
|
|
24
|
2
|
|
|
|
|
|
static NV uu_time_v4(const struct_uu_t *in) { |
|
25
|
2
|
|
|
|
|
|
return 0.0; |
|
26
|
|
|
|
|
|
|
} |
|
27
|
|
|
|
|
|
|
|
|
28
|
1
|
|
|
|
|
|
static NV uu_time_v6(const struct_uu_t *in) { |
|
29
|
|
|
|
|
|
|
U64 sum; |
|
30
|
|
|
|
|
|
|
NV rv; |
|
31
|
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
|
sum = ((U64)in->v6.time_high) << 28 |
|
33
|
1
|
|
|
|
|
|
| ((U64)in->v6.time_mid) << 12 |
|
34
|
1
|
|
|
|
|
|
| ((U64)in->v6.time_low_and_version & 0x0fff); |
|
35
|
1
|
|
|
|
|
|
sum -= 122192928000000000ULL; |
|
36
|
1
|
|
|
|
|
|
rv = (NV)sum / 10000000.0; |
|
37
|
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
|
return rv; |
|
39
|
|
|
|
|
|
|
} |
|
40
|
|
|
|
|
|
|
|
|
41
|
1
|
|
|
|
|
|
static NV uu_time_v7(const struct_uu_t *in) { |
|
42
|
|
|
|
|
|
|
U64 sum; |
|
43
|
|
|
|
|
|
|
NV rv; |
|
44
|
|
|
|
|
|
|
|
|
45
|
1
|
|
|
|
|
|
sum = ((U64)in->v7.time_high) << 16 |
|
46
|
1
|
|
|
|
|
|
| (U64)in->v7.time_low; |
|
47
|
1
|
|
|
|
|
|
rv = (NV)sum / 1000.0; |
|
48
|
|
|
|
|
|
|
|
|
49
|
1
|
|
|
|
|
|
return rv; |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
|
53
|
9
|
|
|
|
|
|
NV uu_time(const struct_uu_t *in) { |
|
54
|
|
|
|
|
|
|
int version; |
|
55
|
|
|
|
|
|
|
|
|
56
|
9
|
|
|
|
|
|
version = in->v1.time_high_and_version >> 12; |
|
57
|
|
|
|
|
|
|
|
|
58
|
9
|
|
|
|
|
|
switch(version) { |
|
59
|
2
|
|
|
|
|
|
case 1: return uu_time_v1(in); |
|
60
|
2
|
|
|
|
|
|
case 4: return uu_time_v4(in); |
|
61
|
1
|
|
|
|
|
|
case 6: return uu_time_v6(in); |
|
62
|
1
|
|
|
|
|
|
case 7: return uu_time_v7(in); |
|
63
|
|
|
|
|
|
|
} |
|
64
|
3
|
|
|
|
|
|
return 0; |
|
65
|
|
|
|
|
|
|
} |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
/* a.k.a. version */ |
|
68
|
661
|
|
|
|
|
|
UV uu_type(const struct_uu_t *in) { |
|
69
|
|
|
|
|
|
|
UV type; |
|
70
|
|
|
|
|
|
|
|
|
71
|
661
|
|
|
|
|
|
type = in->v1.time_high_and_version >> 12; |
|
72
|
|
|
|
|
|
|
|
|
73
|
661
|
50
|
|
|
|
|
if (type <= 8) |
|
74
|
661
|
|
|
|
|
|
return type; |
|
75
|
0
|
|
|
|
|
|
return 0; |
|
76
|
|
|
|
|
|
|
} |
|
77
|
|
|
|
|
|
|
|
|
78
|
714
|
|
|
|
|
|
UV uu_variant(const struct_uu_t *in) { |
|
79
|
|
|
|
|
|
|
U16 variant; |
|
80
|
|
|
|
|
|
|
|
|
81
|
714
|
|
|
|
|
|
variant = in->v1.clock_seq_and_variant; |
|
82
|
|
|
|
|
|
|
|
|
83
|
714
|
100
|
|
|
|
|
if ((variant & 0x8000) == 0) return 0; |
|
84
|
659
|
100
|
|
|
|
|
if ((variant & 0x4000) == 0) return 1; |
|
85
|
8
|
100
|
|
|
|
|
if ((variant & 0x2000) == 0) return 2; |
|
86
|
4
|
|
|
|
|
|
return 3; |
|
87
|
|
|
|
|
|
|
} |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
/****************************************************************************** |
|
90
|
|
|
|
|
|
|
* all for croak_caller before 5.13.4. |
|
91
|
|
|
|
|
|
|
*/ |
|
92
|
|
|
|
|
|
|
#define PERL_ARGS_ASSERT_DOPOPTOSUB_AT assert(cxstk) |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
#ifdef PERL_GLOBAL_STRUCT |
|
95
|
|
|
|
|
|
|
# define dVAR pVAR = (struct perl_vars*)PERL_GET_VARS() |
|
96
|
|
|
|
|
|
|
#else |
|
97
|
|
|
|
|
|
|
# define dVAR dNOOP |
|
98
|
|
|
|
|
|
|
#endif |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
#ifndef dopoptosub |
|
101
|
|
|
|
|
|
|
#define dopoptosub(plop) dopoptosub_at(cxstack, (plop)) |
|
102
|
|
|
|
|
|
|
#endif |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
#ifndef dopoptosub_at |
|
105
|
|
|
|
|
|
|
#if !defined(PERL_IMPLICIT_CONTEXT) |
|
106
|
|
|
|
|
|
|
# define dopoptosub_at my_dopoptosub_at |
|
107
|
|
|
|
|
|
|
#else |
|
108
|
|
|
|
|
|
|
# define dopoptosub_at(a,b) my_dopoptosub_at(aTHX_ a,b) |
|
109
|
|
|
|
|
|
|
#endif |
|
110
|
|
|
|
|
|
|
#endif |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
STATIC I32 |
|
113
|
2
|
|
|
|
|
|
my_dopoptosub_at(pTHX_ const PERL_CONTEXT *cxstk, I32 startingblock) |
|
114
|
|
|
|
|
|
|
{ |
|
115
|
|
|
|
|
|
|
dVAR; |
|
116
|
|
|
|
|
|
|
I32 i; |
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
PERL_ARGS_ASSERT_DOPOPTOSUB_AT; |
|
119
|
|
|
|
|
|
|
|
|
120
|
5
|
50
|
|
|
|
|
for (i = startingblock; i >= 0; i--) { |
|
121
|
5
|
|
|
|
|
|
register const PERL_CONTEXT * const cx = &cxstk[i]; |
|
122
|
5
|
100
|
|
|
|
|
switch (CxTYPE(cx)) { |
|
123
|
3
|
|
|
|
|
|
default: |
|
124
|
3
|
|
|
|
|
|
continue; |
|
125
|
2
|
|
|
|
|
|
case CXt_EVAL: |
|
126
|
|
|
|
|
|
|
case CXt_SUB: |
|
127
|
|
|
|
|
|
|
case CXt_FORMAT: |
|
128
|
|
|
|
|
|
|
DEBUG_l( Perl_deb(aTHX_ "(dopoptosub_at(): found sub at cx=%ld)\n", (long)i)); |
|
129
|
2
|
|
|
|
|
|
return i; |
|
130
|
|
|
|
|
|
|
} |
|
131
|
|
|
|
|
|
|
} |
|
132
|
0
|
|
|
|
|
|
return i; |
|
133
|
|
|
|
|
|
|
} |
|
134
|
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
const PERL_CONTEXT * |
|
136
|
1
|
|
|
|
|
|
my_caller_cx(pTHX_ I32 count, const PERL_CONTEXT **dbcxp) |
|
137
|
|
|
|
|
|
|
{ |
|
138
|
1
|
|
|
|
|
|
register I32 cxix = dopoptosub(cxstack_ix); |
|
139
|
|
|
|
|
|
|
register const PERL_CONTEXT *cx; |
|
140
|
1
|
|
|
|
|
|
register const PERL_CONTEXT *ccstack = cxstack; |
|
141
|
1
|
|
|
|
|
|
const PERL_SI *top_si = PL_curstackinfo; |
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
for (;;) { |
|
144
|
|
|
|
|
|
|
/* we may be in a higher stacklevel, so dig down deeper */ |
|
145
|
1
|
50
|
|
|
|
|
while (cxix < 0 && top_si->si_type != PERLSI_MAIN) { |
|
|
|
0
|
|
|
|
|
|
|
146
|
0
|
|
|
|
|
|
top_si = top_si->si_prev; |
|
147
|
0
|
|
|
|
|
|
ccstack = top_si->si_cxstack; |
|
148
|
0
|
|
|
|
|
|
cxix = dopoptosub_at(ccstack, top_si->si_cxix); |
|
149
|
|
|
|
|
|
|
} |
|
150
|
1
|
50
|
|
|
|
|
if (cxix < 0) |
|
151
|
0
|
|
|
|
|
|
return NULL; |
|
152
|
|
|
|
|
|
|
/* caller() should not report the automatic calls to &DB::sub */ |
|
153
|
1
|
50
|
|
|
|
|
if (PL_DBsub && GvCV(PL_DBsub) && cxix >= 0 && |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
154
|
0
|
0
|
|
|
|
|
ccstack[cxix].blk_sub.cv == GvCV(PL_DBsub)) |
|
155
|
0
|
|
|
|
|
|
count++; |
|
156
|
1
|
50
|
|
|
|
|
if (!count--) |
|
157
|
1
|
|
|
|
|
|
break; |
|
158
|
0
|
|
|
|
|
|
cxix = dopoptosub_at(ccstack, cxix - 1); |
|
159
|
|
|
|
|
|
|
} |
|
160
|
|
|
|
|
|
|
|
|
161
|
1
|
|
|
|
|
|
cx = &ccstack[cxix]; |
|
162
|
1
|
50
|
|
|
|
|
if (dbcxp) *dbcxp = cx; |
|
163
|
|
|
|
|
|
|
|
|
164
|
1
|
50
|
|
|
|
|
if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) { |
|
|
|
0
|
|
|
|
|
|
|
165
|
1
|
|
|
|
|
|
const I32 dbcxix = dopoptosub_at(ccstack, cxix - 1); |
|
166
|
|
|
|
|
|
|
/* We expect that ccstack[dbcxix] is CXt_SUB, anyway, the |
|
167
|
|
|
|
|
|
|
field below is defined for any cx. */ |
|
168
|
|
|
|
|
|
|
/* caller() should not report the automatic calls to &DB::sub */ |
|
169
|
1
|
50
|
|
|
|
|
if (PL_DBsub && GvCV(PL_DBsub) && dbcxix >= 0 && ccstack[dbcxix].blk_sub.cv == GvCV(PL_DBsub)) |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
170
|
0
|
|
|
|
|
|
cx = &ccstack[dbcxix]; |
|
171
|
|
|
|
|
|
|
} |
|
172
|
|
|
|
|
|
|
|
|
173
|
1
|
|
|
|
|
|
return cx; |
|
174
|
|
|
|
|
|
|
} |
|
175
|
|
|
|
|
|
|
|
|
176
|
1
|
|
|
|
|
|
void my_croak_caller(const char *pat, ...) { |
|
177
|
|
|
|
|
|
|
dTHX; |
|
178
|
|
|
|
|
|
|
va_list args; |
|
179
|
1
|
|
|
|
|
|
const PERL_CONTEXT *cx = my_caller_cx(aTHX_ 0, NULL); |
|
180
|
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
/* make error appear at call site */ |
|
182
|
|
|
|
|
|
|
assert(cx); |
|
183
|
1
|
|
|
|
|
|
PL_curcop = cx->blk_oldcop; |
|
184
|
|
|
|
|
|
|
|
|
185
|
1
|
|
|
|
|
|
va_start(args, pat); |
|
186
|
1
|
|
|
|
|
|
vcroak(pat, &args); |
|
187
|
|
|
|
|
|
|
NOT_REACHED; /* NOTREACHED */ |
|
188
|
|
|
|
|
|
|
va_end(args); |
|
189
|
|
|
|
|
|
|
} |
|
190
|
|
|
|
|
|
|
/******************************************************************************/ |
|
191
|
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
/* ex:set ts=2 sw=2 itab=spaces: */ |