From 04d951685bcdfeb219e7fdc2fac8e6baf198e847 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 13 Nov 2023 06:35:42 +0800 Subject: vim-patch:8.2.2996: Vim9: when debugging cannot inspect local variables Problem: Vim9: when debugging cannot inspect local variables. Solution: Make local variables available when debugging. https://github.com/vim/vim/commit/b69c6fb7b423ddc4578b093cb19257cad459dfae Co-authored-by: Bram Moolenaar --- src/nvim/debugger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim') diff --git a/src/nvim/debugger.c b/src/nvim/debugger.c index 31aad11d60..9bd2238c25 100644 --- a/src/nvim/debugger.c +++ b/src/nvim/debugger.c @@ -230,7 +230,7 @@ void do_debug(char *cmd) } if (last_cmd != 0) { - // Execute debug command: decided where to break next and return. + // Execute debug command: decide where to break next and return. switch (last_cmd) { case CMD_CONT: debug_break_level = -1; -- cgit From 0bca5bff534af515a1e1e831c01bd53b0a08a56d Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 13 Nov 2023 06:42:09 +0800 Subject: vim-patch:8.2.3026: Vim9: cannot set breakpoint in compiled function Problem: Vim9: cannot set breakpoint in compiled function. Solution: Check for breakpoint when calling a function. https://github.com/vim/vim/commit/4f8f54280fa728b7d5a63b67d02b60a3b3dce543 Co-authored-by: Bram Moolenaar --- src/nvim/debugger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim') diff --git a/src/nvim/debugger.c b/src/nvim/debugger.c index 9bd2238c25..2ed8beaafb 100644 --- a/src/nvim/debugger.c +++ b/src/nvim/debugger.c @@ -550,7 +550,7 @@ static int dbg_parsearg(char *arg, garray_T *gap) } if (bp->dbg_type == DBG_FUNC) { - bp->dbg_name = xstrdup(p); + bp->dbg_name = xstrdup(strncmp(p, "g:", 2) == 0 ? p + 2 : p); } else if (here) { bp->dbg_name = xstrdup(curbuf->b_ffname); } else if (bp->dbg_type == DBG_EXPR) { -- cgit From 331d213c0b35066fb53830f9d71ebf6b9dfdce2a Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 13 Nov 2023 06:50:20 +0800 Subject: 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 --- src/nvim/debugger.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/nvim') 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". -- cgit