GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
call_stack Class Reference

#include "call-stack.h"

Collaboration diagram for call_stack:

Public Types

typedef stack_frames::const_iterator const_iterator
 
typedef stack_frames::const_reverse_iterator const_reverse_iterator
 
typedef stack_frames::iterator iterator
 
typedef stack_frames::reverse_iterator reverse_iterator
 
typedef std::deque< std::shared_ptr< stack_frame > > stack_frames
 

Public Member Functions

 call_stack (tree_evaluator &evaluator)
 
bool all_scripts (void) const
 
symbol_info_list all_variables (void)
 
bool at_top_level (void) const
 
octave_map backtrace (octave_idx_type &curr_user_frame, bool print_subfn=true) const
 
octave_map backtrace (void) const
 
std::list< std::shared_ptr< stack_frame > > backtrace_frames (octave_idx_type &curr_user_frame) const
 
std::list< std::shared_ptr< stack_frame > > backtrace_frames (void) const
 
std::list< frame_info > backtrace_info (octave_idx_type &curr_user_frame, bool print_subfn=true) const
 
std::list< frame_info > backtrace_info (void) const
 
octave_functioncaller_function (void) const
 
void clear (void)
 
void clear_global_variable (const std::string &name)
 
void clear_global_variable_pattern (const std::string &pattern)
 
void clear_global_variable_regexp (const std::string &pattern)
 
void clear_global_variables (void)
 
unwind_protectcurr_fcn_unwind_protect_frame (void)
 
int current_column (void) const
 
std::size_t current_frame (void) const
 
octave_functioncurrent_function (bool skip_first=false) const
 
int current_line (void) const
 
symbol_scope current_scope (void) const
 
octave_user_codecurrent_user_code (void) const
 
int current_user_code_column (void) const
 
int current_user_code_line (void) const
 
std::shared_ptr< stack_framecurrent_user_frame (void) const
 
std::size_t dbupdown (int n=-1, bool verbose=false)
 
std::size_t dbupdown (std::size_t start, int n, bool verbose)
 
octave_user_codedebug_user_code (void) const
 
int debug_user_code_column (void) const
 
int debug_user_code_line (void) const
 
void display (void) const
 
octave_value do_global_who_two (const string_vector &patterns, bool have_regexp, bool return_list, bool verbose, const std::string &msg="")
 
octave_value do_who (int argc, const string_vector &argv, bool return_list, bool verbose=false)
 
octave_value do_who_two (const string_vector &patterns, bool have_regexp, bool return_list, bool verbose, const std::string &msg="")
 
octave_functionelement (std::size_t n)
 
octave_map empty_backtrace (void) const
 
std::size_t find_current_user_frame (void) const
 
octave_value get_auto_fcn_var (stack_frame::auto_var_type avt) const
 
std::shared_ptr< stack_frameget_current_stack_frame (void) const
 
std::string get_dispatch_class (void) const
 
symbol_info_list get_symbol_info (void)
 
octave_value get_top_level_value (const std::string &name) const
 
symbol_info_list glob_symbol_info (const std::string &pattern) const
 
std::list< std::string > global_variable_names (void) const
 
octave_valueglobal_varref (const std::string &name)
 
octave_value global_varval (const std::string &name) const
 
void goto_base_frame (void)
 
void goto_caller_frame (void)
 
bool goto_frame (std::size_t n=0, bool verbose=false)
 
bool is_class_constructor_executing (std::string &dispatch_class) const
 
bool is_class_method_executing (std::string &dispatch_class) const
 
void make_global (const symbol_record &sym)
 
void make_persistent (const symbol_record &sym)
 
octave_value max_stack_depth (const octave_value_list &args, int nargout)
 
void pop (void)
 
void push (const symbol_scope &scope)
 
void push (octave_function *fcn)
 
void push (octave_user_function *fcn, const stack_frame::local_vars_map &local_vars, const std::shared_ptr< stack_frame > &closure_frames=std::shared_ptr< stack_frame >())
 
void push (octave_user_function *fcn, const std::shared_ptr< stack_frame > &closure_frames=std::shared_ptr< stack_frame >())
 
void push (octave_user_script *script)
 
symbol_info_list regexp_symbol_info (const std::string &pattern) const
 
void restore_frame (std::size_t n)
 
void set_auto_fcn_var (stack_frame::auto_var_type avt, const octave_value &val)
 
void set_column (int c)
 
void set_dispatch_class (const std::string &class_name)
 
void set_line (int l)
 
void set_location (int l, int c)
 
void set_top_level_value (const std::string &name, const octave_value &value)
 
std::size_t size (void) const
 
std::list< std::string > top_level_variable_names (void) const
 
symbol_scope top_scope (void) const
 
symbol_info_list top_scope_symbol_info (void) const
 
std::list< std::string > variable_names (void) const
 

Private Member Functions

void get_new_frame_index_and_links (std::size_t &new_frame_idx, std::shared_ptr< stack_frame > &parent_link, std::shared_ptr< stack_frame > &static_link) const
 

Private Attributes

stack_frames m_cs
 
std::size_t m_curr_frame
 
tree_evaluatorm_evaluator
 
std::map< std::string, octave_valuem_global_values
 
int m_max_stack_depth
 

Detailed Description

Definition at line 53 of file call-stack.h.

Member Typedef Documentation

◆ const_iterator

typedef stack_frames::const_iterator call_stack::const_iterator

Definition at line 62 of file call-stack.h.

◆ const_reverse_iterator

typedef stack_frames::const_reverse_iterator call_stack::const_reverse_iterator

Definition at line 65 of file call-stack.h.

◆ iterator

typedef stack_frames::iterator call_stack::iterator

Definition at line 61 of file call-stack.h.

◆ reverse_iterator

typedef stack_frames::reverse_iterator call_stack::reverse_iterator

Definition at line 64 of file call-stack.h.

◆ stack_frames

typedef std::deque<std::shared_ptr<stack_frame> > call_stack::stack_frames

Definition at line 59 of file call-stack.h.

Constructor & Destructor Documentation

◆ call_stack()

call_stack::call_stack ( tree_evaluator evaluator)

Definition at line 59 of file call-stack.cc.

References push().

Member Function Documentation

◆ all_scripts()

bool call_stack::all_scripts ( void  ) const

Definition at line 326 of file call-stack.cc.

References f, and m_cs.

◆ all_variables()

symbol_info_list call_stack::all_variables ( void  )

Definition at line 781 of file call-stack.cc.

References m_cs, and m_curr_frame.

◆ at_top_level()

bool call_stack::at_top_level ( void  ) const
inline

Definition at line 108 of file call-stack.h.

Referenced by tree_evaluator::at_top_level().

◆ backtrace() [1/2]

octave_map call_stack::backtrace ( octave_idx_type curr_user_frame,
bool  print_subfn = true 
) const

◆ backtrace() [2/2]

octave_map call_stack::backtrace ( void  ) const

Definition at line 743 of file call-stack.cc.

◆ backtrace_frames() [1/2]

std::list< std::shared_ptr< stack_frame > > call_stack::backtrace_frames ( octave_idx_type curr_user_frame) const

Definition at line 638 of file call-stack.cc.

References find_current_user_frame(), m_cs, and n.

Referenced by tree_evaluator::backtrace_frames().

◆ backtrace_frames() [2/2]

std::list< std::shared_ptr< stack_frame > > call_stack::backtrace_frames ( void  ) const

Definition at line 672 of file call-stack.cc.

Referenced by backtrace(), and backtrace_info().

◆ backtrace_info() [1/2]

std::list< frame_info > call_stack::backtrace_info ( octave_idx_type curr_user_frame,
bool  print_subfn = true 
) const

Definition at line 680 of file call-stack.cc.

References backtrace_frames().

Referenced by tree_evaluator::backtrace_info().

◆ backtrace_info() [2/2]

std::list< frame_info > call_stack::backtrace_info ( void  ) const

Definition at line 702 of file call-stack.cc.

◆ caller_function()

octave_function* call_stack::caller_function ( void  ) const
inline

Definition at line 76 of file call-stack.h.

Referenced by do_global_who_two().

◆ clear()

void call_stack::clear ( void  )

Definition at line 775 of file call-stack.cc.

References m_cs, and pop().

◆ clear_global_variable()

void call_stack::clear_global_variable ( const std::string &  name)

Definition at line 811 of file call-stack.cc.

References m_global_values, and octave_value().

Referenced by tree_evaluator::clear_global_variable().

◆ clear_global_variable_pattern()

void call_stack::clear_global_variable_pattern ( const std::string &  pattern)

◆ clear_global_variable_regexp()

void call_stack::clear_global_variable_regexp ( const std::string &  pattern)

◆ clear_global_variables()

void call_stack::clear_global_variables ( void  )

Definition at line 841 of file call-stack.cc.

References m_global_values, and octave_value().

Referenced by tree_evaluator::clear_global_variables().

◆ curr_fcn_unwind_protect_frame()

unwind_protect * call_stack::curr_fcn_unwind_protect_frame ( void  )

◆ current_column()

int call_stack::current_column ( void  ) const

◆ current_frame()

◆ current_function()

◆ current_line()

int call_stack::current_line ( void  ) const

◆ current_scope()

symbol_scope call_stack::current_scope ( void  ) const
inline

Definition at line 101 of file call-stack.h.

Referenced by tree_evaluator::get_current_scope().

◆ current_user_code()

octave_user_code * call_stack::current_user_code ( void  ) const

◆ current_user_code_column()

int call_stack::current_user_code_column ( void  ) const

Definition at line 160 of file call-stack.cc.

References f, find_current_user_frame(), and m_cs.

◆ current_user_code_line()

int call_stack::current_user_code_line ( void  ) const

Definition at line 136 of file call-stack.cc.

References f, find_current_user_frame(), and m_cs.

Referenced by tree_evaluator::maybe_set_echo_state().

◆ current_user_frame()

std::shared_ptr< stack_frame > call_stack::current_user_frame ( void  ) const

Definition at line 506 of file call-stack.cc.

References find_current_user_frame(), and m_cs.

Referenced by tree_evaluator::debug_where().

◆ dbupdown() [1/2]

std::size_t call_stack::dbupdown ( int  n = -1,
bool  verbose = false 
)

Definition at line 607 of file call-stack.cc.

References dbupdown(), find_current_user_frame(), and n.

◆ dbupdown() [2/2]

std::size_t call_stack::dbupdown ( std::size_t  start,
int  n,
bool  verbose 
)

Definition at line 517 of file call-stack.cc.

References error(), m_cs, n, and octave_stdout.

Referenced by tree_evaluator::dbupdown(), dbupdown(), and tree_evaluator::enter_debugger().

◆ debug_user_code()

octave_user_code * call_stack::debug_user_code ( void  ) const

Definition at line 203 of file call-stack.cc.

References f, m_cs, and m_curr_frame.

Referenced by tree_evaluator::debug_user_code(), and tree_evaluator::get_user_code().

◆ debug_user_code_column()

int call_stack::debug_user_code_column ( void  ) const

Definition at line 258 of file call-stack.cc.

References f, m_cs, and m_curr_frame.

Referenced by tree_evaluator::debug_user_code_column().

◆ debug_user_code_line()

int call_stack::debug_user_code_line ( void  ) const

Definition at line 229 of file call-stack.cc.

References f, m_cs, and m_curr_frame.

Referenced by tree_evaluator::debug_user_code_line().

◆ display()

void call_stack::display ( void  ) const

Definition at line 1112 of file call-stack.cc.

References m_cs, octave_stdout, and size().

Referenced by tree_evaluator::display_call_stack().

◆ do_global_who_two()

◆ do_who()

octave_value call_stack::do_who ( int  argc,
const string_vector argv,
bool  return_list,
bool  verbose = false 
)

◆ do_who_two()

octave_value call_stack::do_who_two ( const string_vector patterns,
bool  have_regexp,
bool  return_list,
bool  verbose,
const std::string &  msg = "" 
)

Definition at line 1006 of file call-stack.cc.

References m_cs, m_curr_frame, m_evaluator, and tree_evaluator::whos_line_format().

Referenced by do_who().

◆ element()

octave_function* call_stack::element ( std::size_t  n)
inline

Definition at line 115 of file call-stack.h.

References n.

◆ empty_backtrace()

octave_map call_stack::empty_backtrace ( void  ) const

Definition at line 750 of file call-stack.cc.

References bt_fields.

Referenced by tree_evaluator::empty_backtrace().

◆ find_current_user_frame()

◆ get_auto_fcn_var()

octave_value call_stack::get_auto_fcn_var ( stack_frame::auto_var_type  avt) const

Definition at line 1132 of file call-stack.cc.

References m_cs, and m_curr_frame.

Referenced by tree_evaluator::get_auto_fcn_var().

◆ get_current_stack_frame()

◆ get_dispatch_class()

std::string call_stack::get_dispatch_class ( void  ) const

Definition at line 288 of file call-stack.cc.

References m_cs, and m_curr_frame.

Referenced by tree_evaluator::get_dispatch_class().

◆ get_new_frame_index_and_links()

void call_stack::get_new_frame_index_and_links ( std::size_t &  new_frame_idx,
std::shared_ptr< stack_frame > &  parent_link,
std::shared_ptr< stack_frame > &  static_link 
) const
private

Definition at line 348 of file call-stack.cc.

References error(), octave_base_value::is_user_code(), m_cs, m_curr_frame, and m_max_stack_depth.

Referenced by push().

◆ get_symbol_info()

symbol_info_list call_stack::get_symbol_info ( void  )

Definition at line 859 of file call-stack.cc.

References m_cs, and m_curr_frame.

Referenced by tree_evaluator::get_symbol_info().

◆ get_top_level_value()

octave_value call_stack::get_top_level_value ( const std::string &  name) const

Definition at line 898 of file call-stack.cc.

References m_cs.

Referenced by tree_evaluator::top_level_varval().

◆ glob_symbol_info()

symbol_info_list call_stack::glob_symbol_info ( const std::string &  pattern) const

Definition at line 848 of file call-stack.cc.

References m_cs, and m_curr_frame.

Referenced by tree_evaluator::glob_symbol_info().

◆ global_variable_names()

std::list< std::string > call_stack::global_variable_names ( void  ) const

Definition at line 786 of file call-stack.cc.

References m_global_values.

Referenced by tree_evaluator::global_variable_names().

◆ global_varref()

octave_value & call_stack::global_varref ( const std::string &  name)

Definition at line 893 of file call-stack.cc.

References m_global_values.

Referenced by tree_evaluator::global_assign(), and tree_evaluator::global_varref().

◆ global_varval()

octave_value call_stack::global_varval ( const std::string &  name) const

Definition at line 886 of file call-stack.cc.

References m_global_values, and octave_value().

Referenced by tree_evaluator::global_varval().

◆ goto_base_frame()

void call_stack::goto_base_frame ( void  )

◆ goto_caller_frame()

void call_stack::goto_caller_frame ( void  )

◆ goto_frame()

bool call_stack::goto_frame ( std::size_t  n = 0,
bool  verbose = false 
)

◆ is_class_constructor_executing()

bool call_stack::is_class_constructor_executing ( std::string &  dispatch_class) const

Definition at line 312 of file call-stack.cc.

References current_function(), and f.

Referenced by tree_evaluator::is_class_constructor_executing().

◆ is_class_method_executing()

bool call_stack::is_class_method_executing ( std::string &  dispatch_class) const

Definition at line 298 of file call-stack.cc.

References current_function(), and f.

Referenced by tree_evaluator::is_class_method_executing().

◆ make_global()

void call_stack::make_global ( const symbol_record sym)

Definition at line 881 of file call-stack.cc.

References m_cs, and m_curr_frame.

Referenced by tree_evaluator::visit_decl_elt().

◆ make_persistent()

void call_stack::make_persistent ( const symbol_record sym)

Definition at line 876 of file call-stack.cc.

References m_cs, and m_curr_frame.

Referenced by tree_evaluator::visit_decl_elt().

◆ max_stack_depth()

octave_value call_stack::max_stack_depth ( const octave_value_list args,
int  nargout 
)

Definition at line 869 of file call-stack.cc.

References m_max_stack_depth, and set_internal_variable().

Referenced by tree_evaluator::max_stack_depth().

◆ pop()

void call_stack::pop ( void  )

Definition at line 755 of file call-stack.cc.

References m_cs, and m_curr_frame.

Referenced by clear(), do_who(), tree_evaluator::pop_scope(), and tree_evaluator::pop_stack_frame().

◆ push() [1/5]

◆ push() [2/5]

void call_stack::push ( octave_function fcn)

◆ push() [3/5]

void call_stack::push ( octave_user_function fcn,
const stack_frame::local_vars_map local_vars,
const std::shared_ptr< stack_frame > &  closure_frames = std::shared_ptr<stack_frame> () 
)

◆ push() [4/5]

void call_stack::push ( octave_user_function fcn,
const std::shared_ptr< stack_frame > &  closure_frames = std::shared_ptr<stack_frame> () 
)

◆ push() [5/5]

void call_stack::push ( octave_user_script script)

◆ regexp_symbol_info()

symbol_info_list call_stack::regexp_symbol_info ( const std::string &  pattern) const

Definition at line 854 of file call-stack.cc.

References m_cs, and m_curr_frame.

Referenced by tree_evaluator::regexp_symbol_info().

◆ restore_frame()

◆ set_auto_fcn_var()

void call_stack::set_auto_fcn_var ( stack_frame::auto_var_type  avt,
const octave_value val 
)

Definition at line 1126 of file call-stack.cc.

References m_cs, and m_curr_frame.

Referenced by tree_evaluator::set_auto_fcn_var().

◆ set_column()

void call_stack::set_column ( int  c)
inline

Definition at line 190 of file call-stack.h.

Referenced by tree_evaluator::do_unwind_protect_cleanup_code().

◆ set_dispatch_class()

void call_stack::set_dispatch_class ( const std::string &  class_name)

Definition at line 293 of file call-stack.cc.

References m_cs, and m_curr_frame.

Referenced by tree_evaluator::set_dispatch_class().

◆ set_line()

void call_stack::set_line ( int  l)
inline

Definition at line 180 of file call-stack.h.

Referenced by tree_evaluator::do_unwind_protect_cleanup_code().

◆ set_location()

void call_stack::set_location ( int  l,
int  c 
)
inline

◆ set_top_level_value()

void call_stack::set_top_level_value ( const std::string &  name,
const octave_value value 
)

Definition at line 903 of file call-stack.cc.

References m_cs.

Referenced by tree_evaluator::top_level_assign().

◆ size()

std::size_t call_stack::size ( void  ) const
inline

◆ top_level_variable_names()

std::list< std::string > call_stack::top_level_variable_names ( void  ) const

Definition at line 801 of file call-stack.cc.

References m_cs.

Referenced by tree_evaluator::top_level_variable_names().

◆ top_scope()

symbol_scope call_stack::top_scope ( void  ) const
inline

Definition at line 96 of file call-stack.h.

Referenced by tree_evaluator::get_top_scope().

◆ top_scope_symbol_info()

symbol_info_list call_stack::top_scope_symbol_info ( void  ) const

Definition at line 864 of file call-stack.cc.

References m_cs.

Referenced by tree_evaluator::top_scope_symbol_info().

◆ variable_names()

std::list< std::string > call_stack::variable_names ( void  ) const

Definition at line 806 of file call-stack.cc.

References m_cs, and m_curr_frame.

Referenced by tree_evaluator::variable_names().

Member Data Documentation

◆ m_cs

◆ m_curr_frame

◆ m_evaluator

tree_evaluator& call_stack::m_evaluator
private

Definition at line 310 of file call-stack.h.

Referenced by do_global_who_two(), do_who_two(), and push().

◆ m_global_values

◆ m_max_stack_depth

int call_stack::m_max_stack_depth
private

Definition at line 324 of file call-stack.h.

Referenced by get_new_frame_index_and_links(), and max_stack_depth().


The documentation for this class was generated from the following files: