annotate src/testdir/test_debugger.vim @ 25763:5e7c96e9036d v8.2.3417

patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing Commit: https://github.com/vim/vim/commit/072f1c68884a1e2d468a0f39e27fc28168fb4b03 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Sep 8 20:40:34 2021 +0200 patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing Problem: Vim9: a failing debug expression aborts script sourcing. Solution: Do not let expression failure abort script sourcing. (closes https://github.com/vim/vim/issues/8848)
author Bram Moolenaar <Bram@vim.org>
date Wed, 08 Sep 2021 20:45:03 +0200
parents 154663508d9b
children dfa045d2cc89
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16350
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Tests for the Vim script debug commands
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 source shared.vim
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 source screendump.vim
17657
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
5 source check.vim
16350
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6
21687
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
7 CheckRunVimInTerminal
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
8
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
9 func CheckCWD()
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
10 " Check that the longer lines don't wrap due to the length of the script name
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
11 " in cwd
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
12 let script_len = len( getcwd() .. '/Xtest1.vim' )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
13 let longest_line = len( 'Breakpoint in "" line 1' )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
14 if script_len > ( 75 - longest_line )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
15 throw 'Skipped: Your CWD has too many characters'
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
16 endif
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
17 endfunc
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
18 command! -nargs=0 -bar CheckCWD call CheckCWD()
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
19
22969
dcb59b1cc0c1 patch 8.2.2031: some tests fail when run under valgrind
Bram Moolenaar <Bram@vim.org>
parents: 22486
diff changeset
20 " "options" argument can contain:
dcb59b1cc0c1 patch 8.2.2031: some tests fail when run under valgrind
Bram Moolenaar <Bram@vim.org>
parents: 22486
diff changeset
21 " 'msec' - time to wait for a match
dcb59b1cc0c1 patch 8.2.2031: some tests fail when run under valgrind
Bram Moolenaar <Bram@vim.org>
parents: 22486
diff changeset
22 " 'match' - "pattern" to use "lines" as pattern instead of text
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
23 func CheckDbgOutput(buf, lines, options = {})
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
24 " Verify the expected output
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
25 let lnum = 20 - len(a:lines)
22969
dcb59b1cc0c1 patch 8.2.2031: some tests fail when run under valgrind
Bram Moolenaar <Bram@vim.org>
parents: 22486
diff changeset
26 let msec = get(a:options, 'msec', 1000)
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
27 for l in a:lines
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
28 if get(a:options, 'match', 'equal') ==# 'pattern'
22969
dcb59b1cc0c1 patch 8.2.2031: some tests fail when run under valgrind
Bram Moolenaar <Bram@vim.org>
parents: 22486
diff changeset
29 call WaitForAssert({-> assert_match(l, term_getline(a:buf, lnum))}, msec)
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
30 else
22969
dcb59b1cc0c1 patch 8.2.2031: some tests fail when run under valgrind
Bram Moolenaar <Bram@vim.org>
parents: 22486
diff changeset
31 call WaitForAssert({-> assert_equal(l, term_getline(a:buf, lnum))}, msec)
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
32 endif
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
33 let lnum += 1
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
34 endfor
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
35 endfunc
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
36
16350
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 " Run a Vim debugger command
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38 " If the expected output argument is supplied, then check for it.
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 func RunDbgCmd(buf, cmd, ...)
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 call term_sendkeys(a:buf, a:cmd . "\r")
19954
c087099e9163 patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents: 19651
diff changeset
41 call TermWait(a:buf)
16350
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 if a:0 != 0
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
44 let options = #{match: 'equal'}
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
45 if a:0 > 1
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
46 call extend(options, a:2)
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
47 endif
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
48 call CheckDbgOutput(a:buf, a:1, options)
16350
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 endif
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 endfunc
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52 " Debugger tests
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 func Test_Debugger()
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54 " Create a Vim script with some functions
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
55 let lines =<< trim END
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
56 func Foo()
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
57 let var1 = 1
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
58 let var2 = Bar(var1) + 9
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
59 return var2
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
60 endfunc
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
61 func Bar(var)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
62 let var1 = 2 + a:var
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
63 let var2 = Bazz(var1) + 4
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
64 return var2
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
65 endfunc
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
66 func Bazz(var)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
67 try
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
68 let var1 = 3 + a:var
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
69 let var3 = "another var"
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
70 let var3 = "value2"
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
71 catch
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
72 let var4 = "exception"
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
73 endtry
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
74 return var1
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
75 endfunc
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
76 END
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
77 call writefile(lines, 'Xtest.vim')
16350
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
78
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
79 " Start Vim in a terminal
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
80 let buf = RunVimInTerminal('-S Xtest.vim', {})
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
81
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
82 " Start the Vim debugger
16920
8d91579414b8 patch 8.1.1461: tests do not run or are not reliable on some systems
Bram Moolenaar <Bram@vim.org>
parents: 16372
diff changeset
83 call RunDbgCmd(buf, ':debug echo Foo()', ['cmd: echo Foo()'])
16350
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
84
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
85 " Create a few stack frames by stepping through functions
16920
8d91579414b8 patch 8.1.1461: tests do not run or are not reliable on some systems
Bram Moolenaar <Bram@vim.org>
parents: 16372
diff changeset
86 call RunDbgCmd(buf, 'step', ['line 1: let var1 = 1'])
8d91579414b8 patch 8.1.1461: tests do not run or are not reliable on some systems
Bram Moolenaar <Bram@vim.org>
parents: 16372
diff changeset
87 call RunDbgCmd(buf, 'step', ['line 2: let var2 = Bar(var1) + 9'])
8d91579414b8 patch 8.1.1461: tests do not run or are not reliable on some systems
Bram Moolenaar <Bram@vim.org>
parents: 16372
diff changeset
88 call RunDbgCmd(buf, 'step', ['line 1: let var1 = 2 + a:var'])
8d91579414b8 patch 8.1.1461: tests do not run or are not reliable on some systems
Bram Moolenaar <Bram@vim.org>
parents: 16372
diff changeset
89 call RunDbgCmd(buf, 'step', ['line 2: let var2 = Bazz(var1) + 4'])
8d91579414b8 patch 8.1.1461: tests do not run or are not reliable on some systems
Bram Moolenaar <Bram@vim.org>
parents: 16372
diff changeset
90 call RunDbgCmd(buf, 'step', ['line 1: try'])
8d91579414b8 patch 8.1.1461: tests do not run or are not reliable on some systems
Bram Moolenaar <Bram@vim.org>
parents: 16372
diff changeset
91 call RunDbgCmd(buf, 'step', ['line 2: let var1 = 3 + a:var'])
8d91579414b8 patch 8.1.1461: tests do not run or are not reliable on some systems
Bram Moolenaar <Bram@vim.org>
parents: 16372
diff changeset
92 call RunDbgCmd(buf, 'step', ['line 3: let var3 = "another var"'])
16350
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
93
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
94 " check backtrace
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
95 call RunDbgCmd(buf, 'backtrace', [
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
96 \ ' 2 function Foo[2]',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
97 \ ' 1 Bar[2]',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
98 \ '->0 Bazz',
16372
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
99 \ 'line 3: let var3 = "another var"'])
16350
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
100
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
101 " Check variables in different stack frames
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
102 call RunDbgCmd(buf, 'echo var1', ['6'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
103
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
104 call RunDbgCmd(buf, 'up')
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
105 call RunDbgCmd(buf, 'back', [
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
106 \ ' 2 function Foo[2]',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
107 \ '->1 Bar[2]',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
108 \ ' 0 Bazz',
16372
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
109 \ 'line 3: let var3 = "another var"'])
16350
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
110 call RunDbgCmd(buf, 'echo var1', ['3'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
111
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
112 call RunDbgCmd(buf, 'u')
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
113 call RunDbgCmd(buf, 'bt', [
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
114 \ '->2 function Foo[2]',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
115 \ ' 1 Bar[2]',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
116 \ ' 0 Bazz',
16372
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
117 \ 'line 3: let var3 = "another var"'])
16350
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
118 call RunDbgCmd(buf, 'echo var1', ['1'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
119
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
120 " Undefined variables
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
121 call RunDbgCmd(buf, 'step')
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
122 call RunDbgCmd(buf, 'frame 2')
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
123 call RunDbgCmd(buf, 'echo var3', [
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
124 \ 'Error detected while processing function Foo[2]..Bar[2]..Bazz:',
16372
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
125 \ 'line 4:',
16350
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
126 \ 'E121: Undefined variable: var3'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
127
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
128 " var3 is defined in this level with some other value
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
129 call RunDbgCmd(buf, 'fr 0')
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
130 call RunDbgCmd(buf, 'echo var3', ['another var'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
131
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
132 call RunDbgCmd(buf, 'step')
16372
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
133 call RunDbgCmd(buf, '')
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
134 call RunDbgCmd(buf, '')
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
135 call RunDbgCmd(buf, '')
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
136 call RunDbgCmd(buf, '')
16350
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
137 call RunDbgCmd(buf, 'step', [
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
138 \ 'function Foo[2]..Bar',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
139 \ 'line 3: End of function'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
140 call RunDbgCmd(buf, 'up')
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
141
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
142 " Undefined var2
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
143 call RunDbgCmd(buf, 'echo var2', [
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
144 \ 'Error detected while processing function Foo[2]..Bar:',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
145 \ 'line 3:',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
146 \ 'E121: Undefined variable: var2'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
147
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
148 " Var2 is defined with 10
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
149 call RunDbgCmd(buf, 'down')
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
150 call RunDbgCmd(buf, 'echo var2', ['10'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
151
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
152 " Backtrace movements
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
153 call RunDbgCmd(buf, 'b', [
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
154 \ ' 1 function Foo[2]',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
155 \ '->0 Bar',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
156 \ 'line 3: End of function'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
157
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
158 " next command cannot go down, we are on bottom
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
159 call RunDbgCmd(buf, 'down', ['frame is zero'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
160 call RunDbgCmd(buf, 'up')
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
161
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
162 " next command cannot go up, we are on top
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
163 call RunDbgCmd(buf, 'up', ['frame at highest level: 1'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
164 call RunDbgCmd(buf, 'where', [
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
165 \ '->1 function Foo[2]',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
166 \ ' 0 Bar',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
167 \ 'line 3: End of function'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
168
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
169 " fil is not frame or finish, it is file
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
170 call RunDbgCmd(buf, 'fil', ['"[No Name]" --No lines in buffer--'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
171
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
172 " relative backtrace movement
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
173 call RunDbgCmd(buf, 'fr -1')
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
174 call RunDbgCmd(buf, 'frame', [
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
175 \ ' 1 function Foo[2]',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
176 \ '->0 Bar',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
177 \ 'line 3: End of function'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
178
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
179 call RunDbgCmd(buf, 'fr +1')
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
180 call RunDbgCmd(buf, 'fram', [
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
181 \ '->1 function Foo[2]',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
182 \ ' 0 Bar',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
183 \ 'line 3: End of function'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
184
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
185 " go beyond limits does not crash
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
186 call RunDbgCmd(buf, 'fr 100', ['frame at highest level: 1'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
187 call RunDbgCmd(buf, 'fra', [
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
188 \ '->1 function Foo[2]',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
189 \ ' 0 Bar',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
190 \ 'line 3: End of function'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
191
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
192 call RunDbgCmd(buf, 'frame -40', ['frame is zero'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
193 call RunDbgCmd(buf, 'fram', [
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
194 \ ' 1 function Foo[2]',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
195 \ '->0 Bar',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
196 \ 'line 3: End of function'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
197
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
198 " final result 19
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
199 call RunDbgCmd(buf, 'cont', ['19'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
200
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
201 " breakpoints tests
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
202
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
203 " Start a debug session, so that reading the last line from the terminal
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
204 " works properly.
22969
dcb59b1cc0c1 patch 8.2.2031: some tests fail when run under valgrind
Bram Moolenaar <Bram@vim.org>
parents: 22486
diff changeset
205 call RunDbgCmd(buf, ':debug echo Foo()', ['cmd: echo Foo()'])
16350
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
206
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
207 " No breakpoints
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
208 call RunDbgCmd(buf, 'breakl', ['No breakpoints defined'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
209
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
210 " Place some breakpoints
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
211 call RunDbgCmd(buf, 'breaka func Bar')
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
212 call RunDbgCmd(buf, 'breaklis', [' 1 func Bar line 1'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
213 call RunDbgCmd(buf, 'breakadd func 3 Bazz')
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
214 call RunDbgCmd(buf, 'breaklist', [' 1 func Bar line 1',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
215 \ ' 2 func Bazz line 3'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
216
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
217 " Check whether the breakpoints are hit
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
218 call RunDbgCmd(buf, 'cont', [
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
219 \ 'Breakpoint in "Bar" line 1',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
220 \ 'function Foo[2]..Bar',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
221 \ 'line 1: let var1 = 2 + a:var'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
222 call RunDbgCmd(buf, 'cont', [
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
223 \ 'Breakpoint in "Bazz" line 3',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
224 \ 'function Foo[2]..Bar[2]..Bazz',
16372
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
225 \ 'line 3: let var3 = "another var"'])
16350
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
226
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
227 " Delete the breakpoints
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
228 call RunDbgCmd(buf, 'breakd 1')
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
229 call RunDbgCmd(buf, 'breakli', [' 2 func Bazz line 3'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
230 call RunDbgCmd(buf, 'breakdel func 3 Bazz')
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
231 call RunDbgCmd(buf, 'breakl', ['No breakpoints defined'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
232
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
233 call RunDbgCmd(buf, 'cont')
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
234
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
235 " Make sure the breakpoints are removed
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
236 call RunDbgCmd(buf, ':echo Foo()', ['19'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
237
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
238 " Delete a non-existing breakpoint
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
239 call RunDbgCmd(buf, ':breakdel 2', ['E161: Breakpoint not found: 2'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
240
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
241 " Expression breakpoint
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
242 call RunDbgCmd(buf, ':breakadd func 2 Bazz')
16372
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
243 call RunDbgCmd(buf, ':echo Bazz(1)', [
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
244 \ 'Entering Debug mode. Type "cont" to continue.',
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
245 \ 'function Bazz',
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
246 \ 'line 2: let var1 = 3 + a:var'])
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
247 call RunDbgCmd(buf, 'step')
16350
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
248 call RunDbgCmd(buf, 'step')
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
249 call RunDbgCmd(buf, 'breaka expr var3')
16372
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
250 call RunDbgCmd(buf, 'breakl', [' 3 func Bazz line 2',
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
251 \ ' 4 expr var3'])
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
252 call RunDbgCmd(buf, 'cont', ['Breakpoint in "Bazz" line 5',
16350
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
253 \ 'Oldval = "''another var''"',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
254 \ 'Newval = "''value2''"',
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
255 \ 'function Bazz',
16372
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
256 \ 'line 5: catch'])
16350
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
257
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
258 call RunDbgCmd(buf, 'breakdel *')
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
259 call RunDbgCmd(buf, 'breakl', ['No breakpoints defined'])
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
260
16372
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
261 " Check for error cases
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
262 call RunDbgCmd(buf, 'breakadd abcd', [
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
263 \ 'Error detected while processing function Bazz:',
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
264 \ 'line 5:',
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
265 \ 'E475: Invalid argument: abcd'])
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
266 call RunDbgCmd(buf, 'breakadd func', ['E475: Invalid argument: func'])
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
267 call RunDbgCmd(buf, 'breakadd func 2', ['E475: Invalid argument: func 2'])
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
268 call RunDbgCmd(buf, 'breaka func a()', ['E475: Invalid argument: func a()'])
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
269 call RunDbgCmd(buf, 'breakd abcd', ['E475: Invalid argument: abcd'])
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
270 call RunDbgCmd(buf, 'breakd func', ['E475: Invalid argument: func'])
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
271 call RunDbgCmd(buf, 'breakd func a()', ['E475: Invalid argument: func a()'])
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
272 call RunDbgCmd(buf, 'breakd func a', ['E161: Breakpoint not found: func a'])
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
273 call RunDbgCmd(buf, 'breakd expr', ['E475: Invalid argument: expr'])
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
274 call RunDbgCmd(buf, 'breakd expr x', [
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
275 \ 'E121: Undefined variable: x',
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
276 \ 'E161: Breakpoint not found: expr x'])
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
277
16350
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
278 " finish the current function
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
279 call RunDbgCmd(buf, 'finish', [
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
280 \ 'function Bazz',
16372
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
281 \ 'line 8: End of function'])
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
282 call RunDbgCmd(buf, 'cont')
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
283
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
284 " Test for :next
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
285 call RunDbgCmd(buf, ':debug echo Bar(1)')
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
286 call RunDbgCmd(buf, 'step')
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
287 call RunDbgCmd(buf, 'next')
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
288 call RunDbgCmd(buf, '', [
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
289 \ 'function Bar',
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
290 \ 'line 3: return var2'])
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
291 call RunDbgCmd(buf, 'c')
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
292
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
293 " Test for :interrupt
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
294 call RunDbgCmd(buf, ':debug echo Bazz(1)')
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
295 call RunDbgCmd(buf, 'step')
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
296 call RunDbgCmd(buf, 'step')
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
297 call RunDbgCmd(buf, 'interrupt', [
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
298 \ 'Exception thrown: Vim:Interrupt',
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
299 \ 'function Bazz',
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
300 \ 'line 5: catch'])
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
301 call RunDbgCmd(buf, 'c')
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
302
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
303 " Test for :quit
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
304 call RunDbgCmd(buf, ':debug echo Foo()')
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
305 call RunDbgCmd(buf, 'breakdel *')
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
306 call RunDbgCmd(buf, 'breakadd func 3 Foo')
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
307 call RunDbgCmd(buf, 'breakadd func 3 Bazz')
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
308 call RunDbgCmd(buf, 'cont', [
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
309 \ 'Breakpoint in "Bazz" line 3',
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
310 \ 'function Foo[2]..Bar[2]..Bazz',
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
311 \ 'line 3: let var3 = "another var"'])
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
312 call RunDbgCmd(buf, 'quit', [
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
313 \ 'Breakpoint in "Foo" line 3',
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
314 \ 'function Foo',
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
315 \ 'line 3: return var2'])
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
316 call RunDbgCmd(buf, 'breakdel *')
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
317 call RunDbgCmd(buf, 'quit')
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
318 call RunDbgCmd(buf, 'enew! | only!')
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
319
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
320 call StopVimInTerminal(buf)
25763
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
321 endfunc
16372
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
322
25763
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
323 func Test_Debugger_breakadd()
16372
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
324 " Tests for :breakadd file and :breakadd here
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
325 " Breakpoints should be set before sourcing the file
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
326
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
327 let lines =<< trim END
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
328 let var1 = 10
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
329 let var2 = 20
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
330 let var3 = 30
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
331 let var4 = 40
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
332 END
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 16965
diff changeset
333 call writefile(lines, 'Xtest.vim')
16372
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
334
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
335 " Start Vim in a terminal
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
336 let buf = RunVimInTerminal('Xtest.vim', {})
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
337 call RunDbgCmd(buf, ':breakadd file 2 Xtest.vim')
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
338 call RunDbgCmd(buf, ':4 | breakadd here')
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
339 call RunDbgCmd(buf, ':source Xtest.vim', ['line 2: let var2 = 20'])
5900941b2e37 patch 8.1.1191: not all debug commands are covered by a test
Bram Moolenaar <Bram@vim.org>
parents: 16350
diff changeset
340 call RunDbgCmd(buf, 'cont', ['line 4: let var4 = 40'])
16350
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
341 call RunDbgCmd(buf, 'cont')
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
342
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
343 call StopVimInTerminal(buf)
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
344
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
345 call delete('Xtest.vim')
21781
99fe9e960207 patch 8.2.1440: debugger code insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21777
diff changeset
346 %bw!
25763
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
347
21781
99fe9e960207 patch 8.2.1440: debugger code insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21777
diff changeset
348 call assert_fails('breakadd here', 'E32:')
22375
595ea7f099cd patch 8.2.1736: failure to compile a pattern not tested much
Bram Moolenaar <Bram@vim.org>
parents: 21917
diff changeset
349 call assert_fails('breakadd file Xtest.vim /\)/', 'E55:')
16350
ffa791471a4c patch 8.1.1180: Vim script debugger tests are old style
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
350 endfunc
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
351
25763
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
352 def Test_Debugger_breakadd_expr()
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
353 var lines =<< trim END
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
354 vim9script
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
355 func g:EarlyFunc()
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
356 endfunc
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
357 breakadd expr DoesNotExist()
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
358 func g:LaterFunc()
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
359 endfunc
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
360 breakdel *
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
361 END
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
362 writefile(lines, 'Xtest.vim')
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
363
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
364 # Start Vim in a terminal
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
365 var buf = RunVimInTerminal('-S Xtest.vim', {wait_for_ruler: 0})
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
366 call TermWait(buf)
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
367
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
368 # Despite the failure the functions are defined
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
369 RunDbgCmd(buf, ':function g:EarlyFunc',
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
370 ['function EarlyFunc()', 'endfunction'], {match: 'pattern'})
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
371 RunDbgCmd(buf, ':function g:LaterFunc',
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
372 ['function LaterFunc()', 'endfunction'], {match: 'pattern'})
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
373
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
374 call StopVimInTerminal(buf)
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
375 call delete('Xtest.vim')
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
376 enddef
5e7c96e9036d patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
377
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
378 func Test_Backtrace_Through_Source()
21687
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
379 CheckCWD
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
380 let file1 =<< trim END
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
381 func SourceAnotherFile()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
382 source Xtest2.vim
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
383 endfunc
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
384
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
385 func CallAFunction()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
386 call SourceAnotherFile()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
387 call File2Function()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
388 endfunc
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
389
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
390 func GlobalFunction()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
391 call CallAFunction()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
392 endfunc
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
393 END
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
394 call writefile(file1, 'Xtest1.vim')
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
395
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
396 let file2 =<< trim END
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
397 func DoAThing()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
398 echo "DoAThing"
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
399 endfunc
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
400
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
401 func File2Function()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
402 call DoAThing()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
403 endfunc
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
404
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
405 call File2Function()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
406 END
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
407 call writefile(file2, 'Xtest2.vim')
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
408
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
409 let buf = RunVimInTerminal('-S Xtest1.vim', {})
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
410
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
411 call RunDbgCmd(buf,
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
412 \ ':debug call GlobalFunction()',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
413 \ ['cmd: call GlobalFunction()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
414 call RunDbgCmd(buf, 'step', ['line 1: call CallAFunction()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
415
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
416 call RunDbgCmd(buf, 'backtrace', ['>backtrace',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
417 \ '->0 function GlobalFunction',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
418 \ 'line 1: call CallAFunction()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
419
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
420 call RunDbgCmd(buf, 'step', ['line 1: call SourceAnotherFile()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
421 call RunDbgCmd(buf, 'step', ['line 1: source Xtest2.vim'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
422
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
423 call RunDbgCmd(buf, 'backtrace', ['>backtrace',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
424 \ ' 2 function GlobalFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
425 \ ' 1 CallAFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
426 \ '->0 SourceAnotherFile',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
427 \ 'line 1: source Xtest2.vim'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
428
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
429 " Step into the 'source' command. Note that we print the full trace all the
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
430 " way though the source command.
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
431 call RunDbgCmd(buf, 'step', ['line 1: func DoAThing()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
432 call RunDbgCmd(buf, 'backtrace', [
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
433 \ '>backtrace',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
434 \ ' 3 function GlobalFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
435 \ ' 2 CallAFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
436 \ ' 1 SourceAnotherFile[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
437 \ '->0 script ' .. getcwd() .. '/Xtest2.vim',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
438 \ 'line 1: func DoAThing()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
439
21687
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
440 call RunDbgCmd( buf, 'up' )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
441 call RunDbgCmd( buf, 'backtrace', [
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
442 \ '>backtrace',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
443 \ ' 3 function GlobalFunction[1]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
444 \ ' 2 CallAFunction[1]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
445 \ '->1 SourceAnotherFile[1]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
446 \ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
447 \ 'line 1: func DoAThing()' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
448
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
449 call RunDbgCmd( buf, 'up' )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
450 call RunDbgCmd( buf, 'backtrace', [
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
451 \ '>backtrace',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
452 \ ' 3 function GlobalFunction[1]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
453 \ '->2 CallAFunction[1]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
454 \ ' 1 SourceAnotherFile[1]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
455 \ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
456 \ 'line 1: func DoAThing()' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
457
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
458 call RunDbgCmd( buf, 'up' )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
459 call RunDbgCmd( buf, 'backtrace', [
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
460 \ '>backtrace',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
461 \ '->3 function GlobalFunction[1]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
462 \ ' 2 CallAFunction[1]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
463 \ ' 1 SourceAnotherFile[1]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
464 \ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
465 \ 'line 1: func DoAThing()' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
466
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
467 call RunDbgCmd( buf, 'up', [ 'frame at highest level: 3' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
468 call RunDbgCmd( buf, 'backtrace', [
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
469 \ '>backtrace',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
470 \ '->3 function GlobalFunction[1]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
471 \ ' 2 CallAFunction[1]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
472 \ ' 1 SourceAnotherFile[1]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
473 \ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
474 \ 'line 1: func DoAThing()' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
475
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
476 call RunDbgCmd( buf, 'down' )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
477 call RunDbgCmd( buf, 'backtrace', [
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
478 \ '>backtrace',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
479 \ ' 3 function GlobalFunction[1]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
480 \ '->2 CallAFunction[1]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
481 \ ' 1 SourceAnotherFile[1]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
482 \ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
483 \ 'line 1: func DoAThing()' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
484
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
485 call RunDbgCmd( buf, 'down' )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
486 call RunDbgCmd( buf, 'backtrace', [
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
487 \ '>backtrace',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
488 \ ' 3 function GlobalFunction[1]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
489 \ ' 2 CallAFunction[1]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
490 \ '->1 SourceAnotherFile[1]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
491 \ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
492 \ 'line 1: func DoAThing()' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
493
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
494 call RunDbgCmd( buf, 'down' )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
495 call RunDbgCmd( buf, 'backtrace', [
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
496 \ '>backtrace',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
497 \ ' 3 function GlobalFunction[1]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
498 \ ' 2 CallAFunction[1]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
499 \ ' 1 SourceAnotherFile[1]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
500 \ '->0 script ' .. getcwd() .. '/Xtest2.vim',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
501 \ 'line 1: func DoAThing()' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
502
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
503 call RunDbgCmd( buf, 'down', [ 'frame is zero' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
504
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
505 " step until we have another meaninfgul trace
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
506 call RunDbgCmd(buf, 'step', ['line 5: func File2Function()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
507 call RunDbgCmd(buf, 'step', ['line 9: call File2Function()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
508 call RunDbgCmd(buf, 'backtrace', [
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
509 \ '>backtrace',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
510 \ ' 3 function GlobalFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
511 \ ' 2 CallAFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
512 \ ' 1 SourceAnotherFile[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
513 \ '->0 script ' .. getcwd() .. '/Xtest2.vim',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
514 \ 'line 9: call File2Function()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
515
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
516 call RunDbgCmd(buf, 'step', ['line 1: call DoAThing()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
517 call RunDbgCmd(buf, 'step', ['line 1: echo "DoAThing"'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
518 call RunDbgCmd(buf, 'backtrace', [
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
519 \ '>backtrace',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
520 \ ' 5 function GlobalFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
521 \ ' 4 CallAFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
522 \ ' 3 SourceAnotherFile[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
523 \ ' 2 script ' .. getcwd() .. '/Xtest2.vim[9]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
524 \ ' 1 function File2Function[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
525 \ '->0 DoAThing',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
526 \ 'line 1: echo "DoAThing"'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
527
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
528 " Now, step (back to Xfile1.vim), and call the function _in_ Xfile2.vim
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
529 call RunDbgCmd(buf, 'step', ['line 1: End of function'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
530 call RunDbgCmd(buf, 'step', ['line 1: End of function'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
531 call RunDbgCmd(buf, 'step', ['line 10: End of sourced file'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
532 call RunDbgCmd(buf, 'step', ['line 1: End of function'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
533 call RunDbgCmd(buf, 'step', ['line 2: call File2Function()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
534 call RunDbgCmd(buf, 'backtrace', [
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
535 \ '>backtrace',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
536 \ ' 1 function GlobalFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
537 \ '->0 CallAFunction',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
538 \ 'line 2: call File2Function()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
539
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
540 call RunDbgCmd(buf, 'step', ['line 1: call DoAThing()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
541 call RunDbgCmd(buf, 'backtrace', [
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
542 \ '>backtrace',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
543 \ ' 2 function GlobalFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
544 \ ' 1 CallAFunction[2]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
545 \ '->0 File2Function',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
546 \ 'line 1: call DoAThing()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
547
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
548 call StopVimInTerminal(buf)
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
549 call delete('Xtest1.vim')
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
550 call delete('Xtest2.vim')
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
551 endfunc
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
552
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
553 func Test_Backtrace_Autocmd()
21687
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
554 CheckCWD
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
555 let file1 =<< trim END
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
556 func SourceAnotherFile()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
557 source Xtest2.vim
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
558 endfunc
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
559
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
560 func CallAFunction()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
561 call SourceAnotherFile()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
562 call File2Function()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
563 endfunc
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
564
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
565 func GlobalFunction()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
566 call CallAFunction()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
567 endfunc
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
568
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
569 au User TestGlobalFunction :call GlobalFunction() | echo "Done"
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
570 END
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
571 call writefile(file1, 'Xtest1.vim')
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
572
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
573 let file2 =<< trim END
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
574 func DoAThing()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
575 echo "DoAThing"
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
576 endfunc
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
577
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
578 func File2Function()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
579 call DoAThing()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
580 endfunc
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
581
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
582 call File2Function()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
583 END
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
584 call writefile(file2, 'Xtest2.vim')
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
585
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
586 let buf = RunVimInTerminal('-S Xtest1.vim', {})
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
587
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
588 call RunDbgCmd(buf,
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
589 \ ':debug doautocmd User TestGlobalFunction',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
590 \ ['cmd: doautocmd User TestGlobalFunction'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
591 call RunDbgCmd(buf, 'step', ['cmd: call GlobalFunction() | echo "Done"'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
592
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
593 " At this point the ontly thing in the stack is the autocommand
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
594 call RunDbgCmd(buf, 'backtrace', [
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
595 \ '>backtrace',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
596 \ '->0 User Autocommands for "TestGlobalFunction"',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
597 \ 'cmd: call GlobalFunction() | echo "Done"'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
598
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
599 " And now we're back into the call stack
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
600 call RunDbgCmd(buf, 'step', ['line 1: call CallAFunction()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
601 call RunDbgCmd(buf, 'backtrace', [
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
602 \ '>backtrace',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
603 \ ' 1 User Autocommands for "TestGlobalFunction"',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
604 \ '->0 function GlobalFunction',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
605 \ 'line 1: call CallAFunction()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
606
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
607 call RunDbgCmd(buf, 'step', ['line 1: call SourceAnotherFile()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
608 call RunDbgCmd(buf, 'step', ['line 1: source Xtest2.vim'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
609
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
610 call RunDbgCmd(buf, 'backtrace', [
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
611 \ '>backtrace',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
612 \ ' 3 User Autocommands for "TestGlobalFunction"',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
613 \ ' 2 function GlobalFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
614 \ ' 1 CallAFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
615 \ '->0 SourceAnotherFile',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
616 \ 'line 1: source Xtest2.vim'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
617
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
618 " Step into the 'source' command. Note that we print the full trace all the
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
619 " way though the source command.
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
620 call RunDbgCmd(buf, 'step', ['line 1: func DoAThing()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
621 call RunDbgCmd(buf, 'backtrace', [
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
622 \ '>backtrace',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
623 \ ' 4 User Autocommands for "TestGlobalFunction"',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
624 \ ' 3 function GlobalFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
625 \ ' 2 CallAFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
626 \ ' 1 SourceAnotherFile[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
627 \ '->0 script ' .. getcwd() .. '/Xtest2.vim',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
628 \ 'line 1: func DoAThing()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
629
21917
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
630 call RunDbgCmd( buf, 'up' )
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
631 call RunDbgCmd( buf, 'backtrace', [
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
632 \ '>backtrace',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
633 \ ' 4 User Autocommands for "TestGlobalFunction"',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
634 \ ' 3 function GlobalFunction[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
635 \ ' 2 CallAFunction[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
636 \ '->1 SourceAnotherFile[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
637 \ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
638 \ 'line 1: func DoAThing()' ] )
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
639
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
640 call RunDbgCmd( buf, 'up' )
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
641 call RunDbgCmd( buf, 'backtrace', [
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
642 \ '>backtrace',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
643 \ ' 4 User Autocommands for "TestGlobalFunction"',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
644 \ ' 3 function GlobalFunction[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
645 \ '->2 CallAFunction[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
646 \ ' 1 SourceAnotherFile[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
647 \ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
648 \ 'line 1: func DoAThing()' ] )
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
649
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
650 call RunDbgCmd( buf, 'up' )
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
651 call RunDbgCmd( buf, 'backtrace', [
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
652 \ '>backtrace',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
653 \ ' 4 User Autocommands for "TestGlobalFunction"',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
654 \ '->3 function GlobalFunction[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
655 \ ' 2 CallAFunction[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
656 \ ' 1 SourceAnotherFile[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
657 \ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
658 \ 'line 1: func DoAThing()' ] )
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
659
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
660 call RunDbgCmd( buf, 'up' )
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
661 call RunDbgCmd( buf, 'backtrace', [
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
662 \ '>backtrace',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
663 \ '->4 User Autocommands for "TestGlobalFunction"',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
664 \ ' 3 function GlobalFunction[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
665 \ ' 2 CallAFunction[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
666 \ ' 1 SourceAnotherFile[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
667 \ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
668 \ 'line 1: func DoAThing()' ] )
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
669
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
670 call RunDbgCmd( buf, 'up', [ 'frame at highest level: 4' ] )
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
671 call RunDbgCmd( buf, 'backtrace', [
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
672 \ '>backtrace',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
673 \ '->4 User Autocommands for "TestGlobalFunction"',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
674 \ ' 3 function GlobalFunction[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
675 \ ' 2 CallAFunction[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
676 \ ' 1 SourceAnotherFile[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
677 \ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
678 \ 'line 1: func DoAThing()' ] )
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
679
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
680 call RunDbgCmd( buf, 'down' )
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
681 call RunDbgCmd( buf, 'backtrace', [
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
682 \ '>backtrace',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
683 \ ' 4 User Autocommands for "TestGlobalFunction"',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
684 \ '->3 function GlobalFunction[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
685 \ ' 2 CallAFunction[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
686 \ ' 1 SourceAnotherFile[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
687 \ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
688 \ 'line 1: func DoAThing()' ] )
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
689
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
690
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
691 call RunDbgCmd( buf, 'down' )
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
692 call RunDbgCmd( buf, 'backtrace', [
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
693 \ '>backtrace',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
694 \ ' 4 User Autocommands for "TestGlobalFunction"',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
695 \ ' 3 function GlobalFunction[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
696 \ '->2 CallAFunction[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
697 \ ' 1 SourceAnotherFile[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
698 \ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
699 \ 'line 1: func DoAThing()' ] )
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
700
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
701 call RunDbgCmd( buf, 'down' )
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
702 call RunDbgCmd( buf, 'backtrace', [
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
703 \ '>backtrace',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
704 \ ' 4 User Autocommands for "TestGlobalFunction"',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
705 \ ' 3 function GlobalFunction[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
706 \ ' 2 CallAFunction[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
707 \ '->1 SourceAnotherFile[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
708 \ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
709 \ 'line 1: func DoAThing()' ] )
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
710
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
711 call RunDbgCmd( buf, 'down' )
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
712 call RunDbgCmd( buf, 'backtrace', [
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
713 \ '>backtrace',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
714 \ ' 4 User Autocommands for "TestGlobalFunction"',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
715 \ ' 3 function GlobalFunction[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
716 \ ' 2 CallAFunction[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
717 \ ' 1 SourceAnotherFile[1]',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
718 \ '->0 script ' .. getcwd() .. '/Xtest2.vim',
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
719 \ 'line 1: func DoAThing()' ] )
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
720
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
721 call RunDbgCmd( buf, 'down', [ 'frame is zero' ] )
94376326c096 patch 8.2.1508: not all debugger commands covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 21781
diff changeset
722
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
723 " step until we have another meaninfgul trace
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
724 call RunDbgCmd(buf, 'step', ['line 5: func File2Function()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
725 call RunDbgCmd(buf, 'step', ['line 9: call File2Function()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
726 call RunDbgCmd(buf, 'backtrace', [
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
727 \ '>backtrace',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
728 \ ' 4 User Autocommands for "TestGlobalFunction"',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
729 \ ' 3 function GlobalFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
730 \ ' 2 CallAFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
731 \ ' 1 SourceAnotherFile[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
732 \ '->0 script ' .. getcwd() .. '/Xtest2.vim',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
733 \ 'line 9: call File2Function()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
734
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
735 call RunDbgCmd(buf, 'step', ['line 1: call DoAThing()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
736 call RunDbgCmd(buf, 'step', ['line 1: echo "DoAThing"'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
737 call RunDbgCmd(buf, 'backtrace', [
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
738 \ '>backtrace',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
739 \ ' 6 User Autocommands for "TestGlobalFunction"',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
740 \ ' 5 function GlobalFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
741 \ ' 4 CallAFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
742 \ ' 3 SourceAnotherFile[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
743 \ ' 2 script ' .. getcwd() .. '/Xtest2.vim[9]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
744 \ ' 1 function File2Function[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
745 \ '->0 DoAThing',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
746 \ 'line 1: echo "DoAThing"'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
747
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
748 " Now, step (back to Xfile1.vim), and call the function _in_ Xfile2.vim
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
749 call RunDbgCmd(buf, 'step', ['line 1: End of function'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
750 call RunDbgCmd(buf, 'step', ['line 1: End of function'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
751 call RunDbgCmd(buf, 'step', ['line 10: End of sourced file'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
752 call RunDbgCmd(buf, 'step', ['line 1: End of function'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
753 call RunDbgCmd(buf, 'step', ['line 2: call File2Function()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
754 call RunDbgCmd(buf, 'backtrace', [
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
755 \ '>backtrace',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
756 \ ' 2 User Autocommands for "TestGlobalFunction"',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
757 \ ' 1 function GlobalFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
758 \ '->0 CallAFunction',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
759 \ 'line 2: call File2Function()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
760
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
761 call RunDbgCmd(buf, 'step', ['line 1: call DoAThing()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
762 call RunDbgCmd(buf, 'backtrace', [
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
763 \ '>backtrace',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
764 \ ' 3 User Autocommands for "TestGlobalFunction"',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
765 \ ' 2 function GlobalFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
766 \ ' 1 CallAFunction[2]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
767 \ '->0 File2Function',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
768 \ 'line 1: call DoAThing()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
769
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
770
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
771 " Now unwind so that we get back to the original autocommand (and the second
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
772 " cmd echo "Done")
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
773 call RunDbgCmd(buf, 'finish', ['line 1: End of function'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
774 call RunDbgCmd(buf, 'backtrace', [
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
775 \ '>backtrace',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
776 \ ' 3 User Autocommands for "TestGlobalFunction"',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
777 \ ' 2 function GlobalFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
778 \ ' 1 CallAFunction[2]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
779 \ '->0 File2Function',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
780 \ 'line 1: End of function'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
781
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
782 call RunDbgCmd(buf, 'finish', ['line 2: End of function'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
783 call RunDbgCmd(buf, 'backtrace', [
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
784 \ '>backtrace',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
785 \ ' 2 User Autocommands for "TestGlobalFunction"',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
786 \ ' 1 function GlobalFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
787 \ '->0 CallAFunction',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
788 \ 'line 2: End of function'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
789
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
790 call RunDbgCmd(buf, 'finish', ['line 1: End of function'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
791 call RunDbgCmd(buf, 'backtrace', [
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
792 \ '>backtrace',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
793 \ ' 1 User Autocommands for "TestGlobalFunction"',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
794 \ '->0 function GlobalFunction',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
795 \ 'line 1: End of function'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
796
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
797 call RunDbgCmd(buf, 'step', ['cmd: echo "Done"'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
798 call RunDbgCmd(buf, 'backtrace', [
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
799 \ '>backtrace',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
800 \ '->0 User Autocommands for "TestGlobalFunction"',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
801 \ 'cmd: echo "Done"'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
802
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
803 call StopVimInTerminal(buf)
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
804 call delete('Xtest1.vim')
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
805 call delete('Xtest2.vim')
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
806 endfunc
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
807
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
808 func Test_Backtrace_CmdLine()
21687
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
809 CheckCWD
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
810 let file1 =<< trim END
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
811 func SourceAnotherFile()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
812 source Xtest2.vim
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
813 endfunc
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
814
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
815 func CallAFunction()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
816 call SourceAnotherFile()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
817 call File2Function()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
818 endfunc
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
819
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
820 func GlobalFunction()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
821 call CallAFunction()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
822 endfunc
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
823
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
824 au User TestGlobalFunction :call GlobalFunction() | echo "Done"
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
825 END
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
826 call writefile(file1, 'Xtest1.vim')
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
827
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
828 let file2 =<< trim END
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
829 func DoAThing()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
830 echo "DoAThing"
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
831 endfunc
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
832
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
833 func File2Function()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
834 call DoAThing()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
835 endfunc
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
836
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
837 call File2Function()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
838 END
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
839 call writefile(file2, 'Xtest2.vim')
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
840
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
841 let buf = RunVimInTerminal(
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
842 \ '-S Xtest1.vim -c "debug call GlobalFunction()"',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
843 \ {'wait_for_ruler': 0})
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
844
22969
dcb59b1cc0c1 patch 8.2.2031: some tests fail when run under valgrind
Bram Moolenaar <Bram@vim.org>
parents: 22486
diff changeset
845 " Need to wait for the vim-in-terminal to be ready.
dcb59b1cc0c1 patch 8.2.2031: some tests fail when run under valgrind
Bram Moolenaar <Bram@vim.org>
parents: 22486
diff changeset
846 " With valgrind this can take quite long.
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
847 call CheckDbgOutput(buf, ['command line',
22969
dcb59b1cc0c1 patch 8.2.2031: some tests fail when run under valgrind
Bram Moolenaar <Bram@vim.org>
parents: 22486
diff changeset
848 \ 'cmd: call GlobalFunction()'], #{msec: 5000})
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
849
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
850 " At this point the ontly thing in the stack is the cmdline
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
851 call RunDbgCmd(buf, 'backtrace', [
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
852 \ '>backtrace',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
853 \ '->0 command line',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
854 \ 'cmd: call GlobalFunction()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
855
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
856 " And now we're back into the call stack
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
857 call RunDbgCmd(buf, 'step', ['line 1: call CallAFunction()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
858 call RunDbgCmd(buf, 'backtrace', [
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
859 \ '>backtrace',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
860 \ ' 1 command line',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
861 \ '->0 function GlobalFunction',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
862 \ 'line 1: call CallAFunction()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
863
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
864 call StopVimInTerminal(buf)
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
865 call delete('Xtest1.vim')
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
866 call delete('Xtest2.vim')
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
867 endfunc
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
868
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
869 func Test_Backtrace_DefFunction()
21687
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
870 CheckCWD
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
871 let file1 =<< trim END
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
872 vim9script
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
873 import File2Function from './Xtest2.vim'
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
874
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
875 def SourceAnotherFile()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
876 source Xtest2.vim
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
877 enddef
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
878
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
879 def CallAFunction()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
880 SourceAnotherFile()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
881 File2Function()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
882 enddef
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
883
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
884 def g:GlobalFunction()
24918
f11779c1d123 patch 8.2.2996: Vim9: when debugging cannot inspect local variables
Bram Moolenaar <Bram@vim.org>
parents: 24895
diff changeset
885 var some = "some var"
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
886 CallAFunction()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
887 enddef
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
888
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
889 defcompile
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
890 END
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
891 call writefile(file1, 'Xtest1.vim')
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
892
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
893 let file2 =<< trim END
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
894 vim9script
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
895
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
896 def DoAThing(): number
22486
4086a1708c83 patch 8.2.1791: Vim9: debugger test fails
Bram Moolenaar <Bram@vim.org>
parents: 22375
diff changeset
897 var a = 100 * 2
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
898 a += 3
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
899 return a
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
900 enddef
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
901
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
902 export def File2Function()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
903 DoAThing()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
904 enddef
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
905
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
906 defcompile
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
907 File2Function()
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
908 END
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
909 call writefile(file2, 'Xtest2.vim')
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
910
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
911 let buf = RunVimInTerminal('-S Xtest1.vim', {})
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
912
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
913 call RunDbgCmd(buf,
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
914 \ ':debug call GlobalFunction()',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
915 \ ['cmd: call GlobalFunction()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
916
24952
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
917 call RunDbgCmd(buf, 'step', ['line 1: var some = "some var"'])
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
918 call RunDbgCmd(buf, 'step', ['line 2: CallAFunction()'])
24918
f11779c1d123 patch 8.2.2996: Vim9: when debugging cannot inspect local variables
Bram Moolenaar <Bram@vim.org>
parents: 24895
diff changeset
919 call RunDbgCmd(buf, 'echo some', ['some var'])
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
920
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
921 call RunDbgCmd(buf, 'backtrace', [
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
922 \ '\V>backtrace',
24895
e61a2085c89b patch 8.2.2985: Vim9: a compiled function cannot be debugged
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
923 \ '\V->0 function GlobalFunction',
24952
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
924 \ '\Vline 2: CallAFunction()',
24895
e61a2085c89b patch 8.2.2985: Vim9: a compiled function cannot be debugged
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
925 \ ],
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
926 \ #{match: 'pattern'})
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
927
24952
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
928 call RunDbgCmd(buf, 'step', ['line 1: SourceAnotherFile()'])
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
929 call RunDbgCmd(buf, 'step', ['line 1: source Xtest2.vim'])
24918
f11779c1d123 patch 8.2.2996: Vim9: when debugging cannot inspect local variables
Bram Moolenaar <Bram@vim.org>
parents: 24895
diff changeset
930 " Repeated line, because we fist are in the compiled function before the
f11779c1d123 patch 8.2.2996: Vim9: when debugging cannot inspect local variables
Bram Moolenaar <Bram@vim.org>
parents: 24895
diff changeset
931 " EXEC and then in do_cmdline() before the :source command.
24895
e61a2085c89b patch 8.2.2985: Vim9: a compiled function cannot be debugged
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
932 call RunDbgCmd(buf, 'step', ['line 1: source Xtest2.vim'])
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
933 call RunDbgCmd(buf, 'step', ['line 1: vim9script'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
934 call RunDbgCmd(buf, 'step', ['line 3: def DoAThing(): number'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
935 call RunDbgCmd(buf, 'step', ['line 9: export def File2Function()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
936 call RunDbgCmd(buf, 'step', ['line 9: def File2Function()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
937 call RunDbgCmd(buf, 'step', ['line 13: defcompile'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
938 call RunDbgCmd(buf, 'step', ['line 14: File2Function()'])
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
939 call RunDbgCmd(buf, 'backtrace', [
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
940 \ '\V>backtrace',
24918
f11779c1d123 patch 8.2.2996: Vim9: when debugging cannot inspect local variables
Bram Moolenaar <Bram@vim.org>
parents: 24895
diff changeset
941 \ '\V 3 function GlobalFunction[2]',
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
942 \ '\V 2 <SNR>\.\*_CallAFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
943 \ '\V 1 <SNR>\.\*_SourceAnotherFile[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
944 \ '\V->0 script ' .. getcwd() .. '/Xtest2.vim',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
945 \ '\Vline 14: File2Function()'],
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
946 \ #{match: 'pattern'})
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
947
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
948 " Don't step into compiled functions...
24895
e61a2085c89b patch 8.2.2985: Vim9: a compiled function cannot be debugged
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
949 call RunDbgCmd(buf, 'next', ['line 15: End of sourced file'])
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
950 call RunDbgCmd(buf, 'backtrace', [
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
951 \ '\V>backtrace',
24918
f11779c1d123 patch 8.2.2996: Vim9: when debugging cannot inspect local variables
Bram Moolenaar <Bram@vim.org>
parents: 24895
diff changeset
952 \ '\V 3 function GlobalFunction[2]',
21508
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
953 \ '\V 2 <SNR>\.\*_CallAFunction[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
954 \ '\V 1 <SNR>\.\*_SourceAnotherFile[1]',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
955 \ '\V->0 script ' .. getcwd() .. '/Xtest2.vim',
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
956 \ '\Vline 15: End of sourced file'],
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
957 \ #{match: 'pattern'})
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
958
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
959 call StopVimInTerminal(buf)
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
960 call delete('Xtest1.vim')
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
961 call delete('Xtest2.vim')
6b2a5418cbc3 patch 8.2.1304: debug backtrace isn't tested much
Bram Moolenaar <Bram@vim.org>
parents: 19954
diff changeset
962 endfunc
21687
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
963
25719
154663508d9b patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Bram Moolenaar <Bram@vim.org>
parents: 25204
diff changeset
964 func Test_DefFunction_expr()
154663508d9b patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Bram Moolenaar <Bram@vim.org>
parents: 25204
diff changeset
965 CheckCWD
154663508d9b patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Bram Moolenaar <Bram@vim.org>
parents: 25204
diff changeset
966 let file3 =<< trim END
154663508d9b patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Bram Moolenaar <Bram@vim.org>
parents: 25204
diff changeset
967 vim9script
154663508d9b patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Bram Moolenaar <Bram@vim.org>
parents: 25204
diff changeset
968 g:someVar = "foo"
154663508d9b patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Bram Moolenaar <Bram@vim.org>
parents: 25204
diff changeset
969 def g:ChangeVar()
154663508d9b patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Bram Moolenaar <Bram@vim.org>
parents: 25204
diff changeset
970 g:someVar = "bar"
154663508d9b patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Bram Moolenaar <Bram@vim.org>
parents: 25204
diff changeset
971 echo "changed"
154663508d9b patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Bram Moolenaar <Bram@vim.org>
parents: 25204
diff changeset
972 enddef
154663508d9b patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Bram Moolenaar <Bram@vim.org>
parents: 25204
diff changeset
973 defcompile
154663508d9b patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Bram Moolenaar <Bram@vim.org>
parents: 25204
diff changeset
974 END
154663508d9b patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Bram Moolenaar <Bram@vim.org>
parents: 25204
diff changeset
975 call writefile(file3, 'Xtest3.vim')
154663508d9b patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Bram Moolenaar <Bram@vim.org>
parents: 25204
diff changeset
976 let buf = RunVimInTerminal('-S Xtest3.vim', {})
154663508d9b patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Bram Moolenaar <Bram@vim.org>
parents: 25204
diff changeset
977
154663508d9b patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Bram Moolenaar <Bram@vim.org>
parents: 25204
diff changeset
978 call RunDbgCmd(buf, ':breakadd expr g:someVar')
154663508d9b patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Bram Moolenaar <Bram@vim.org>
parents: 25204
diff changeset
979 call RunDbgCmd(buf, ':call g:ChangeVar()', ['Oldval = "''foo''"', 'Newval = "''bar''"', 'function ChangeVar', 'line 2: echo "changed"'])
154663508d9b patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Bram Moolenaar <Bram@vim.org>
parents: 25204
diff changeset
980
154663508d9b patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Bram Moolenaar <Bram@vim.org>
parents: 25204
diff changeset
981 call StopVimInTerminal(buf)
154663508d9b patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Bram Moolenaar <Bram@vim.org>
parents: 25204
diff changeset
982 call delete('Xtest3.vim')
154663508d9b patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Bram Moolenaar <Bram@vim.org>
parents: 25204
diff changeset
983 endfunc
154663508d9b patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Bram Moolenaar <Bram@vim.org>
parents: 25204
diff changeset
984
25059
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
985 func Test_debug_def_and_legacy_function()
24978
2818b8108d92 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function
Bram Moolenaar <Bram@vim.org>
parents: 24960
diff changeset
986 CheckCWD
2818b8108d92 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function
Bram Moolenaar <Bram@vim.org>
parents: 24960
diff changeset
987 let file =<< trim END
2818b8108d92 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function
Bram Moolenaar <Bram@vim.org>
parents: 24960
diff changeset
988 vim9script
2818b8108d92 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function
Bram Moolenaar <Bram@vim.org>
parents: 24960
diff changeset
989 def g:SomeFunc()
2818b8108d92 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function
Bram Moolenaar <Bram@vim.org>
parents: 24960
diff changeset
990 echo "here"
2818b8108d92 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function
Bram Moolenaar <Bram@vim.org>
parents: 24960
diff changeset
991 echo "and"
2818b8108d92 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function
Bram Moolenaar <Bram@vim.org>
parents: 24960
diff changeset
992 echo "there"
24980
2cb78583fada patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
993 breakadd func 2 LocalFunc
2cb78583fada patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
994 LocalFunc()
24978
2818b8108d92 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function
Bram Moolenaar <Bram@vim.org>
parents: 24960
diff changeset
995 enddef
24980
2cb78583fada patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
996
2cb78583fada patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
997 def LocalFunc()
2cb78583fada patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
998 echo "first"
2cb78583fada patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
999 echo "second"
25004
70f55a30f03c patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Bram Moolenaar <Bram@vim.org>
parents: 24980
diff changeset
1000 breakadd func LegacyFunc
24980
2cb78583fada patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
1001 LegacyFunc()
2cb78583fada patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
1002 enddef
2cb78583fada patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
1003
2cb78583fada patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
1004 func LegacyFunc()
2cb78583fada patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
1005 echo "legone"
2cb78583fada patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
1006 echo "legtwo"
2cb78583fada patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
1007 endfunc
2cb78583fada patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
1008
24978
2818b8108d92 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function
Bram Moolenaar <Bram@vim.org>
parents: 24960
diff changeset
1009 breakadd func 2 g:SomeFunc
2818b8108d92 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function
Bram Moolenaar <Bram@vim.org>
parents: 24960
diff changeset
1010 END
2818b8108d92 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function
Bram Moolenaar <Bram@vim.org>
parents: 24960
diff changeset
1011 call writefile(file, 'XtestDebug.vim')
2818b8108d92 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function
Bram Moolenaar <Bram@vim.org>
parents: 24960
diff changeset
1012
2818b8108d92 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function
Bram Moolenaar <Bram@vim.org>
parents: 24960
diff changeset
1013 let buf = RunVimInTerminal('-S XtestDebug.vim', {})
2818b8108d92 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function
Bram Moolenaar <Bram@vim.org>
parents: 24960
diff changeset
1014
2818b8108d92 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function
Bram Moolenaar <Bram@vim.org>
parents: 24960
diff changeset
1015 call RunDbgCmd(buf,':call SomeFunc()', ['line 2: echo "and"'])
2818b8108d92 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function
Bram Moolenaar <Bram@vim.org>
parents: 24960
diff changeset
1016 call RunDbgCmd(buf,'next', ['line 3: echo "there"'])
24980
2cb78583fada patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
1017 call RunDbgCmd(buf,'next', ['line 4: breakadd func 2 LocalFunc'])
2cb78583fada patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
1018
2cb78583fada patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
1019 " continue, next breakpoint is in LocalFunc()
2cb78583fada patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
1020 call RunDbgCmd(buf,'cont', ['line 2: echo "second"'])
2cb78583fada patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
1021
2cb78583fada patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
1022 " continue, next breakpoint is in LegacyFunc()
2cb78583fada patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
1023 call RunDbgCmd(buf,'cont', ['line 1: echo "legone"'])
24978
2818b8108d92 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function
Bram Moolenaar <Bram@vim.org>
parents: 24960
diff changeset
1024
2818b8108d92 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function
Bram Moolenaar <Bram@vim.org>
parents: 24960
diff changeset
1025 call RunDbgCmd(buf, 'cont')
2818b8108d92 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function
Bram Moolenaar <Bram@vim.org>
parents: 24960
diff changeset
1026
2818b8108d92 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function
Bram Moolenaar <Bram@vim.org>
parents: 24960
diff changeset
1027 call StopVimInTerminal(buf)
25118
12fd67997953 patch 8.2.3096: temp files remain after running tests
Bram Moolenaar <Bram@vim.org>
parents: 25098
diff changeset
1028 call delete('XtestDebug.vim')
24978
2818b8108d92 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function
Bram Moolenaar <Bram@vim.org>
parents: 24960
diff changeset
1029 endfunc
2818b8108d92 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function
Bram Moolenaar <Bram@vim.org>
parents: 24960
diff changeset
1030
24932
afaa7f3aae56 patch 8.2.3003: Vim9: closure compiled with wrong compile type
Bram Moolenaar <Bram@vim.org>
parents: 24918
diff changeset
1031 func Test_debug_def_function()
afaa7f3aae56 patch 8.2.3003: Vim9: closure compiled with wrong compile type
Bram Moolenaar <Bram@vim.org>
parents: 24918
diff changeset
1032 CheckCWD
afaa7f3aae56 patch 8.2.3003: Vim9: closure compiled with wrong compile type
Bram Moolenaar <Bram@vim.org>
parents: 24918
diff changeset
1033 let file =<< trim END
afaa7f3aae56 patch 8.2.3003: Vim9: closure compiled with wrong compile type
Bram Moolenaar <Bram@vim.org>
parents: 24918
diff changeset
1034 vim9script
afaa7f3aae56 patch 8.2.3003: Vim9: closure compiled with wrong compile type
Bram Moolenaar <Bram@vim.org>
parents: 24918
diff changeset
1035 def g:Func()
24948
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1036 var n: number
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1037 def Closure(): number
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1038 return n + 3
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1039 enddef
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1040 n += Closure()
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1041 echo 'result: ' .. n
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1042 enddef
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1043
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1044 def g:FuncWithArgs(text: string, nr: number, ...items: list<number>)
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1045 echo text .. nr
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1046 for it in items
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1047 echo it
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1048 endfor
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1049 echo "done"
24932
afaa7f3aae56 patch 8.2.3003: Vim9: closure compiled with wrong compile type
Bram Moolenaar <Bram@vim.org>
parents: 24918
diff changeset
1050 enddef
24952
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1051
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1052 def g:FuncWithDict()
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1053 var d = {
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1054 a: 1,
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1055 b: 2,
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1056 }
24960
64b70a958f19 patch 8.2.3017: Vim9: debugger shows too many lines
Bram Moolenaar <Bram@vim.org>
parents: 24952
diff changeset
1057 # comment
64b70a958f19 patch 8.2.3017: Vim9: debugger shows too many lines
Bram Moolenaar <Bram@vim.org>
parents: 24952
diff changeset
1058 def Inner()
25204
bc1633df8a88 patch 8.2.3138: debugger test fails
Bram Moolenaar <Bram@vim.org>
parents: 25159
diff changeset
1059 eval 1 + 2
24960
64b70a958f19 patch 8.2.3017: Vim9: debugger shows too many lines
Bram Moolenaar <Bram@vim.org>
parents: 24952
diff changeset
1060 enddef
24952
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1061 enddef
25159
b2a6a71a11e8 patch 8.2.3116: Vim9: crash when debugging a function with line continuation
Bram Moolenaar <Bram@vim.org>
parents: 25118
diff changeset
1062
25004
70f55a30f03c patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Bram Moolenaar <Bram@vim.org>
parents: 24980
diff changeset
1063 def g:FuncComment()
70f55a30f03c patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Bram Moolenaar <Bram@vim.org>
parents: 24980
diff changeset
1064 # comment
70f55a30f03c patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Bram Moolenaar <Bram@vim.org>
parents: 24980
diff changeset
1065 echo "first"
70f55a30f03c patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Bram Moolenaar <Bram@vim.org>
parents: 24980
diff changeset
1066 .. "one"
70f55a30f03c patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Bram Moolenaar <Bram@vim.org>
parents: 24980
diff changeset
1067 # comment
70f55a30f03c patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Bram Moolenaar <Bram@vim.org>
parents: 24980
diff changeset
1068 echo "second"
70f55a30f03c patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Bram Moolenaar <Bram@vim.org>
parents: 24980
diff changeset
1069 enddef
25159
b2a6a71a11e8 patch 8.2.3116: Vim9: crash when debugging a function with line continuation
Bram Moolenaar <Bram@vim.org>
parents: 25118
diff changeset
1070
25098
765a642e0e20 patch 8.2.3086: Vim9: breakpoint on "for" does not work
Bram Moolenaar <Bram@vim.org>
parents: 25059
diff changeset
1071 def g:FuncForLoop()
25204
bc1633df8a88 patch 8.2.3138: debugger test fails
Bram Moolenaar <Bram@vim.org>
parents: 25159
diff changeset
1072 eval 1 + 2
25098
765a642e0e20 patch 8.2.3086: Vim9: breakpoint on "for" does not work
Bram Moolenaar <Bram@vim.org>
parents: 25059
diff changeset
1073 for i in [11, 22, 33]
25204
bc1633df8a88 patch 8.2.3138: debugger test fails
Bram Moolenaar <Bram@vim.org>
parents: 25159
diff changeset
1074 eval i + 2
25098
765a642e0e20 patch 8.2.3086: Vim9: breakpoint on "for" does not work
Bram Moolenaar <Bram@vim.org>
parents: 25059
diff changeset
1075 endfor
765a642e0e20 patch 8.2.3086: Vim9: breakpoint on "for" does not work
Bram Moolenaar <Bram@vim.org>
parents: 25059
diff changeset
1076 echo "done"
765a642e0e20 patch 8.2.3086: Vim9: breakpoint on "for" does not work
Bram Moolenaar <Bram@vim.org>
parents: 25059
diff changeset
1077 enddef
25159
b2a6a71a11e8 patch 8.2.3116: Vim9: crash when debugging a function with line continuation
Bram Moolenaar <Bram@vim.org>
parents: 25118
diff changeset
1078
b2a6a71a11e8 patch 8.2.3116: Vim9: crash when debugging a function with line continuation
Bram Moolenaar <Bram@vim.org>
parents: 25118
diff changeset
1079 def g:FuncWithSplitLine()
25204
bc1633df8a88 patch 8.2.3138: debugger test fails
Bram Moolenaar <Bram@vim.org>
parents: 25159
diff changeset
1080 eval 1 + 2
bc1633df8a88 patch 8.2.3138: debugger test fails
Bram Moolenaar <Bram@vim.org>
parents: 25159
diff changeset
1081 | eval 2 + 3
25159
b2a6a71a11e8 patch 8.2.3116: Vim9: crash when debugging a function with line continuation
Bram Moolenaar <Bram@vim.org>
parents: 25118
diff changeset
1082 enddef
24932
afaa7f3aae56 patch 8.2.3003: Vim9: closure compiled with wrong compile type
Bram Moolenaar <Bram@vim.org>
parents: 24918
diff changeset
1083 END
afaa7f3aae56 patch 8.2.3003: Vim9: closure compiled with wrong compile type
Bram Moolenaar <Bram@vim.org>
parents: 24918
diff changeset
1084 call writefile(file, 'Xtest.vim')
afaa7f3aae56 patch 8.2.3003: Vim9: closure compiled with wrong compile type
Bram Moolenaar <Bram@vim.org>
parents: 24918
diff changeset
1085
afaa7f3aae56 patch 8.2.3003: Vim9: closure compiled with wrong compile type
Bram Moolenaar <Bram@vim.org>
parents: 24918
diff changeset
1086 let buf = RunVimInTerminal('-S Xtest.vim', {})
afaa7f3aae56 patch 8.2.3003: Vim9: closure compiled with wrong compile type
Bram Moolenaar <Bram@vim.org>
parents: 24918
diff changeset
1087
afaa7f3aae56 patch 8.2.3003: Vim9: closure compiled with wrong compile type
Bram Moolenaar <Bram@vim.org>
parents: 24918
diff changeset
1088 call RunDbgCmd(buf,
afaa7f3aae56 patch 8.2.3003: Vim9: closure compiled with wrong compile type
Bram Moolenaar <Bram@vim.org>
parents: 24918
diff changeset
1089 \ ':debug call Func()',
afaa7f3aae56 patch 8.2.3003: Vim9: closure compiled with wrong compile type
Bram Moolenaar <Bram@vim.org>
parents: 24918
diff changeset
1090 \ ['cmd: call Func()'])
afaa7f3aae56 patch 8.2.3003: Vim9: closure compiled with wrong compile type
Bram Moolenaar <Bram@vim.org>
parents: 24918
diff changeset
1091 call RunDbgCmd(buf, 'next', ['result: 3'])
afaa7f3aae56 patch 8.2.3003: Vim9: closure compiled with wrong compile type
Bram Moolenaar <Bram@vim.org>
parents: 24918
diff changeset
1092 call term_sendkeys(buf, "\r")
24948
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1093 call RunDbgCmd(buf, 'cont')
24932
afaa7f3aae56 patch 8.2.3003: Vim9: closure compiled with wrong compile type
Bram Moolenaar <Bram@vim.org>
parents: 24918
diff changeset
1094
24948
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1095 call RunDbgCmd(buf,
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1096 \ ':debug call FuncWithArgs("asdf", 42, 1, 2, 3)',
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1097 \ ['cmd: call FuncWithArgs("asdf", 42, 1, 2, 3)'])
24952
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1098 call RunDbgCmd(buf, 'step', ['line 1: echo text .. nr'])
24948
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1099 call RunDbgCmd(buf, 'echo text', ['asdf'])
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1100 call RunDbgCmd(buf, 'echo nr', ['42'])
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1101 call RunDbgCmd(buf, 'echo items', ['[1, 2, 3]'])
24952
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1102 call RunDbgCmd(buf, 'step', ['asdf42', 'function FuncWithArgs', 'line 2: for it in items'])
24948
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1103 call RunDbgCmd(buf, 'echo it', ['1'])
24952
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1104 call RunDbgCmd(buf, 'step', ['line 3: echo it'])
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1105 call RunDbgCmd(buf, 'step', ['1', 'function FuncWithArgs', 'line 4: endfor'])
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1106 call RunDbgCmd(buf, 'step', ['line 2: for it in items'])
24948
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1107 call RunDbgCmd(buf, 'echo it', ['2'])
24952
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1108 call RunDbgCmd(buf, 'step', ['line 3: echo it'])
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1109 call RunDbgCmd(buf, 'step', ['2', 'function FuncWithArgs', 'line 4: endfor'])
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1110 call RunDbgCmd(buf, 'step', ['line 2: for it in items'])
24948
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1111 call RunDbgCmd(buf, 'echo it', ['3'])
24952
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1112 call RunDbgCmd(buf, 'step', ['line 3: echo it'])
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1113 call RunDbgCmd(buf, 'step', ['3', 'function FuncWithArgs', 'line 4: endfor'])
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1114 call RunDbgCmd(buf, 'step', ['line 5: echo "done"'])
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1115 call RunDbgCmd(buf, 'cont')
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1116
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1117 call RunDbgCmd(buf,
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1118 \ ':debug call FuncWithDict()',
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1119 \ ['cmd: call FuncWithDict()'])
ffe784fdec57 patch 8.2.3013: Vim: when debugging only first line of command is displayed
Bram Moolenaar <Bram@vim.org>
parents: 24948
diff changeset
1120 call RunDbgCmd(buf, 'step', ['line 1: var d = { a: 1, b: 2, }'])
24960
64b70a958f19 patch 8.2.3017: Vim9: debugger shows too many lines
Bram Moolenaar <Bram@vim.org>
parents: 24952
diff changeset
1121 call RunDbgCmd(buf, 'step', ['line 6: def Inner()'])
25004
70f55a30f03c patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Bram Moolenaar <Bram@vim.org>
parents: 24980
diff changeset
1122 call RunDbgCmd(buf, 'cont')
70f55a30f03c patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Bram Moolenaar <Bram@vim.org>
parents: 24980
diff changeset
1123
70f55a30f03c patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Bram Moolenaar <Bram@vim.org>
parents: 24980
diff changeset
1124 call RunDbgCmd(buf, ':breakadd func 1 FuncComment')
70f55a30f03c patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Bram Moolenaar <Bram@vim.org>
parents: 24980
diff changeset
1125 call RunDbgCmd(buf, ':call FuncComment()', ['function FuncComment', 'line 2: echo "first" .. "one"'])
70f55a30f03c patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Bram Moolenaar <Bram@vim.org>
parents: 24980
diff changeset
1126 call RunDbgCmd(buf, ':breakadd func 3 FuncComment')
70f55a30f03c patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Bram Moolenaar <Bram@vim.org>
parents: 24980
diff changeset
1127 call RunDbgCmd(buf, 'cont', ['function FuncComment', 'line 5: echo "second"'])
25098
765a642e0e20 patch 8.2.3086: Vim9: breakpoint on "for" does not work
Bram Moolenaar <Bram@vim.org>
parents: 25059
diff changeset
1128 call RunDbgCmd(buf, 'cont')
765a642e0e20 patch 8.2.3086: Vim9: breakpoint on "for" does not work
Bram Moolenaar <Bram@vim.org>
parents: 25059
diff changeset
1129
765a642e0e20 patch 8.2.3086: Vim9: breakpoint on "for" does not work
Bram Moolenaar <Bram@vim.org>
parents: 25059
diff changeset
1130 call RunDbgCmd(buf, ':breakadd func 2 FuncForLoop')
765a642e0e20 patch 8.2.3086: Vim9: breakpoint on "for" does not work
Bram Moolenaar <Bram@vim.org>
parents: 25059
diff changeset
1131 call RunDbgCmd(buf, ':call FuncForLoop()', ['function FuncForLoop', 'line 2: for i in [11, 22, 33]'])
765a642e0e20 patch 8.2.3086: Vim9: breakpoint on "for" does not work
Bram Moolenaar <Bram@vim.org>
parents: 25059
diff changeset
1132 call RunDbgCmd(buf, 'echo i', ['11'])
25204
bc1633df8a88 patch 8.2.3138: debugger test fails
Bram Moolenaar <Bram@vim.org>
parents: 25159
diff changeset
1133 call RunDbgCmd(buf, 'next', ['function FuncForLoop', 'line 3: eval i + 2'])
25098
765a642e0e20 patch 8.2.3086: Vim9: breakpoint on "for" does not work
Bram Moolenaar <Bram@vim.org>
parents: 25059
diff changeset
1134 call RunDbgCmd(buf, 'next', ['function FuncForLoop', 'line 4: endfor'])
765a642e0e20 patch 8.2.3086: Vim9: breakpoint on "for" does not work
Bram Moolenaar <Bram@vim.org>
parents: 25059
diff changeset
1135 call RunDbgCmd(buf, 'next', ['function FuncForLoop', 'line 2: for i in [11, 22, 33]'])
765a642e0e20 patch 8.2.3086: Vim9: breakpoint on "for" does not work
Bram Moolenaar <Bram@vim.org>
parents: 25059
diff changeset
1136 call RunDbgCmd(buf, 'echo i', ['22'])
24948
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1137
25159
b2a6a71a11e8 patch 8.2.3116: Vim9: crash when debugging a function with line continuation
Bram Moolenaar <Bram@vim.org>
parents: 25118
diff changeset
1138 call RunDbgCmd(buf, 'breakdel *')
b2a6a71a11e8 patch 8.2.3116: Vim9: crash when debugging a function with line continuation
Bram Moolenaar <Bram@vim.org>
parents: 25118
diff changeset
1139 call RunDbgCmd(buf, 'cont')
b2a6a71a11e8 patch 8.2.3116: Vim9: crash when debugging a function with line continuation
Bram Moolenaar <Bram@vim.org>
parents: 25118
diff changeset
1140
b2a6a71a11e8 patch 8.2.3116: Vim9: crash when debugging a function with line continuation
Bram Moolenaar <Bram@vim.org>
parents: 25118
diff changeset
1141 call RunDbgCmd(buf, ':breakadd func FuncWithSplitLine')
25204
bc1633df8a88 patch 8.2.3138: debugger test fails
Bram Moolenaar <Bram@vim.org>
parents: 25159
diff changeset
1142 call RunDbgCmd(buf, ':call FuncWithSplitLine()', ['function FuncWithSplitLine', 'line 1: eval 1 + 2 | eval 2 + 3'])
25159
b2a6a71a11e8 patch 8.2.3116: Vim9: crash when debugging a function with line continuation
Bram Moolenaar <Bram@vim.org>
parents: 25118
diff changeset
1143
24948
5c418c774f95 patch 8.2.3011: Vim9: cannot get argument values during debugging
Bram Moolenaar <Bram@vim.org>
parents: 24932
diff changeset
1144 call RunDbgCmd(buf, 'cont')
24932
afaa7f3aae56 patch 8.2.3003: Vim9: closure compiled with wrong compile type
Bram Moolenaar <Bram@vim.org>
parents: 24918
diff changeset
1145 call StopVimInTerminal(buf)
afaa7f3aae56 patch 8.2.3003: Vim9: closure compiled with wrong compile type
Bram Moolenaar <Bram@vim.org>
parents: 24918
diff changeset
1146 call delete('Xtest.vim')
afaa7f3aae56 patch 8.2.3003: Vim9: closure compiled with wrong compile type
Bram Moolenaar <Bram@vim.org>
parents: 24918
diff changeset
1147 endfunc
afaa7f3aae56 patch 8.2.3003: Vim9: closure compiled with wrong compile type
Bram Moolenaar <Bram@vim.org>
parents: 24918
diff changeset
1148
25059
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1149 func Test_debug_def_function_with_lambda()
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1150 CheckCWD
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1151 let lines =<< trim END
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1152 vim9script
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1153 def g:Func()
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1154 var s = 'a'
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1155 ['b']->map((_, v) => s)
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1156 echo "done"
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1157 enddef
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1158 breakadd func 2 g:Func
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1159 END
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1160 call writefile(lines, 'XtestLambda.vim')
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1161
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1162 let buf = RunVimInTerminal('-S XtestLambda.vim', {})
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1163
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1164 call RunDbgCmd(buf,
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1165 \ ':call g:Func()',
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1166 \ ['function Func', 'line 2: [''b'']->map((_, v) => s)'])
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1167 call RunDbgCmd(buf,
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1168 \ 'next',
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1169 \ ['function Func', 'line 3: echo "done"'])
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1170
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1171 call RunDbgCmd(buf, 'cont')
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1172 call StopVimInTerminal(buf)
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1173 call delete('XtestLambda.vim')
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1174 endfunc
671ded1facd5 patch 8.2.3066: Vim9: debugging lambda does not work
Bram Moolenaar <Bram@vim.org>
parents: 25004
diff changeset
1175
21687
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1176 func Test_debug_backtrace_level()
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1177 CheckCWD
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1178 let lines =<< trim END
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1179 let s:file1_var = 'file1'
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1180 let g:global_var = 'global'
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1181
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1182 func s:File1Func( arg )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1183 let s:file1_var .= a:arg
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1184 let local_var = s:file1_var .. ' test1'
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1185 let g:global_var .= local_var
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1186 source Xtest2.vim
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1187 endfunc
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1188
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1189 call s:File1Func( 'arg1' )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1190 END
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1191 call writefile(lines, 'Xtest1.vim')
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1192
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1193 let lines =<< trim END
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1194 let s:file2_var = 'file2'
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1195
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1196 func s:File2Func( arg )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1197 let s:file2_var .= a:arg
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1198 let local_var = s:file2_var .. ' test2'
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1199 let g:global_var .= local_var
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1200 endfunc
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1201
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1202 call s:File2Func( 'arg2' )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1203 END
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1204 call writefile(lines, 'Xtest2.vim')
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1205
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1206 let file1 = getcwd() .. '/Xtest1.vim'
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1207 let file2 = getcwd() .. '/Xtest2.vim'
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1208
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1209 " set a breakpoint and source file1.vim
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1210 let buf = RunVimInTerminal(
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1211 \ '-c "breakadd file 1 Xtest1.vim" -S Xtest1.vim',
22969
dcb59b1cc0c1 patch 8.2.2031: some tests fail when run under valgrind
Bram Moolenaar <Bram@vim.org>
parents: 22486
diff changeset
1212 \ #{wait_for_ruler: 0})
21687
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1213
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1214 call CheckDbgOutput(buf, [
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1215 \ 'Breakpoint in "' .. file1 .. '" line 1',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1216 \ 'Entering Debug mode. Type "cont" to continue.',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1217 \ 'command line..script ' .. file1,
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1218 \ 'line 1: let s:file1_var = ''file1'''
22969
dcb59b1cc0c1 patch 8.2.2031: some tests fail when run under valgrind
Bram Moolenaar <Bram@vim.org>
parents: 22486
diff changeset
1219 \ ], #{msec: 5000})
21687
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1220
23229
b545334ae654 patch 8.2.2160: various typos
Bram Moolenaar <Bram@vim.org>
parents: 22969
diff changeset
1221 " step through the initial declarations
21687
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1222 call RunDbgCmd(buf, 'step', [ 'line 2: let g:global_var = ''global''' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1223 call RunDbgCmd(buf, 'step', [ 'line 4: func s:File1Func( arg )' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1224 call RunDbgCmd(buf, 'echo s:file1_var', [ 'file1' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1225 call RunDbgCmd(buf, 'echo g:global_var', [ 'global' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1226 call RunDbgCmd(buf, 'echo global_var', [ 'global' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1227
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1228 " step in to the first function
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1229 call RunDbgCmd(buf, 'step', [ 'line 11: call s:File1Func( ''arg1'' )' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1230 call RunDbgCmd(buf, 'step', [ 'line 1: let s:file1_var .= a:arg' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1231 call RunDbgCmd(buf, 'echo a:arg', [ 'arg1' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1232 call RunDbgCmd(buf, 'echo s:file1_var', [ 'file1' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1233 call RunDbgCmd(buf, 'echo g:global_var', [ 'global' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1234 call RunDbgCmd(buf,
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1235 \'echo global_var',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1236 \[ 'E121: Undefined variable: global_var' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1237 call RunDbgCmd(buf,
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1238 \'echo local_var',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1239 \[ 'E121: Undefined variable: local_var' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1240 call RunDbgCmd(buf,
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1241 \'echo l:local_var',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1242 \[ 'E121: Undefined variable: l:local_var' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1243
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1244 " backtrace up
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1245 call RunDbgCmd(buf, 'backtrace', [
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1246 \ '\V>backtrace',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1247 \ '\V 2 command line',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1248 \ '\V 1 script ' .. file1 .. '[11]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1249 \ '\V->0 function <SNR>\.\*_File1Func',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1250 \ '\Vline 1: let s:file1_var .= a:arg',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1251 \ ],
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1252 \ #{ match: 'pattern' } )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1253 call RunDbgCmd(buf, 'up', [ '>up' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1254
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1255 call RunDbgCmd(buf, 'backtrace', [
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1256 \ '\V>backtrace',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1257 \ '\V 2 command line',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1258 \ '\V->1 script ' .. file1 .. '[11]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1259 \ '\V 0 function <SNR>\.\*_File1Func',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1260 \ '\Vline 1: let s:file1_var .= a:arg',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1261 \ ],
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1262 \ #{ match: 'pattern' } )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1263
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1264 " Expression evaluation in the script frame (not the function frame)
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1265 " FIXME: Unexpected in this scope (a: should not be visibnle)
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1266 call RunDbgCmd(buf, 'echo a:arg', [ 'arg1' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1267 call RunDbgCmd(buf, 'echo s:file1_var', [ 'file1' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1268 call RunDbgCmd(buf, 'echo g:global_var', [ 'global' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1269 " FIXME: Unexpected in this scope (global should be found)
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1270 call RunDbgCmd(buf,
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1271 \'echo global_var',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1272 \[ 'E121: Undefined variable: global_var' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1273 call RunDbgCmd(buf,
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1274 \'echo local_var',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1275 \[ 'E121: Undefined variable: local_var' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1276 call RunDbgCmd(buf,
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1277 \'echo l:local_var',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1278 \[ 'E121: Undefined variable: l:local_var' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1279
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1280
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1281 " step while backtraced jumps to the latest frame
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1282 call RunDbgCmd(buf, 'step', [
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1283 \ 'line 2: let local_var = s:file1_var .. '' test1''' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1284 call RunDbgCmd(buf, 'backtrace', [
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1285 \ '\V>backtrace',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1286 \ '\V 2 command line',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1287 \ '\V 1 script ' .. file1 .. '[11]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1288 \ '\V->0 function <SNR>\.\*_File1Func',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1289 \ '\Vline 2: let local_var = s:file1_var .. '' test1''',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1290 \ ],
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1291 \ #{ match: 'pattern' } )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1292
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1293 call RunDbgCmd(buf, 'step', [ 'line 3: let g:global_var .= local_var' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1294 call RunDbgCmd(buf, 'echo local_var', [ 'file1arg1 test1' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1295 call RunDbgCmd(buf, 'echo l:local_var', [ 'file1arg1 test1' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1296
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1297 call RunDbgCmd(buf, 'step', [ 'line 4: source Xtest2.vim' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1298 call RunDbgCmd(buf, 'step', [ 'line 1: let s:file2_var = ''file2''' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1299 call RunDbgCmd(buf, 'backtrace', [
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1300 \ '\V>backtrace',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1301 \ '\V 3 command line',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1302 \ '\V 2 script ' .. file1 .. '[11]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1303 \ '\V 1 function <SNR>\.\*_File1Func[4]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1304 \ '\V->0 script ' .. file2,
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1305 \ '\Vline 1: let s:file2_var = ''file2''',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1306 \ ],
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1307 \ #{ match: 'pattern' } )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1308
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1309 " Expression evaluation in the script frame file2 (not the function frame)
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1310 call RunDbgCmd(buf, 'echo a:arg', [ 'E121: Undefined variable: a:arg' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1311 call RunDbgCmd(buf,
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1312 \ 'echo s:file1_var',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1313 \ [ 'E121: Undefined variable: s:file1_var' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1314 call RunDbgCmd(buf, 'echo g:global_var', [ 'globalfile1arg1 test1' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1315 call RunDbgCmd(buf, 'echo global_var', [ 'globalfile1arg1 test1' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1316 call RunDbgCmd(buf,
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1317 \'echo local_var',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1318 \[ 'E121: Undefined variable: local_var' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1319 call RunDbgCmd(buf,
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1320 \'echo l:local_var',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1321 \[ 'E121: Undefined variable: l:local_var' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1322 call RunDbgCmd(buf,
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1323 \ 'echo s:file2_var',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1324 \ [ 'E121: Undefined variable: s:file2_var' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1325
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1326 call RunDbgCmd(buf, 'step', [ 'line 3: func s:File2Func( arg )' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1327 call RunDbgCmd(buf, 'echo s:file2_var', [ 'file2' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1328
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1329 " Up the stack to the other script context
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1330 call RunDbgCmd(buf, 'up')
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1331 call RunDbgCmd(buf, 'backtrace', [
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1332 \ '\V>backtrace',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1333 \ '\V 3 command line',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1334 \ '\V 2 script ' .. file1 .. '[11]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1335 \ '\V->1 function <SNR>\.\*_File1Func[4]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1336 \ '\V 0 script ' .. file2,
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1337 \ '\Vline 3: func s:File2Func( arg )',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1338 \ ],
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1339 \ #{ match: 'pattern' } )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1340 " FIXME: Unexpected. Should see the a: and l: dicts from File1Func
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1341 call RunDbgCmd(buf, 'echo a:arg', [ 'E121: Undefined variable: a:arg' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1342 call RunDbgCmd(buf,
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1343 \ 'echo l:local_var',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1344 \ [ 'E121: Undefined variable: l:local_var' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1345
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1346 call RunDbgCmd(buf, 'up')
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1347 call RunDbgCmd(buf, 'backtrace', [
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1348 \ '\V>backtrace',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1349 \ '\V 3 command line',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1350 \ '\V->2 script ' .. file1 .. '[11]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1351 \ '\V 1 function <SNR>\.\*_File1Func[4]',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1352 \ '\V 0 script ' .. file2,
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1353 \ '\Vline 3: func s:File2Func( arg )',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1354 \ ],
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1355 \ #{ match: 'pattern' } )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1356
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1357 " FIXME: Unexpected (wrong script vars are used)
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1358 call RunDbgCmd(buf,
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1359 \ 'echo s:file1_var',
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1360 \ [ 'E121: Undefined variable: s:file1_var' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1361 call RunDbgCmd(buf, 'echo s:file2_var', [ 'file2' ] )
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1362
24895
e61a2085c89b patch 8.2.2985: Vim9: a compiled function cannot be debugged
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
1363 call RunDbgCmd(buf, 'cont')
21687
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1364 call StopVimInTerminal(buf)
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1365 call delete('Xtest1.vim')
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1366 call delete('Xtest2.vim')
83b618c0315d patch 8.2.1393: insufficient testing for script debugging
Bram Moolenaar <Bram@vim.org>
parents: 21508
diff changeset
1367 endfunc
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21687
diff changeset
1368
21777
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1369 " Test for setting a breakpoint on a :endif where the :if condition is false
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1370 " and then quit the script. This should generate an interrupt.
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1371 func Test_breakpt_endif_intr()
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1372 func F()
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1373 let g:Xpath ..= 'a'
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1374 if v:false
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1375 let g:Xpath ..= 'b'
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1376 endif
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1377 invalid_command
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1378 endfunc
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1379
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1380 let g:Xpath = ''
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1381 breakadd func 4 F
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1382 try
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1383 let caught_intr = 0
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1384 debuggreedy
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1385 call feedkeys(":call F()\<CR>quit\<CR>", "xt")
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1386 catch /^Vim:Interrupt$/
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1387 call assert_match('\.F, line 4', v:throwpoint)
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1388 let caught_intr = 1
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1389 endtry
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1390 0debuggreedy
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1391 call assert_equal(1, caught_intr)
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1392 call assert_equal('a', g:Xpath)
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1393 breakdel *
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1394 delfunc F
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1395 endfunc
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1396
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1397 " Test for setting a breakpoint on a :else where the :if condition is false
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1398 " and then quit the script. This should generate an interrupt.
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1399 func Test_breakpt_else_intr()
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1400 func F()
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1401 let g:Xpath ..= 'a'
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1402 if v:false
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1403 let g:Xpath ..= 'b'
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1404 else
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1405 invalid_command
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1406 endif
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1407 invalid_command
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1408 endfunc
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1409
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1410 let g:Xpath = ''
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1411 breakadd func 4 F
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1412 try
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1413 let caught_intr = 0
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1414 debuggreedy
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1415 call feedkeys(":call F()\<CR>quit\<CR>", "xt")
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1416 catch /^Vim:Interrupt$/
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1417 call assert_match('\.F, line 4', v:throwpoint)
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1418 let caught_intr = 1
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1419 endtry
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1420 0debuggreedy
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1421 call assert_equal(1, caught_intr)
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1422 call assert_equal('a', g:Xpath)
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1423 breakdel *
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1424 delfunc F
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1425 endfunc
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1426
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1427 " Test for setting a breakpoint on a :endwhile where the :while condition is
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1428 " false and then quit the script. This should generate an interrupt.
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1429 func Test_breakpt_endwhile_intr()
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1430 func F()
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1431 let g:Xpath ..= 'a'
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1432 while v:false
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1433 let g:Xpath ..= 'b'
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1434 endwhile
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1435 invalid_command
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1436 endfunc
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1437
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1438 let g:Xpath = ''
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1439 breakadd func 4 F
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1440 try
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1441 let caught_intr = 0
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1442 debuggreedy
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1443 call feedkeys(":call F()\<CR>quit\<CR>", "xt")
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1444 catch /^Vim:Interrupt$/
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1445 call assert_match('\.F, line 4', v:throwpoint)
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1446 let caught_intr = 1
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1447 endtry
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1448 0debuggreedy
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1449 call assert_equal(1, caught_intr)
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1450 call assert_equal('a', g:Xpath)
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1451 breakdel *
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1452 delfunc F
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1453 endfunc
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1454
21781
99fe9e960207 patch 8.2.1440: debugger code insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21777
diff changeset
1455 " Test for setting a breakpoint on a script local function
99fe9e960207 patch 8.2.1440: debugger code insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21777
diff changeset
1456 func Test_breakpt_scriptlocal_func()
99fe9e960207 patch 8.2.1440: debugger code insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21777
diff changeset
1457 let g:Xpath = ''
99fe9e960207 patch 8.2.1440: debugger code insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21777
diff changeset
1458 func s:G()
99fe9e960207 patch 8.2.1440: debugger code insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21777
diff changeset
1459 let g:Xpath ..= 'a'
21777
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1460 endfunc
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1461
21781
99fe9e960207 patch 8.2.1440: debugger code insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21777
diff changeset
1462 let funcname = expand("<SID>") .. "G"
99fe9e960207 patch 8.2.1440: debugger code insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21777
diff changeset
1463 exe "breakadd func 1 " .. funcname
99fe9e960207 patch 8.2.1440: debugger code insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21777
diff changeset
1464 debuggreedy
99fe9e960207 patch 8.2.1440: debugger code insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21777
diff changeset
1465 redir => output
99fe9e960207 patch 8.2.1440: debugger code insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21777
diff changeset
1466 call feedkeys(":call " .. funcname .. "()\<CR>c\<CR>", "xt")
99fe9e960207 patch 8.2.1440: debugger code insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21777
diff changeset
1467 redir END
21777
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1468 0debuggreedy
21781
99fe9e960207 patch 8.2.1440: debugger code insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21777
diff changeset
1469 call assert_match('Breakpoint in "' .. funcname .. '" line 1', output)
21777
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1470 call assert_equal('a', g:Xpath)
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1471 breakdel *
21781
99fe9e960207 patch 8.2.1440: debugger code insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 21777
diff changeset
1472 exe "delfunc " .. funcname
21777
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1473 endfunc
4279767da6e8 patch 8.2.1438: missing tests for interrupting script execution from debugger
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
1474
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21687
diff changeset
1475 " vim: shiftwidth=2 sts=2 expandtab