0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.3657: Vim9: debug text misses one line of return statement

Problem:    Vim9: debug text misses one line of return statement.
Solution:   Add a line when not at a debug instruction. (closes #9137)
This commit is contained in:
Bram Moolenaar
2021-11-23 22:16:34 +00:00
parent 65259b5c6a
commit 112bed0cbe
3 changed files with 26 additions and 1 deletions

View File

@@ -373,6 +373,29 @@ def Test_Debugger_breakadd_expr()
call delete('Xtest.vim') call delete('Xtest.vim')
enddef 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() func Test_Backtrace_Through_Source()
CheckCWD CheckCWD
let file1 =<< trim END let file1 =<< trim END

View File

@@ -757,6 +757,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
3657,
/**/ /**/
3656, 3656,
/**/ /**/

View File

@@ -1602,7 +1602,7 @@ handle_debug(isn_T *iptr, ectx_T *ectx)
|| ni->isn_type == ISN_RETURN || ni->isn_type == ISN_RETURN
|| ni->isn_type == ISN_RETURN_VOID) || ni->isn_type == ISN_RETURN_VOID)
{ {
end_lnum = ni->isn_lnum; end_lnum = ni->isn_lnum + (ni->isn_type == ISN_DEBUG ? 0 : 1);
break; break;
} }