]> granicus.if.org Git - vim/commitdiff
patch 8.0.1217: can't use remote eval to inspect vars in debug mode v8.0.1217
authorBram Moolenaar <Bram@vim.org>
Thu, 26 Oct 2017 12:28:32 +0000 (14:28 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 26 Oct 2017 12:28:32 +0000 (14:28 +0200)
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)

src/ex_cmds2.c
src/globals.h
src/main.c
src/version.c

index e9a9a6de6fdd3fc96a6752f25dfbf047d5c3ae2a..2eef050eea9884ba9a98224ed1a08574fdc78ecd 100644 (file)
@@ -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;
index c9e6d6cd67a18e67daf462aab2f5919381d91a82..31bb1bd8bda3b5e208c1e502695bb2f3e240f0eb 100644 (file)
@@ -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 */
index 0dad4d6a804ecb181176efc9af92665b881af9ff..0283231b04cc4b232d321aec221dd41f31cb31a6 100644 (file)
@@ -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. */
index 3668e3024866cf9d6051a9e9589504f1ce6ee7c1..a84c8e26ce1b27c579feea6844f9916f7dd09fe6 100644 (file)
@@ -761,6 +761,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1217,
 /**/
     1216,
 /**/