patch 8.2.3027: Vim9: breakpoint in compiled function not always checked
Problem: Vim9: breakpoint in compiled function not always checked.
Solution: Check for breakpoint when calling compiled function from compiled
function.
diff --git a/src/testdir/test_debugger.vim b/src/testdir/test_debugger.vim
index a576a8c..81e8658 100644
--- a/src/testdir/test_debugger.vim
+++ b/src/testdir/test_debugger.vim
@@ -940,7 +940,22 @@
echo "here"
echo "and"
echo "there"
+ breakadd func 2 LocalFunc
+ LocalFunc()
enddef
+
+ def LocalFunc()
+ echo "first"
+ echo "second"
+ breakadd func 1 LegacyFunc
+ LegacyFunc()
+ enddef
+
+ func LegacyFunc()
+ echo "legone"
+ echo "legtwo"
+ endfunc
+
breakadd func 2 g:SomeFunc
END
call writefile(file, 'XtestDebug.vim')
@@ -949,6 +964,13 @@
call RunDbgCmd(buf,':call SomeFunc()', ['line 2: echo "and"'])
call RunDbgCmd(buf,'next', ['line 3: echo "there"'])
+ call RunDbgCmd(buf,'next', ['line 4: breakadd func 2 LocalFunc'])
+
+ " continue, next breakpoint is in LocalFunc()
+ call RunDbgCmd(buf,'cont', ['line 2: echo "second"'])
+
+ " continue, next breakpoint is in LegacyFunc()
+ call RunDbgCmd(buf,'cont', ['line 1: echo "legone"'])
call RunDbgCmd(buf, 'cont')
diff --git a/src/version.c b/src/version.c
index 6fe8fa4..58d99e8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -756,6 +756,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 3027,
+/**/
3026,
/**/
3025,
diff --git a/src/vim9execute.c b/src/vim9execute.c
index 8b817e4..dfceb27 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -229,6 +229,9 @@
}
#endif
+ // Update uf_has_breakpoint if needed.
+ update_has_breakpoint(ufunc);
+
// When debugging and using "cont" switches to the not-debugged
// instructions, may need to still compile them.
if ((func_needs_compiling(ufunc, COMPILE_TYPE(ufunc))