comparison src/testdir/test_vim9_disassemble.vim @ 26905:c2186e32ae42 v8.2.3981

patch 8.2.3981: Vim9: debugging a for loop doesn't stop before it starts Commit: https://github.com/vim/vim/commit/2b4ecc2c31c00df6e1c8ad46a3e4eabb1f1f84e3 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 2 14:08:18 2022 +0000 patch 8.2.3981: Vim9: debugging a for loop doesn't stop before it starts Problem: Vim9: debugging a for loop doesn't stop before it starts. Solution: Keep the DEBUG instruction before the expression is evaluated. (closes #9456)
author Bram Moolenaar <Bram@vim.org>
date Sun, 02 Jan 2022 15:15:03 +0100
parents 47ad45fb433a
children 7045e9308ca3
comparison
equal deleted inserted replaced
26904:06cc23a34556 26905:c2186e32ae42
2432 '19 DEBUG line 6-6 varcount 1\_s*' .. 2432 '19 DEBUG line 6-6 varcount 1\_s*' ..
2433 '20 RETURN void*', 2433 '20 RETURN void*',
2434 res) 2434 res)
2435 enddef 2435 enddef
2436 2436
2437 def s:DebugFor()
2438 echo "hello"
2439 for a in [0]
2440 echo a
2441 endfor
2442 enddef
2443
2444 def Test_debug_for()
2445 var res = execute('disass debug s:DebugFor')
2446 assert_match('<SNR>\d*_DebugFor\_s*' ..
2447 'echo "hello"\_s*' ..
2448 '0 DEBUG line 1-1 varcount 0\_s*' ..
2449 '1 PUSHS "hello"\_s*' ..
2450 '2 ECHO 1\_s*' ..
2451
2452 'for a in \[0\]\_s*' ..
2453 '3 DEBUG line 2-2 varcount 0\_s*' ..
2454 '4 STORE -1 in $0\_s*' ..
2455 '5 PUSHNR 0\_s*' ..
2456 '6 NEWLIST size 1\_s*' ..
2457 '7 DEBUG line 2-2 varcount 2\_s*' ..
2458 '8 FOR $0 -> 15\_s*' ..
2459 '9 STORE $1\_s*' ..
2460
2461 'echo a\_s*' ..
2462 '10 DEBUG line 3-3 varcount 2\_s*' ..
2463 '11 LOAD $1\_s*' ..
2464 '12 ECHO 1\_s*' ..
2465
2466 'endfor\_s*' ..
2467 '13 DEBUG line 4-4 varcount 2\_s*' ..
2468 '14 JUMP -> 7\_s*' ..
2469 '15 DROP\_s*' ..
2470 '16 RETURN void*',
2471 res)
2472 enddef
2473
2437 func Legacy() dict 2474 func Legacy() dict
2438 echo 'legacy' 2475 echo 'legacy'
2439 endfunc 2476 endfunc
2440 2477
2441 def s:UseMember() 2478 def s:UseMember()