summaryrefslogtreecommitdiffstats
path: root/tests/dbg-support.right
blob: c4a1609e3f4ffbfce4c5a2a9a6d2f76e7dfd3bef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
debug lineno: 63 main
debug lineno: 66 main
FUNCNAME main
debug lineno: 70 main
debug lineno: 17 fn1
debug lineno: 18 fn1
LINENO 18
debug lineno: 19 fn1
LINENO 19
debug lineno: 20 fn1
BASH_SOURCE[0] ./dbg-support.tests
debug lineno: 21 fn1
FUNCNAME[0] fn1
debug lineno: 22 fn1
debug lineno: 22 fn1 70 ./dbg-support.tests
debug lineno: 23 fn1
debug lineno: 23 fn1 70 main ./dbg-support.tests
debug lineno: 24 fn1
debug lineno: 24 fn1
debug lineno: 25 fn1
./dbg-support.tests: line 25: caller: foo: invalid number
caller: usage: caller [expr]
debug lineno: 25 fn1
debug lineno: 17 fn1
debug lineno: 12 print_return_trap
debug lineno: 13 print_return_trap
return lineno: 17 fn1
debug lineno: 14 print_return_trap
debug lineno: 71 main
debug lineno: 28 fn2
debug lineno: 29 fn2
fn2 here. Calling fn1...
debug lineno: 30 fn2
debug lineno: 17 fn1
debug lineno: 18 fn1
LINENO 18
debug lineno: 19 fn1
LINENO 19
debug lineno: 20 fn1
BASH_SOURCE[0] ./dbg-support.tests
debug lineno: 21 fn1
FUNCNAME[0] fn1
debug lineno: 22 fn1
debug lineno: 22 fn1 30 ./dbg-support.tests
debug lineno: 23 fn1
debug lineno: 23 fn1 30 fn2 ./dbg-support.tests
debug lineno: 24 fn1
debug lineno: 24 fn1 71 main ./dbg-support.tests
debug lineno: 25 fn1
./dbg-support.tests: line 25: caller: foo: invalid number
caller: usage: caller [expr]
debug lineno: 25 fn1
debug lineno: 17 fn1
debug lineno: 12 print_return_trap
debug lineno: 13 print_return_trap
return lineno: 17 fn1
debug lineno: 14 print_return_trap
debug lineno: 28 fn2
debug lineno: 12 print_return_trap
debug lineno: 13 print_return_trap
return lineno: 28 fn2
debug lineno: 14 print_return_trap
debug lineno: 72 main
debug lineno: 33 fn3
debug lineno: 34 fn3
LINENO 34
debug lineno: 35 fn3
BASH_SOURCE[0] ./dbg-support.tests
debug lineno: 38 fn3
debug lineno: 39 fn3
debug lineno: 40 fn3
debug lineno: 40 fn3
debug lineno: 41 fn3
debug lineno: 42 fn3
debug lineno: 43 fn3
fn3 called from file  `./dbg-support.tests' at line 0
debug lineno: 40 fn3
debug lineno: 40 fn3
debug lineno: 41 fn3
debug lineno: 42 fn3
debug lineno: 42 fn3
debug lineno: 43 fn3
main called from file  `./dbg-support.tests' at line 0
debug lineno: 40 fn3
debug lineno: 40 fn3
debug lineno: 46 fn3
debug lineno: 18 source
SOURCED LINENO 18
debug lineno: 19 source
SOURCED BASH_SOURCE[0] ./dbg-support.sub
debug lineno: 20 source
debug lineno: 3 sourced_fn
debug lineno: 4 sourced_fn
debug lineno: 5 sourced_fn
SOURCED FN LINENO 5
debug lineno: 8 sourced_fn
debug lineno: 9 sourced_fn
debug lineno: 10 sourced_fn
debug lineno: 10 sourced_fn
debug lineno: 11 sourced_fn
debug lineno: 12 sourced_fn
debug lineno: 13 sourced_fn
FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 20
debug lineno: 10 sourced_fn
debug lineno: 10 sourced_fn
debug lineno: 11 sourced_fn
debug lineno: 12 sourced_fn
debug lineno: 13 sourced_fn
FUNCNAME[1]: source called from ./dbg-support.tests at line 46
debug lineno: 10 sourced_fn
debug lineno: 10 sourced_fn
debug lineno: 11 sourced_fn
debug lineno: 12 sourced_fn
debug lineno: 13 sourced_fn
FUNCNAME[2]: fn3 called from ./dbg-support.tests at line 72
debug lineno: 10 sourced_fn
debug lineno: 10 sourced_fn
debug lineno: 11 sourced_fn
debug lineno: 12 sourced_fn
debug lineno: 12 sourced_fn
debug lineno: 13 sourced_fn
FUNCNAME[3]: main called from ./dbg-support.tests at line 0
debug lineno: 10 sourced_fn
debug lineno: 10 sourced_fn
debug lineno: 3 sourced_fn
debug lineno: 12 print_return_trap
debug lineno: 13 print_return_trap
return lineno: 3 sourced_fn
debug lineno: 14 print_return_trap
debug lineno: 46 fn3
debug lineno: 12 print_return_trap
debug lineno: 13 print_return_trap
return lineno: 46 fn3
debug lineno: 14 print_return_trap
debug lineno: 33 fn3
debug lineno: 12 print_return_trap
debug lineno: 13 print_return_trap
return lineno: 33 fn3
debug lineno: 14 print_return_trap
debug lineno: 73 main
debug lineno: 18 source
SOURCED LINENO 18
debug lineno: 19 source
SOURCED BASH_SOURCE[0] ./dbg-support.sub
debug lineno: 20 source
debug lineno: 3 sourced_fn
debug lineno: 4 sourced_fn
debug lineno: 5 sourced_fn
SOURCED FN LINENO 5
debug lineno: 8 sourced_fn
debug lineno: 9 sourced_fn
debug lineno: 10 sourced_fn
debug lineno: 10 sourced_fn
debug lineno: 11 sourced_fn
debug lineno: 12 sourced_fn
debug lineno: 13 sourced_fn
FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 20
debug lineno: 10 sourced_fn
debug lineno: 10 sourced_fn
debug lineno: 11 sourced_fn
debug lineno: 12 sourced_fn
debug lineno: 13 sourced_fn
FUNCNAME[1]: source called from ./dbg-support.tests at line 73
debug lineno: 10 sourced_fn
debug lineno: 10 sourced_fn
debug lineno: 11 sourced_fn
debug lineno: 12 sourced_fn
debug lineno: 12 sourced_fn
debug lineno: 13 sourced_fn
FUNCNAME[2]: main called from ./dbg-support.tests at line 0
debug lineno: 10 sourced_fn
debug lineno: 10 sourced_fn
debug lineno: 3 sourced_fn
debug lineno: 12 print_return_trap
debug lineno: 13 print_return_trap
return lineno: 3 sourced_fn
debug lineno: 14 print_return_trap
debug lineno: 73 main
debug lineno: 12 print_return_trap
debug lineno: 13 print_return_trap
return lineno: 73 main
debug lineno: 14 print_return_trap
debug lineno: 76 main
debug lineno: 79 main
LINENO 18
LINENO 19
BASH_SOURCE[0] ./dbg-support.tests
FUNCNAME[0] fn1
79 ./dbg-support.tests
79 main ./dbg-support.tests

./dbg-support.tests: line 25: caller: foo: invalid number
caller: usage: caller [expr]

debug lineno: 80 main
fn2 here. Calling fn1...
LINENO 18
LINENO 19
BASH_SOURCE[0] ./dbg-support.tests
FUNCNAME[0] fn1
30 ./dbg-support.tests
30 fn2 ./dbg-support.tests
80 main ./dbg-support.tests
./dbg-support.tests: line 25: caller: foo: invalid number
caller: usage: caller [expr]

debug lineno: 81 main
LINENO 34
BASH_SOURCE[0] ./dbg-support.tests
fn3 called from file  `./dbg-support.tests' at line 0
main called from file  `./dbg-support.tests' at line 0
SOURCED LINENO 18
SOURCED BASH_SOURCE[0] ./dbg-support.sub
SOURCED FN LINENO 5
FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 20
FUNCNAME[1]: source called from ./dbg-support.tests at line 46
FUNCNAME[2]: fn3 called from ./dbg-support.tests at line 81
FUNCNAME[3]: main called from ./dbg-support.tests at line 0
debug lineno: 82 main
fn4 here. Calling fn3...
LINENO 34
BASH_SOURCE[0] ./dbg-support.tests
fn3 called from file  `./dbg-support.tests' at line 82
fn4 called from file  `./dbg-support.tests' at line 0
main called from file  `./dbg-support.tests' at line 0
SOURCED LINENO 18
SOURCED BASH_SOURCE[0] ./dbg-support.sub
SOURCED FN LINENO 5
FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 20
FUNCNAME[1]: source called from ./dbg-support.tests at line 46
FUNCNAME[2]: fn3 called from ./dbg-support.tests at line 51
FUNCNAME[3]: fn4 called from ./dbg-support.tests at line 82
FUNCNAME[4]: main called from ./dbg-support.tests at line 0
debug lineno: 83 main
SOURCED LINENO 18
SOURCED BASH_SOURCE[0] ./dbg-support.sub
SOURCED FN LINENO 5
FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 20
FUNCNAME[1]: source called from ./dbg-support.tests at line 83
FUNCNAME[2]: main called from ./dbg-support.tests at line 0
return lineno: 83 main
debug lineno: 86 main
debug lineno: 89 main
debug lineno: 18 source
SOURCED LINENO 18
debug lineno: 19 source
SOURCED BASH_SOURCE[0] ./dbg-support.sub
debug lineno: 20 source
debug lineno: 3 sourced_fn
debug lineno: 4 sourced_fn
debug lineno: 5 sourced_fn
SOURCED FN LINENO 5
debug lineno: 8 sourced_fn
debug lineno: 9 sourced_fn
debug lineno: 10 sourced_fn
debug lineno: 10 sourced_fn
debug lineno: 11 sourced_fn
debug lineno: 12 sourced_fn
debug lineno: 13 sourced_fn
FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 20
debug lineno: 10 sourced_fn
debug lineno: 10 sourced_fn
debug lineno: 11 sourced_fn
debug lineno: 12 sourced_fn
debug lineno: 13 sourced_fn
FUNCNAME[1]: source called from ./dbg-support.tests at line 89
debug lineno: 10 sourced_fn
debug lineno: 10 sourced_fn
debug lineno: 11 sourced_fn
debug lineno: 12 sourced_fn
debug lineno: 12 sourced_fn
debug lineno: 13 sourced_fn
FUNCNAME[2]: main called from ./dbg-support.tests at line 0
debug lineno: 10 sourced_fn
debug lineno: 10 sourced_fn
debug lineno: 3 sourced_fn
debug lineno: 12 print_return_trap
debug lineno: 13 print_return_trap
return lineno: 3 sourced_fn
debug lineno: 14 print_return_trap
debug lineno: 89 main
debug lineno: 12 print_return_trap
debug lineno: 13 print_return_trap
return lineno: 89 main
debug lineno: 14 print_return_trap
debug lineno: 90 main
debug lineno: 93 main
debug lineno: 93 main
debug lineno: 94 main
debug lineno: 97 main
debug lineno: 93 main
debug lineno: 93 main
debug lineno: 94 main
debug lineno: 97 main
debug lineno: 93 main
debug lineno: 93 main
debug lineno: 94 main
debug lineno: 95 main
Hit 2
debug lineno: 97 main
debug lineno: 93 main
debug lineno: 93 main
debug lineno: 103 main
SOURCED FN LINENO 5 FUNCNAME[0]: sourced_fn called from ./dbg-support.tests at line 103 FUNCNAME[1]: main called from ./dbg-support.tests at line 0
debug lineno: 104 main
SOURCED FN LINENO 5 FUNCNAME[0]: sourced_fn called from ./dbg-support.tests at line 104 FUNCNAME[1]: main called from ./dbg-support.tests at line 0
debug lineno: 105 main
debug lineno: 106 main
SOURCED FN LINENO 5
FUNCNAME[0]: sourced_fn called from ./dbg-support.tests at line 106
FUNCNAME[1]: main called from ./dbg-support.tests at line 0
debug lineno: 110 main
debug lineno: 111 main
debug lineno: 3 sourced_fn
debug lineno: 4 sourced_fn
debug lineno: 5 sourced_fn
SOURCED FN LINENO 5
debug lineno: 8 sourced_fn
debug lineno: 9 sourced_fn
debug lineno: 10 sourced_fn
debug lineno: 10 sourced_fn
debug lineno: 11 sourced_fn
debug lineno: 12 sourced_fn
debug lineno: 13 sourced_fn
FUNCNAME[0]: sourced_fn called from ./dbg-support.tests at line 111
debug lineno: 10 sourced_fn
debug lineno: 10 sourced_fn
debug lineno: 11 sourced_fn
debug lineno: 12 sourced_fn
debug lineno: 12 sourced_fn
debug lineno: 13 sourced_fn
FUNCNAME[1]: main called from ./dbg-support.tests at line 0
debug lineno: 10 sourced_fn
debug lineno: 10 sourced_fn
debug lineno: 3 sourced_fn
debug lineno: 12 print_return_trap
debug lineno: 13 print_return_trap
return lineno: 3 sourced_fn
debug lineno: 14 print_return_trap
debug lineno: 114 main
debug lineno: 119 main
debug lineno: 123 main
got it
debug lineno: 131 main
debug lineno: 132 main
debug lineno: 133 main
debug lineno: 132 main
debug lineno: 133 main
debug lineno: 131 main
debug lineno: 132 main
debug lineno: 133 main
debug lineno: 132 main
debug lineno: 133 main
debug lineno: 137 main
main: calling f1
f1: calling f2
f2: calling f3
f3: calling callstack
deep 6
0 z
1 3
2 y
3 2
4 x
5 1
FUNCNAME stack: f3 f2 f1 main
26 f2 ./dbg-support3.sub
f3: returning
f2: return from f3
f1: return from f2
main: f1 returns