Mercurial > vim
comparison src/testdir/test_debugger.vim @ 28033:73f4d1e479f2 v8.2.4541
patch 8.2.4541: Crash in debugger when a variable is not available
Commit: https://github.com/vim/vim/commit/e406ff87c86de9da2d02d0e5ebbbf5c5eac051a6
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Mar 10 20:47:43 2022 +0000
patch 8.2.4541: Crash in debugger when a variable is not available
Problem: Crash in debugger when a variable is not available in the current
block.
Solution: Check for a NULL name. (closes #9926)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 10 Mar 2022 22:00:04 +0100 |
parents | 4c16acb2525f |
children | 35e24d9de858 |
comparison
equal
deleted
inserted
replaced
28032:8b90d89c9bdd | 28033:73f4d1e479f2 |
---|---|
71 catch | 71 catch |
72 let var4 = "exception" | 72 let var4 = "exception" |
73 endtry | 73 endtry |
74 return var1 | 74 return var1 |
75 endfunc | 75 endfunc |
76 def Vim9Func() | |
77 for cmd in ['confirm', 'xxxxxxx'] | |
78 for _ in [1, 2] | |
79 echo cmd | |
80 endfor | |
81 endfor | |
82 enddef | |
76 END | 83 END |
77 call writefile(lines, 'Xtest.vim') | 84 call writefile(lines, 'Xtest.vim') |
78 | 85 |
79 " Start Vim in a terminal | 86 " Start Vim in a terminal |
80 let buf = RunVimInTerminal('-S Xtest.vim', {}) | 87 let buf = RunVimInTerminal('-S Xtest.vim', {}) |
295 call RunDbgCmd(buf, 'interrupt', [ | 302 call RunDbgCmd(buf, 'interrupt', [ |
296 \ 'Exception thrown: Vim:Interrupt', | 303 \ 'Exception thrown: Vim:Interrupt', |
297 \ 'function Bazz', | 304 \ 'function Bazz', |
298 \ 'line 5: catch']) | 305 \ 'line 5: catch']) |
299 call RunDbgCmd(buf, 'c') | 306 call RunDbgCmd(buf, 'c') |
307 | |
308 " Test showing local variable in :def function | |
309 call RunDbgCmd(buf, ':breakadd func 2 Vim9Func') | |
310 call RunDbgCmd(buf, ':call Vim9Func()', ['line 2: for _ in [1, 2]']) | |
311 call RunDbgCmd(buf, 'next', ['line 2: for _ in [1, 2]']) | |
312 call RunDbgCmd(buf, 'echo cmd', ['confirm']) | |
313 call RunDbgCmd(buf, 'breakdel *') | |
314 call RunDbgCmd(buf, 'cont') | |
300 | 315 |
301 " Test for :quit | 316 " Test for :quit |
302 call RunDbgCmd(buf, ':debug echo Foo()') | 317 call RunDbgCmd(buf, ':debug echo Foo()') |
303 call RunDbgCmd(buf, 'breakdel *') | 318 call RunDbgCmd(buf, 'breakdel *') |
304 call RunDbgCmd(buf, 'breakadd func 3 Foo') | 319 call RunDbgCmd(buf, 'breakadd func 3 Foo') |