Revision 14715
Added by Aaron Marcuse-Kubitza over 10 years ago
trunk/lib/sh/util.sh | ||
---|---|---|
310 | 310 |
echo "$func() $(plain "@$caller -> $func_loc")" |
311 | 311 |
} |
312 | 312 |
|
313 |
stack_trace() # usage: "$([i=#] stack_trace)" # or use print_stack_trace |
|
314 |
{ |
|
315 |
skip_stack_frame; init_i |
|
316 |
while get_stack_frame; do |
|
317 |
format_stack_frame |
|
318 |
next_stack_frame |
|
319 |
done |
|
320 |
} |
|
313 | 321 |
|
322 |
print_stack_trace() { skip_stack_frame; stack_trace >&2; } |
|
323 |
# *note*: don't call from logging functions b/c will cause infinite recursion |
|
324 |
|
|
325 |
|
|
314 | 326 |
#### debugging |
315 | 327 |
|
316 | 328 |
debug_fd="$err_fd" |
Also available in: Unified diff
lib/sh/util.sh: added stack_trace(), print_stack_trace()