tizen 2.3.1 release
[external/bash.git] / tests / dbg-support.sub
1 # This file is intended to be sourced from one of the bashdb test programs
2
3 sourced_fn() {
4     name="fn2"
5     echo "SOURCED FN LINENO $LINENO"
6
7     # Print a stack trace
8     declare -i n
9     n=${#FUNCNAME[@]}
10     for (( i=0 ; (( i < $n )) ; i++ )) ; do 
11         local -i j=i+1
12         [ $j -eq $n ] && j=i  # main()'s file is the same as the first caller
13         echo "FUNCNAME[$i]: ${FUNCNAME[$i]} called from ${BASH_SOURCE[$j]}" \
14              "at line ${BASH_LINENO[$i]}"
15     done
16 }
17
18 echo "SOURCED LINENO $LINENO"
19 echo "SOURCED BASH_SOURCE[0]" ${BASH_SOURCE[0]}
20 sourced_fn
21
22 #;;; Local Variables: ***
23 #;;; mode:shell-script ***
24 #;;; eval: (sh-set-shell "bash") ***
25 #;;; End: ***
26