To: vim_dev@googlegroups.com Subject: Patch 8.2.3657 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3657 Problem: Vim9: debug text misses one line of return statement. Solution: Add a line when not at a debug instruction. (closes #9137) Files: src/vim9execute.c, src/testdir/test_debugger.vim *** ../vim-8.2.3656/src/vim9execute.c 2021-10-17 17:20:20.399745698 +0100 --- src/vim9execute.c 2021-11-23 19:54:50.595715950 +0000 *************** *** 1602,1608 **** || ni->isn_type == ISN_RETURN || ni->isn_type == ISN_RETURN_VOID) { ! end_lnum = ni->isn_lnum; break; } --- 1602,1608 ---- || ni->isn_type == ISN_RETURN || ni->isn_type == ISN_RETURN_VOID) { ! end_lnum = ni->isn_lnum + (ni->isn_type == ISN_DEBUG ? 0 : 1); break; } *** ../vim-8.2.3656/src/testdir/test_debugger.vim 2021-11-21 11:35:59.456938797 +0000 --- src/testdir/test_debugger.vim 2021-11-23 19:54:04.655796141 +0000 *************** *** 373,378 **** --- 373,401 ---- call delete('Xtest.vim') enddef + def Test_Debugger_break_at_return() + var lines =<< trim END + vim9script + def g:GetNum(): number + return 1 + + 2 + + 3 + enddef + breakadd func GetNum + END + writefile(lines, 'Xtest.vim') + + # Start Vim in a terminal + var buf = RunVimInTerminal('-S Xtest.vim', {wait_for_ruler: 0}) + call TermWait(buf) + + RunDbgCmd(buf, ':call GetNum()', + ['line 1: return 1 + 2 + 3'], {match: 'pattern'}) + + call StopVimInTerminal(buf) + call delete('Xtest.vim') + enddef + func Test_Backtrace_Through_Source() CheckCWD let file1 =<< trim END *** ../vim-8.2.3656/src/version.c 2021-11-23 14:52:03.033446446 +0000 --- src/version.c 2021-11-23 19:47:38.260566400 +0000 *************** *** 759,760 **** --- 759,762 ---- { /* Add new patch number below this line */ + /**/ + 3657, /**/ -- Kisses may last for as much as, but no more than, five minutes. [real standing law in Iowa, United States of America] /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///