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
|| ni->isn_type == ISN_RETURN
|| ni->isn_type == ISN_RETURN_VOID)
{
- end_lnum = ni->isn_lnum;
+ end_lnum = ni->isn_lnum + (ni->isn_type == ISN_DEBUG ? 0 : 1);
break;
}