patch 7.4.1102
Problem:    Debugger has no stack backtrace support.
Solution:   Add "backtrace", "frame", "up" and "down" commands. (Alberto
            Fanjul, closes #433)
diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak
index 6af9b84..33fc345 100644
--- a/src/testdir/Make_all.mak
+++ b/src/testdir/Make_all.mak
@@ -89,6 +89,7 @@
 	test105.out \
 	test106.out \
 	test107.out \
+	test108.out \
 	test_argument_0count.out \
 	test_argument_count.out \
 	test_autocmd_option.out \
diff --git a/src/testdir/test108.in b/src/testdir/test108.in
new file mode 100644
index 0000000..b442cf7
--- /dev/null
+++ b/src/testdir/test108.in
@@ -0,0 +1,87 @@
+Tests for backtrace debug commands.     vim: set ft=vim :
+
+STARTTEST
+:so small.vim
+:function! Foo()
+:   let var1 = 1
+:   let var2 = Bar(var1) + 9
+:   return var2
+:endfunction
+:
+:function! Bar(var)
+:    let var1 = 2 + a:var
+:    let var2 = Bazz(var1) + 4
+:    return var2
+:endfunction
+:
+:function! Bazz(var)
+:    let var1 = 3 + a:var
+:    let var3 = "another var"
+:    return var1
+:endfunction
+:new
+:debuggreedy
+:redir => out
+:debug echo Foo()
+step
+step
+step
+step
+step
+step
+echo "- show backtrace:\n"
+backtrace
+echo "\nshow variables on different levels:\n"
+echo var1
+up
+back
+echo var1
+u
+bt
+echo var1
+echo "\n- undefined vars:\n"
+step
+frame 2
+echo "undefined var3 on former level:"
+echo var3
+fr 0
+echo "here var3 is defined with \"another var\":"
+echo var3
+step
+step
+step
+up
+echo "\nundefined var2 on former level"
+echo var2
+down
+echo "here var2 is defined with 10:"
+echo var2
+echo "\n- backtrace movements:\n"
+b
+echo "\nnext command cannot go down, we are on bottom\n"
+down
+up
+echo "\nnext command cannot go up, we are on top\n"
+up
+b
+echo "fil is not frame or finish, it is file"
+fil
+echo "\n- relative backtrace movement\n"
+fr -1
+frame
+fra +1
+fram
+echo "\n- go beyond limits does not crash\n"
+fr 100
+fra
+frame -40
+fram
+echo "\n- final result 19:"
+cont
+:0debuggreedy
+:redir END
+:$put =out
+:w! test.out
+:qa!
+ENDTEST
+
diff --git a/src/testdir/test108.ok b/src/testdir/test108.ok
new file mode 100644
index 0000000..6315edc
--- /dev/null
+++ b/src/testdir/test108.ok
@@ -0,0 +1,84 @@
+
+
+
+- show backtrace:
+
+  2 function Foo[2]
+  1 Bar[2]
+->0 Bazz
+line 2: let var3 = "another var"
+
+show variables on different levels:
+
+6
+  2 function Foo[2]
+->1 Bar[2]
+  0 Bazz
+line 2: let var3 = "another var"
+3
+->2 function Foo[2]
+  1 Bar[2]
+  0 Bazz
+line 2: let var3 = "another var"
+1
+
+- undefined vars:
+
+undefined var3 on former level:
+Error detected while processing function Foo[2]..Bar[2]..Bazz:
+line    3:
+E121: Undefined variable: var3
+E15: Invalid expression: var3
+here var3 is defined with "another var":
+another var
+
+undefined var2 on former level
+Error detected while processing function Foo[2]..Bar:
+line    3:
+E121: Undefined variable: var2
+E15: Invalid expression: var2
+here var2 is defined with 10:
+10
+
+- backtrace movements:
+
+  1 function Foo[2]
+->0 Bar
+line 3: End of function
+
+next command cannot go down, we are on bottom
+
+frame is zero
+
+next command cannot go up, we are on top
+
+frame at highest level: 1
+->1 function Foo[2]
+  0 Bar
+line 3: End of function
+fil is not frame or finish, it is file
+"[No Name]" --No lines in buffer--
+
+- relative backtrace movement
+
+  1 function Foo[2]
+->0 Bar
+line 3: End of function
+->1 function Foo[2]
+  0 Bar
+line 3: End of function
+
+- go beyond limits does not crash
+
+frame at highest level: 1
+->1 function Foo[2]
+  0 Bar
+line 3: End of function
+frame is zero
+  1 function Foo[2]
+->0 Bar
+line 3: End of function
+
+- final result 19:
+19
+