summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-10-26 14:28:32 +0200
committerBram Moolenaar <Bram@vim.org>2017-10-26 14:28:32 +0200
commitd99388ba8535a6fecf7d0bf7b982832c0b816062 (patch)
tree476c1942e2c2e604001ba712cfea4af8df49a0d4
parent6ce650480844bfaa5410874416b4a2e15f40b870 (diff)
patch 8.0.1217: can't use remote eval to inspect vars in debug modev8.0.1217
Problem: Can't use remote eval to inspect vars in debug mode. Solution: Don't discard the call stack in debug mode. (closes #2237, #2247)
-rw-r--r--src/ex_cmds2.c2
-rw-r--r--src/globals.h4
-rw-r--r--src/main.c10
-rw-r--r--src/version.c2
4 files changed, 14 insertions, 4 deletions
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index e9a9a6de6f..2eef050eea 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -131,6 +131,7 @@ do_debug(char_u *cmd)
redir_off = TRUE; /* don't redirect debug commands */
State = NORMAL;
+ debug_mode = TRUE;
if (!debug_did_msg)
MSG(_("Entering Debug mode. Type \"cont\" to continue."));
@@ -319,6 +320,7 @@ do_debug(char_u *cmd)
msg_scroll = save_msg_scroll;
lines_left = Rows - 1;
State = save_State;
+ debug_mode = FALSE;
did_emsg = save_did_emsg;
cmd_silent = save_cmd_silent;
msg_silent = save_msg_silent;
diff --git a/src/globals.h b/src/globals.h
index c9e6d6cd67..31bb1bd8bd 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -922,9 +922,13 @@ EXTERN char_u composing_hangul_buffer[5];
* "Visual_mode" When State is NORMAL or INSERT.
* "finish_op" When State is NORMAL, after typing the operator and before
* typing the motion command.
+ * "debug_mode" Debug mode.
*/
EXTERN int State INIT(= NORMAL); /* This is the current state of the
* command interpreter. */
+#ifdef FEAT_EVAL
+EXTERN int debug_mode INIT(= FALSE);
+#endif
EXTERN int finish_op INIT(= FALSE);/* TRUE while an operator is pending */
EXTERN long opcount INIT(= 0); /* count for pending operator */
diff --git a/src/main.c b/src/main.c
index 0dad4d6a80..0283231b04 100644
--- a/src/main.c
+++ b/src/main.c
@@ -4180,11 +4180,12 @@ eval_client_expr_to_string(char_u *expr)
char_u *res;
int save_dbl = debug_break_level;
int save_ro = redir_off;
- void *fc;
+ void *fc = NULL;
/* Evaluate the expression at the toplevel, don't use variables local to
- * the calling function. */
- fc = clear_current_funccal();
+ * the calling function. Except when in debug mode. */
+ if (!debug_mode)
+ fc = clear_current_funccal();
/* Disable debugging, otherwise Vim hangs, waiting for "cont" to be
* typed. */
@@ -4201,7 +4202,8 @@ eval_client_expr_to_string(char_u *expr)
--emsg_silent;
if (emsg_silent < 0)
emsg_silent = 0;
- restore_current_funccal(fc);
+ if (fc != NULL)
+ restore_current_funccal(fc);
/* A client can tell us to redraw, but not to display the cursor, so do
* that here. */
diff --git a/src/version.c b/src/version.c
index 3668e30248..a84c8e26ce 100644
--- a/src/version.c
+++ b/src/version.c
@@ -762,6 +762,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1217,
+/**/
1216,
/**/
1215,