diff src/vim9execute.c @ 25719:154663508d9b v8.2.3395

patch 8.2.3395: Vim9: expression breakpoint not checked in :def function Commit: https://github.com/vim/vim/commit/26a4484da20039b61f18d3565a4b4339c4d1f7e3 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 2 18:49:06 2021 +0200 patch 8.2.3395: Vim9: expression breakpoint not checked in :def function Problem: Vim9: expression breakpoint not checked in :def function. Solution: Always compile a function for debugging if there is an expression breakpoint. (closes #8803)
author Bram Moolenaar <Bram@vim.org>
date Thu, 02 Sep 2021 19:00:04 +0200
parents f8bcd21e6e24
children f31cf0388eab
line wrap: on
line diff
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -1483,6 +1483,16 @@ lookup_debug_var(char_u *name)
     return NULL;
 }
 
+/*
+ * Return TRUE if there might be a breakpoint in "ufunc", which is when a
+ * breakpoint was set in that function or when there is any expression.
+ */
+    int
+may_break_in_function(ufunc_T *ufunc)
+{
+    return ufunc->uf_has_breakpoint || debug_has_expr_breakpoint();
+}
+
     static void
 handle_debug(isn_T *iptr, ectx_T *ectx)
 {
@@ -1498,7 +1508,7 @@ handle_debug(isn_T *iptr, ectx_T *ectx)
     {
 	linenr_T breakpoint;
 
-	if (!ufunc->uf_has_breakpoint)
+	if (!may_break_in_function(ufunc))
 	    return;
 
 	// check for the next breakpoint if needed