summaryrefslogtreecommitdiff
path: root/src/vim9compile.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-06-23 20:20:53 +0200
committerBram Moolenaar <Bram@vim.org>2021-06-23 20:20:53 +0200
commit8cec9273d2518f2a9abcbd326722a2eba38d2a13 (patch)
tree95673759140d5412142059b1332076e0973fa883 /src/vim9compile.c
parentcc6504098605f894b557109b618e88913a89914b (diff)
downloadvim-git-8cec9273d2518f2a9abcbd326722a2eba38d2a13.tar.gz
patch 8.2.3039: Vim9: breakpoint at a comment line does not workv8.2.3039
Problem: Vim9: breakpoint at a comment line does not work. Solution: Add the comment line number to the debug instruction. (closes #8429)
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r--src/vim9compile.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c
index c5a2c2dcf..e78a032cb 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -174,6 +174,9 @@ struct cctx_S {
char_u *ctx_line_start; // start of current line or NULL
garray_T ctx_instr; // generated instructions
+ int ctx_prev_lnum; // line number below previous command, for
+ // debugging
+
compiletype_T ctx_compile_type;
garray_T ctx_locals; // currently visible local variables
@@ -585,7 +588,8 @@ generate_instr_debug(cctx_T *cctx)
if ((isn = generate_instr(cctx, ISN_DEBUG)) == NULL)
return NULL;
- isn->isn_arg.number = dfunc->df_var_names.ga_len;
+ isn->isn_arg.debug.dbg_var_names_len = dfunc->df_var_names.ga_len;
+ isn->isn_arg.debug.dbg_break_lnum = cctx->ctx_prev_lnum;
return isn;
}
@@ -9270,6 +9274,7 @@ compile_def_function(
debug_lnum = cctx.ctx_lnum;
generate_instr_debug(&cctx);
}
+ cctx.ctx_prev_lnum = cctx.ctx_lnum + 1;
// Some things can be recognized by the first character.
switch (*ea.cmd)