# HG changeset patch # User John W. Eaton # Date 1364608857 14400 # Node ID c6a13c1900fc8fabcd6407c1e323a5fc58e3c2a9 # Parent fc491da603f66e6da64ab8929f0a6e2e64d89973 make "dbstep out" and "dbstep" after "dbstep in" work properly * pt-eval.cc (tree_evaluator::do_breakpoint): Recognize case of stepping into a parent frame. When stepping out, don't break unless at end of function in frame in which "dbstep out" command was issued. diff --git a/libinterp/parse-tree/pt-eval.cc b/libinterp/parse-tree/pt-eval.cc --- a/libinterp/parse-tree/pt-eval.cc +++ b/libinterp/parse-tree/pt-eval.cc @@ -1179,6 +1179,17 @@ } } + else if (dbstep_flag == 1 + && octave_call_stack::current_frame () < current_frame) + { + // We stepped out from the end of a function. + + current_frame = octave_call_stack::current_frame (); + + break_on_this_statement = true; + + dbstep_flag = 0; + } } else if (dbstep_flag == -1) { @@ -1192,9 +1203,14 @@ } else if (dbstep_flag == -2) { - // We get here if we are doing a "dbstep out". + // We get here if we are doing a "dbstep out". Check for end of + // function and whether the current frame is the same as the + // cached value because we want to step out from the frame where + // "dbstep out" was evaluated, not from any functions called from + // that frame. - if (is_end_of_fcn_or_script) + if (is_end_of_fcn_or_script + && octave_call_stack::current_frame () == current_frame) dbstep_flag = -1; }