summaryrefslogtreecommitdiffstats
path: root/src/debugger.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-09-02 18:49:06 +0200
committerBram Moolenaar <Bram@vim.org>2021-09-02 18:49:06 +0200
commit26a4484da20039b61f18d3565a4b4339c4d1f7e3 (patch)
tree36b3d0dada37e17686da0627af5cda5848658052 /src/debugger.c
parent04626c243c47af91c2580eaf23e12286180e0e81 (diff)
patch 8.2.3395: Vim9: expression breakpoint not checked in :def functionv8.2.3395
Problem: Vim9: expression breakpoint not checked in :def function. Solution: Always compile a function for debugging if there is an expression breakpoint. (closes #8803)
Diffstat (limited to 'src/debugger.c')
-rw-r--r--src/debugger.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/debugger.c b/src/debugger.c
index 1b01998759..1e28d66f61 100644
--- a/src/debugger.c
+++ b/src/debugger.c
@@ -518,6 +518,7 @@ static garray_T dbg_breakp = {0, 0, sizeof(struct debuggy), 4, NULL};
#define BREAKP(idx) (((struct debuggy *)dbg_breakp.ga_data)[idx])
#define DEBUGGY(gap, idx) (((struct debuggy *)gap->ga_data)[idx])
static int last_breakp = 0; // nr of last defined breakpoint
+static int has_expr_breakpoint = FALSE;
#ifdef FEAT_PROFILE
// Profiling uses file and func names similar to breakpoints.
@@ -691,6 +692,8 @@ ex_breakadd(exarg_T *eap)
// DBG_EXPR
DEBUGGY(gap, gap->ga_len++).dbg_nr = ++last_breakp;
++debug_tick;
+ if (gap == &dbg_breakp)
+ has_expr_breakpoint = TRUE;
}
}
}
@@ -707,6 +710,29 @@ ex_debuggreedy(exarg_T *eap)
debug_greedy = FALSE;
}
+ static void
+update_has_expr_breakpoint()
+{
+ int i;
+
+ has_expr_breakpoint = FALSE;
+ for (i = 0; i < dbg_breakp.ga_len; ++i)
+ if (BREAKP(i).dbg_type == DBG_EXPR)
+ {
+ has_expr_breakpoint = TRUE;
+ break;
+ }
+}
+
+/*
+ * Return TRUE if there is any expression breakpoint.
+ */
+ int
+debug_has_expr_breakpoint()
+{
+ return has_expr_breakpoint;
+}
+
/*
* ":breakdel" and ":profdel".
*/
@@ -799,6 +825,8 @@ ex_breakdel(exarg_T *eap)
// If all breakpoints were removed clear the array.
if (gap->ga_len == 0)
ga_clear(gap);
+ if (gap == &dbg_breakp)
+ update_has_expr_breakpoint();
}
}