aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/debugger.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-11-13 07:24:08 +0800
committerGitHub <noreply@github.com>2023-11-13 07:24:08 +0800
commitd65c574ca31b452fe5538e1aebf288fd4b7290dd (patch)
tree04a2002cac484e7d75fe98a7d4a59865a4c0ea4c /src/nvim/debugger.c
parent03c3f7887dbc26c4246ea2eeb135453f3f3ee000 (diff)
parentd064f557041cddc11a60d27e2bfc6977a7e4e43b (diff)
downloadrneovim-d65c574ca31b452fe5538e1aebf288fd4b7290dd.tar.gz
rneovim-d65c574ca31b452fe5538e1aebf288fd4b7290dd.tar.bz2
rneovim-d65c574ca31b452fe5538e1aebf288fd4b7290dd.zip
Merge pull request #26016 from zeertzjq/vim-8.2.2985
vim-patch:8.2.{2985,2996,3003,3011,3013,3017,3026,3027,3039,3066,3086,3096,3116,3138,3395,3984,4020,4541}
Diffstat (limited to 'src/nvim/debugger.c')
-rw-r--r--src/nvim/debugger.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/nvim/debugger.c b/src/nvim/debugger.c
index 31aad11d60..bfb15d59f5 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;
@@ -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 };
@@ -550,7 +551,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) {
@@ -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".