Mercurial > hg > octave-lojdl
changeset 10186:095a1e670e68
make dbstep work with keyboard function
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 22 Jan 2010 07:30:44 -0500 |
parents | 455759a5fcbe |
children | a44d15813a39 |
files | src/ChangeLog src/debug.cc src/input.cc src/pt-eval.cc src/pt-eval.h src/toplev.cc |
diffstat | 6 files changed, 35 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,15 @@ +2010-01-22 John W. Eaton <jwe@octave.org> + + * debug.cc (Fdbcont, Fdbquit): Call reset_debug_state. + (Fdbquit): Set Vdebugging to false. + * input.cc (Fkeyboard): Set tree_evaluator::debug_state to true. + Set tree_evaluator::current_frame to the initial stack frame + that is active for debugging commands. + * pt-eval.cc (tree_evaluator::reset_debug_state): New function. + * pt-eval.h (tree_evaluator::reset_debug_state): Provide decl. + * toplev.cc (main_loop): Call tree_evaluator::reset_debug_state + if at top level. + 2010-01-22 Jaroslav Hajek <highegg@gmail.com> * data.cc (Fnorm): Don't special-case empty matrix.
--- a/src/debug.cc +++ b/src/debug.cc @@ -1075,7 +1075,7 @@ { Vdebugging = false; - tree_evaluator::dbstep_flag = 0; + tree_evaluator::reset_debug_state (); } else print_usage (); @@ -1097,7 +1097,9 @@ { if (args.length () == 0) { - tree_evaluator::dbstep_flag = 0; + Vdebugging = false; + + tree_evaluator::reset_debug_state (); octave_throw_interrupt_exception (); }
--- a/src/input.cc +++ b/src/input.cc @@ -1011,12 +1011,17 @@ if (nargin == 0 || nargin == 1) { unwind_protect frame; + frame.add_fcn (octave_call_stack::restore_frame, octave_call_stack::current_frame ()); // Skip the frame assigned to the keyboard function. octave_call_stack::goto_frame_relative (0); + tree_evaluator::debug_mode = true; + + tree_evaluator::current_frame = octave_call_stack::current_frame (); + do_keyboard (args); } else
--- a/src/pt-eval.cc +++ b/src/pt-eval.cc @@ -31,6 +31,7 @@ #include <fstream> #include <typeinfo> +#include "debug.h" #include "defun.h" #include "error.h" #include "gripes.h" @@ -106,6 +107,14 @@ tree_continue_command::continuing = 1; } +void +tree_evaluator::reset_debug_state (void) +{ + debug_mode = bp_table::have_breakpoints (); + + dbstep_flag = 0; +} + static inline void do_global_init (tree_decl_elt& elt) {