26 #if ! defined (octave_call_stack_h)
27 #define octave_call_stack_h 1
29 #include "octave-config.h"
78 return current_function (
true);
82 int current_line ()
const;
85 int current_column ()
const;
89 std::size_t
size ()
const {
return m_cs.size (); }
93 return m_cs[m_curr_frame];
98 return m_cs[0]->get_scope ();
104 return (m_curr_frame < m_cs.size ()
110 return current_scope () == top_scope ();
119 if (m_cs.size () >
n)
120 retval = m_cs[
n]->function ();
131 int current_user_code_line ()
const;
134 int current_user_code_column ()
const;
140 int debug_user_code_line ()
const;
143 int debug_user_code_column ()
const;
145 std::string get_dispatch_class ()
const;
147 void set_dispatch_class (
const std::string& class_name);
149 bool is_class_method_executing (std::string& dispatch_class)
const;
151 bool is_class_constructor_executing (std::string& dispatch_class)
const;
154 bool all_scripts ()
const;
159 const std::shared_ptr<stack_frame>& closure_frames = std::shared_ptr<stack_frame> ());
163 const std::shared_ptr<stack_frame>& closure_frames = std::shared_ptr<stack_frame> ());
173 std::shared_ptr<stack_frame> elt = m_cs.back ();
184 std::shared_ptr<stack_frame> elt = m_cs.back ();
194 std::shared_ptr<stack_frame> elt = m_cs.back ();
200 bool goto_frame (std::size_t
n = 0,
bool verbose =
false);
207 std::size_t find_current_user_frame ()
const;
209 std::shared_ptr<stack_frame> current_user_frame ()
const;
211 std::size_t dbupdown (std::size_t start,
int n,
bool verbose);
212 std::size_t dbupdown (
int n = -1,
bool verbose =
false);
214 void goto_caller_frame ();
216 void goto_base_frame ();
218 std::list<std::shared_ptr<stack_frame>>
223 std::list<std::shared_ptr<stack_frame>> backtrace_frames ()
const;
228 std::list<frame_info> backtrace_info (
octave_idx_type& curr_user_frame,
229 bool print_subfn =
true)
const;
231 std::list<frame_info> backtrace_info ()
const;
237 bool print_subfn =
true)
const;
245 std::shared_ptr<stack_frame> pop_return ();
251 std::list<std::string> global_variable_names ()
const;
253 std::list<std::string> top_level_variable_names ()
const;
255 std::list<std::string> variable_names ()
const;
257 void clear_global_variable (
const std::string& name);
259 void clear_global_variable_pattern (
const std::string& pattern);
261 void clear_global_variable_regexp(
const std::string& pattern);
263 void clear_global_variables ();
279 octave_value global_varval (
const std::string& name)
const;
283 octave_value get_top_level_value (
const std::string& name)
const;
285 void set_top_level_value (
const std::string& name,
289 bool return_list,
bool verbose =
false);
292 bool return_list,
bool verbose,
293 const std::string& msg =
"");
296 bool have_regexp,
bool return_list,
297 bool verbose,
const std::string& msg =
"");
299 void display ()
const;
304 void set_nargin (
int nargin);
305 void set_nargout (
int nargout);
311 void get_new_frame_index_and_links
312 (std::size_t& new_frame_idx, std::shared_ptr<stack_frame>& parent_link,
313 std::shared_ptr<stack_frame>& static_link)
const;
327 std::size_t m_curr_frame;
329 int m_max_stack_depth;
331 std::map<std::string, octave_value> m_global_values;
334 OCTAVE_END_NAMESPACE(
octave)
octave_function * caller_function() const
stack_frames::const_reverse_iterator const_reverse_iterator
stack_frames::iterator iterator
octave_function * element(std::size_t n)
void restore_frame(std::size_t n)
bool at_top_level() const
std::size_t current_frame() const
void set_location(int l, int c)
symbol_scope current_scope() const
std::shared_ptr< stack_frame > get_current_stack_frame() const
std::deque< std::shared_ptr< stack_frame > > stack_frames
stack_frames::const_iterator const_iterator
symbol_scope top_scope() const
stack_frames::reverse_iterator reverse_iterator
std::map< std::string, octave_value > local_vars_map
static symbol_scope invalid()
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn