# HG changeset patch # User John W. Eaton # Date 1554140844 0 # Node ID 23962b243bad6ab7bde932d8be435639186f4a2d # Parent bd49997051efb40a3f1497c603f27f2fa42b21d6 eliminate direct access to call stack in help functions * pt-eval.h, pt-eval.cc (tree_evaluator::debug_user_code): New function. * help.cc (help_system::local_functions, Flocalfunctions): Eliminate direct access to call stack. diff -r bd49997051ef -r 23962b243bad libinterp/corefcn/help.cc --- a/libinterp/corefcn/help.cc Mon Apr 01 17:39:42 2019 +0000 +++ b/libinterp/corefcn/help.cc Mon Apr 01 17:47:24 2019 +0000 @@ -44,7 +44,6 @@ #include "Cell.h" #include "builtin-defun-decls.h" -#include "call-stack.h" #include "defaults.h" #include "defun.h" #include "dirfns.h" @@ -487,9 +486,9 @@ { string_vector retval; - call_stack& cs = m_interpreter.get_call_stack (); + tree_evaluator& tw = m_interpreter.get_evaluator (); - octave_user_code *curr_fcn = cs.current_user_code (); + octave_user_code *curr_fcn = tw.current_user_code (); if (! curr_fcn) return retval; @@ -812,8 +811,8 @@ Cell retval; // Find the main function we are in. - octave::call_stack& cs = interp.get_call_stack (); - octave_user_code *parent_fcn = cs.debug_user_code (); + octave::tree_evaluator& tw = interp.get_evaluator (); + octave_user_code *parent_fcn = tw.debug_user_code (); if (! parent_fcn) return ovl (retval); diff -r bd49997051ef -r 23962b243bad libinterp/parse-tree/pt-eval.cc --- a/libinterp/parse-tree/pt-eval.cc Mon Apr 01 17:39:42 2019 +0000 +++ b/libinterp/parse-tree/pt-eval.cc Mon Apr 01 17:47:24 2019 +0000 @@ -1881,6 +1881,11 @@ return m_call_stack.current_user_code (); } + octave_user_code * tree_evaluator::debug_user_code (void) const + { + return m_call_stack.debug_user_code (); + } + octave_function * tree_evaluator::current_function (void) const { return m_call_stack.current (); diff -r bd49997051ef -r 23962b243bad libinterp/parse-tree/pt-eval.h --- a/libinterp/parse-tree/pt-eval.h Mon Apr 01 17:39:42 2019 +0000 +++ b/libinterp/parse-tree/pt-eval.h Mon Apr 01 17:47:24 2019 +0000 @@ -495,6 +495,9 @@ octave_user_code * caller_user_code (size_t nskip = 0) const; + // Current function that we are debugging. + octave_user_code * debug_user_code (void) const; + octave_function * current_function (void) const; bool goto_frame (size_t n = 0, bool verbose = false);