diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-11-13 06:50:20 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-11-13 06:55:58 +0800 |
commit | 331d213c0b35066fb53830f9d71ebf6b9dfdce2a (patch) | |
tree | 73cee90e204b33cc60a93b67daede7e502e4d0d0 /src/nvim/debugger.c | |
parent | 49d126e005211d6fbe54bccff9aa0f0e1eeefcef (diff) | |
download | rneovim-331d213c0b35066fb53830f9d71ebf6b9dfdce2a.tar.gz rneovim-331d213c0b35066fb53830f9d71ebf6b9dfdce2a.tar.bz2 rneovim-331d213c0b35066fb53830f9d71ebf6b9dfdce2a.zip |
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 vim/vim#8803)
https://github.com/vim/vim/commit/26a4484da20039b61f18d3565a4b4339c4d1f7e3
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/debugger.c')
-rw-r--r-- | src/nvim/debugger.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nvim/debugger.c b/src/nvim/debugger.c index 2ed8beaafb..bfb15d59f5 100644 --- a/src/nvim/debugger.c +++ b/src/nvim/debugger.c @@ -475,6 +475,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 bool has_expr_breakpoint = false; // Profiling uses file and func names similar to breakpoints. static garray_T prof_ga = { 0, 0, sizeof(struct debuggy), 4, NULL }; @@ -620,6 +621,9 @@ void 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; + } } } @@ -633,6 +637,17 @@ void ex_debuggreedy(exarg_T *eap) } } +static void update_has_expr_breakpoint(void) +{ + has_expr_breakpoint = false; + for (int i = 0; i < dbg_breakp.ga_len; i++) { + if (BREAKP(i).dbg_type == DBG_EXPR) { + has_expr_breakpoint = true; + break; + } + } +} + /// ":breakdel" and ":profdel". void ex_breakdel(exarg_T *eap) { @@ -708,6 +723,9 @@ void ex_breakdel(exarg_T *eap) if (GA_EMPTY(gap)) { ga_clear(gap); } + if (gap == &dbg_breakp) { + update_has_expr_breakpoint(); + } } /// ":breaklist". |