changeset 16127:f7eb13f14320

avoid using unwind_protect::run * input.cc (get_debug_input): Use separate frame to restore global command and symbol table state.
author John W. Eaton <jwe@octave.org>
date Tue, 26 Feb 2013 15:23:27 -0500
parents 5c885c13bfa3
children 210039e91ad6
files libinterp/interpfcn/input.cc
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/interpfcn/input.cc	Tue Feb 26 15:13:43 2013 -0500
+++ b/libinterp/interpfcn/input.cc	Tue Feb 26 15:23:27 2013 -0500
@@ -684,19 +684,21 @@
 
   while (Vdebugging)
     {
+      unwind_protect middle_frame;
+
       reset_error_handler ();
 
       curr_lexer->reset_parser ();
 
       // Save current value of global_command.
-      frame.protect_var (global_command);
+      middle_frame.protect_var (global_command);
 
       global_command = 0;
 
       // Do this with an unwind-protect cleanup function so that the
       // forced variables will be unmarked in the event of an interrupt.
       symbol_table::scope_id scope = symbol_table::top_scope ();
-      frame.add_fcn (symbol_table::unmark_forced_variables, scope);
+      middle_frame.add_fcn (symbol_table::unmark_forced_variables, scope);
 
       int retval = octave_parse_input ();
 
@@ -716,10 +718,6 @@
             octave_completion_matches_called = false;
         }
 
-      // Unmark forced variables.
-      // Restore previous value of global_command.
-      frame.run (2);
-
       octave_quit ();
     }
 }