Mercurial > octave
diff libinterp/corefcn/debug.cc @ 27205:6648d1ae05fe
eliminate direct access to call stack in debug functions
* debug.cc (Fdbwhere, Fdblist, do_dbstack, do_dbupdown):
Eliminate direct access to call stack.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 01 Apr 2019 18:28:44 +0000 |
parents | 8408acb7ca4f |
children | f5b967060442 |
line wrap: on
line diff
--- a/libinterp/corefcn/debug.cc Mon Apr 01 18:21:27 2019 +0000 +++ b/libinterp/corefcn/debug.cc Mon Apr 01 18:28:44 2019 +0000 @@ -36,7 +36,6 @@ #include "dNDArray.h" #include "bp-table.h" -#include "call-stack.h" #include "defun.h" #include "error.h" #include "errwarn.h" @@ -567,11 +566,9 @@ @seealso{dbstack, dblist, dbstatus, dbcont, dbstep, dbup, dbdown} @end deftypefn */) { - octave::call_stack& cs = interp.get_call_stack (); + octave::tree_evaluator& tw = interp.get_evaluator (); - octave::stack_frame *frm = cs.current_user_frame (); - - frm->display_stopped_in_message (octave_stdout); + tw.debug_where (octave_stdout); return ovl (); } @@ -805,9 +802,7 @@ name = dbg_fcn->name (); } - octave::call_stack& cs = interp.get_call_stack (); - - int l = cs.debug_user_code_line (); + int l = tw.debug_user_code_line (); if (l > 0) { @@ -880,11 +875,11 @@ nskip = n; } - octave::call_stack& cs = interp.get_call_stack (); + octave::tree_evaluator& tw = interp.get_evaluator (); if (nargout == 0) { - octave_map stk = cs.backtrace (curr_frame); + octave_map stk = tw.backtrace (curr_frame); octave_idx_type nframes = stk.numel (); if (nframes > 0) @@ -924,13 +919,13 @@ << std::endl; } - if (cs.at_top_level () && show_top_level) + if (tw.at_top_level () && show_top_level) os << " --> top level" << std::endl; } } else { - octave_map stk = cs.backtrace (curr_frame, false); + octave_map stk = tw.backtrace (curr_frame, false); // If current stack frame is not in the list curr_frame will be // -1 and either nskip caused us to skip it or we are at the top