Project

General

Profile

« Previous | Next » 

Revision 14714

lib/sh/util.sh: added format_stack_frame()

View differences:

trunk/lib/sh/util.sh
301 301
alias get_stack_frame='declare func file line && "get_stack_frame"'
302 302
	# && instead of ; so it can be used as a while cond
303 303

  
304
format_stack_frame() # usage: "$(func=__ file=__ line=__ format_stack_frame)"
305
{
306
	file="$(canon_rel_path "$file")" || return
307
	local caller="$file:$line"
308
	local func_loc; func_loc="$(func_loc "$func")" || return
309
	func_loc="${func_loc#$file:}" # include just line # if file same
310
	echo "$func()    $(plain "@$caller -> $func_loc")"
311
}
304 312

  
313

  
305 314
#### debugging
306 315

  
307 316
debug_fd="$err_fd"

Also available in: Unified diff