aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/testdir/test_debugger.vim93
1 files changed, 93 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_debugger.vim b/src/nvim/testdir/test_debugger.vim
index b3c31eba5d..2361d96fca 100644
--- a/src/nvim/testdir/test_debugger.vim
+++ b/src/nvim/testdir/test_debugger.vim
@@ -593,6 +593,99 @@ func Test_Backtrace_Autocmd()
\ '->0 script ' .. getcwd() .. '/Xtest2.vim',
\ 'line 1: func DoAThing()'])
+ call RunDbgCmd( buf, 'up' )
+ call RunDbgCmd( buf, 'backtrace', [
+ \ '>backtrace',
+ \ ' 4 User Autocommands for "TestGlobalFunction"',
+ \ ' 3 function GlobalFunction[1]',
+ \ ' 2 CallAFunction[1]',
+ \ '->1 SourceAnotherFile[1]',
+ \ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
+ \ 'line 1: func DoAThing()' ] )
+
+ call RunDbgCmd( buf, 'up' )
+ call RunDbgCmd( buf, 'backtrace', [
+ \ '>backtrace',
+ \ ' 4 User Autocommands for "TestGlobalFunction"',
+ \ ' 3 function GlobalFunction[1]',
+ \ '->2 CallAFunction[1]',
+ \ ' 1 SourceAnotherFile[1]',
+ \ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
+ \ 'line 1: func DoAThing()' ] )
+
+ call RunDbgCmd( buf, 'up' )
+ call RunDbgCmd( buf, 'backtrace', [
+ \ '>backtrace',
+ \ ' 4 User Autocommands for "TestGlobalFunction"',
+ \ '->3 function GlobalFunction[1]',
+ \ ' 2 CallAFunction[1]',
+ \ ' 1 SourceAnotherFile[1]',
+ \ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
+ \ 'line 1: func DoAThing()' ] )
+
+ call RunDbgCmd( buf, 'up' )
+ call RunDbgCmd( buf, 'backtrace', [
+ \ '>backtrace',
+ \ '->4 User Autocommands for "TestGlobalFunction"',
+ \ ' 3 function GlobalFunction[1]',
+ \ ' 2 CallAFunction[1]',
+ \ ' 1 SourceAnotherFile[1]',
+ \ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
+ \ 'line 1: func DoAThing()' ] )
+
+ call RunDbgCmd( buf, 'up', [ 'frame at highest level: 4' ] )
+ call RunDbgCmd( buf, 'backtrace', [
+ \ '>backtrace',
+ \ '->4 User Autocommands for "TestGlobalFunction"',
+ \ ' 3 function GlobalFunction[1]',
+ \ ' 2 CallAFunction[1]',
+ \ ' 1 SourceAnotherFile[1]',
+ \ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
+ \ 'line 1: func DoAThing()' ] )
+
+ call RunDbgCmd( buf, 'down' )
+ call RunDbgCmd( buf, 'backtrace', [
+ \ '>backtrace',
+ \ ' 4 User Autocommands for "TestGlobalFunction"',
+ \ '->3 function GlobalFunction[1]',
+ \ ' 2 CallAFunction[1]',
+ \ ' 1 SourceAnotherFile[1]',
+ \ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
+ \ 'line 1: func DoAThing()' ] )
+
+
+ call RunDbgCmd( buf, 'down' )
+ call RunDbgCmd( buf, 'backtrace', [
+ \ '>backtrace',
+ \ ' 4 User Autocommands for "TestGlobalFunction"',
+ \ ' 3 function GlobalFunction[1]',
+ \ '->2 CallAFunction[1]',
+ \ ' 1 SourceAnotherFile[1]',
+ \ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
+ \ 'line 1: func DoAThing()' ] )
+
+ call RunDbgCmd( buf, 'down' )
+ call RunDbgCmd( buf, 'backtrace', [
+ \ '>backtrace',
+ \ ' 4 User Autocommands for "TestGlobalFunction"',
+ \ ' 3 function GlobalFunction[1]',
+ \ ' 2 CallAFunction[1]',
+ \ '->1 SourceAnotherFile[1]',
+ \ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
+ \ 'line 1: func DoAThing()' ] )
+
+ call RunDbgCmd( buf, 'down' )
+ call RunDbgCmd( buf, 'backtrace', [
+ \ '>backtrace',
+ \ ' 4 User Autocommands for "TestGlobalFunction"',
+ \ ' 3 function GlobalFunction[1]',
+ \ ' 2 CallAFunction[1]',
+ \ ' 1 SourceAnotherFile[1]',
+ \ '->0 script ' .. getcwd() .. '/Xtest2.vim',
+ \ 'line 1: func DoAThing()' ] )
+
+ call RunDbgCmd( buf, 'down', [ 'frame is zero' ] )
+
" step until we have another meaninfgul trace
call RunDbgCmd(buf, 'step', ['line 5: func File2Function()'])
call RunDbgCmd(buf, 'step', ['line 9: call File2Function()'])