1
0
forked from aniani/vim

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)
This commit is contained in:
Bram Moolenaar
2021-09-02 18:49:06 +02:00
parent 04626c243c
commit 26a4484da2
8 changed files with 75 additions and 5 deletions

View File

@@ -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