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

#include "call-stack.h"

Collaboration diagram for octave::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
 
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
 
size_t dbupdown (int n=-1, bool verbose=false)
 
size_t dbupdown (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 (size_t n)
 
octave_map empty_backtrace (void) const
 
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 (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)
 
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 (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)
 
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 (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
 
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 octave::call_stack::const_iterator

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

◆ const_reverse_iterator

typedef stack_frames::const_reverse_iterator octave::call_stack::const_reverse_iterator

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

◆ iterator

typedef stack_frames::iterator octave::call_stack::iterator

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

◆ reverse_iterator

typedef stack_frames::reverse_iterator octave::call_stack::reverse_iterator

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

◆ stack_frames

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

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

Constructor & Destructor Documentation

◆ call_stack()

octave::call_stack::call_stack ( tree_evaluator evaluator)

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

References push().

Member Function Documentation

◆ all_scripts()

bool octave::call_stack::all_scripts ( void  ) const

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

References octave::f(), m_cs, and retval.

◆ all_variables()

symbol_info_list octave::call_stack::all_variables ( void  )

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

References m_cs, and m_curr_frame.

◆ at_top_level()

bool octave::call_stack::at_top_level ( void  ) const
inline

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

Referenced by octave::tree_evaluator::at_top_level().

◆ backtrace() [1/2]

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

◆ backtrace() [2/2]

octave_map octave::call_stack::backtrace ( void  ) const

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

◆ backtrace_frames() [1/2]

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

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

References find_current_user_frame(), m_cs, and n.

Referenced by octave::tree_evaluator::backtrace_frames().

◆ backtrace_frames() [2/2]

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

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

Referenced by backtrace(), and backtrace_info().

◆ backtrace_info() [1/2]

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

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

References backtrace_frames(), and retval.

Referenced by octave::tree_evaluator::backtrace_info().

◆ backtrace_info() [2/2]

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

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

◆ caller_function()

octave_function* octave::call_stack::caller_function ( void  ) const
inline

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

Referenced by do_global_who_two().

◆ clear()

void octave::call_stack::clear ( void  )

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

References m_cs, and pop().

◆ clear_global_variable()

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

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

References m_global_values, name, and octave_value().

Referenced by octave::tree_evaluator::clear_global_variable().

◆ clear_global_variable_pattern()

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

◆ clear_global_variable_regexp()

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

◆ clear_global_variables()

void octave::call_stack::clear_global_variables ( void  )

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

References m_global_values, and octave_value().

Referenced by octave::tree_evaluator::clear_global_variables().

◆ curr_fcn_unwind_protect_frame()

◆ current_column()

int octave::call_stack::current_column ( void  ) const

◆ current_frame()

◆ current_function()

◆ current_line()

int octave::call_stack::current_line ( void  ) const

◆ current_scope()

symbol_scope octave::call_stack::current_scope ( void  ) const
inline

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

Referenced by octave::tree_evaluator::get_current_scope().

◆ current_user_code()

◆ current_user_code_column()

int octave::call_stack::current_user_code_column ( void  ) const

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

References octave::f(), find_current_user_frame(), and m_cs.

◆ current_user_code_line()

int octave::call_stack::current_user_code_line ( void  ) const

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

References line::line(), octave::f(), find_current_user_frame(), and m_cs.

◆ current_user_frame()

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

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

References find_current_user_frame(), and m_cs.

Referenced by octave::tree_evaluator::debug_where().

◆ dbupdown() [1/2]

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

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

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

◆ dbupdown() [2/2]

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

◆ debug_user_code()

octave_user_code * octave::call_stack::debug_user_code ( void  ) const

◆ debug_user_code_column()

int octave::call_stack::debug_user_code_column ( void  ) const

◆ debug_user_code_line()

int octave::call_stack::debug_user_code_line ( void  ) const

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

References octave::f(), m_cs, m_curr_frame, and retval.

Referenced by octave::tree_evaluator::debug_user_code_line().

◆ display()

void octave::call_stack::display ( void  ) const

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

References m_cs, octave_stdout, and size().

Referenced by octave::tree_evaluator::display_call_stack().

◆ do_global_who_two()

◆ do_who()

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

◆ do_who_two()

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

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

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

Referenced by do_who().

◆ element()

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

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

References n, and retval.

◆ empty_backtrace()

octave_map octave::call_stack::empty_backtrace ( void  ) const

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

References octave::bt_fields.

Referenced by octave::tree_evaluator::empty_backtrace().

◆ find_current_user_frame()

◆ get_auto_fcn_var()

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

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

References m_cs, and m_curr_frame.

Referenced by octave::tree_evaluator::get_auto_fcn_var().

◆ get_current_stack_frame()

◆ get_dispatch_class()

std::string octave::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 octave::tree_evaluator::get_dispatch_class().

◆ get_new_frame_index_and_links()

void octave::call_stack::get_new_frame_index_and_links ( 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 octave::call_stack::get_symbol_info ( void  )

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

References m_cs, and m_curr_frame.

Referenced by octave::tree_evaluator::get_symbol_info().

◆ get_top_level_value()

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

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

References m_cs, and name.

Referenced by octave::tree_evaluator::top_level_varval().

◆ glob_symbol_info()

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

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

References m_cs, and m_curr_frame.

Referenced by octave::tree_evaluator::glob_symbol_info().

◆ global_variable_names()

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

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

References m_global_values, retval, and Array< T >::sort().

Referenced by octave::tree_evaluator::global_variable_names().

◆ global_varref()

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

◆ global_varval()

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

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

References m_global_values, name, and octave_value().

Referenced by octave::tree_evaluator::global_varval().

◆ goto_base_frame()

void octave::call_stack::goto_base_frame ( void  )

◆ goto_caller_frame()

◆ goto_frame()

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

◆ is_class_constructor_executing()

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

◆ is_class_method_executing()

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

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

References current_function(), octave::f(), and retval.

Referenced by octave::tree_evaluator::is_class_method_executing().

◆ make_global()

void octave::call_stack::make_global ( const symbol_record sym)

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

References m_cs, and m_curr_frame.

Referenced by octave::tree_evaluator::visit_decl_elt().

◆ make_persistent()

void octave::call_stack::make_persistent ( const symbol_record sym)

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

References m_cs, and m_curr_frame.

Referenced by octave::tree_evaluator::visit_decl_elt().

◆ max_stack_depth()

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

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

References m_max_stack_depth, and set_internal_variable().

Referenced by octave::tree_evaluator::max_stack_depth().

◆ pop()

void octave::call_stack::pop ( void  )

◆ push() [1/5]

◆ push() [2/5]

void octave::call_stack::push ( octave_function fcn)

◆ push() [3/5]

void octave::call_stack::push ( octave_user_function fcn,
const stack_frame::local_vars_map local_vars 
)

◆ push() [4/5]

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

◆ push() [5/5]

void octave::call_stack::push ( octave_user_script script)

◆ regexp_symbol_info()

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

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

References m_cs, and m_curr_frame.

Referenced by octave::tree_evaluator::regexp_symbol_info().

◆ restore_frame()

◆ set_auto_fcn_var()

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

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

References m_cs, and m_curr_frame.

Referenced by octave::tree_evaluator::set_auto_fcn_var().

◆ set_column()

void octave::call_stack::set_column ( int  c)
inline

◆ set_dispatch_class()

void octave::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 octave::tree_evaluator::set_dispatch_class().

◆ set_line()

void octave::call_stack::set_line ( int  l)
inline

◆ set_location()

◆ set_top_level_value()

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

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

References m_cs, and name.

Referenced by octave::tree_evaluator::top_level_assign().

◆ size()

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

◆ top_level_variable_names()

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

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

References m_cs.

Referenced by octave::tree_evaluator::top_level_variable_names().

◆ top_scope()

symbol_scope octave::call_stack::top_scope ( void  ) const
inline

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

Referenced by octave::tree_evaluator::get_top_scope().

◆ top_scope_symbol_info()

symbol_info_list octave::call_stack::top_scope_symbol_info ( void  ) const

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

References m_cs.

Referenced by octave::tree_evaluator::top_scope_symbol_info().

◆ variable_names()

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

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

References m_cs, and m_curr_frame.

Referenced by octave::tree_evaluator::variable_names().

Member Data Documentation

◆ m_cs

◆ m_curr_frame

◆ m_evaluator

tree_evaluator& octave::call_stack::m_evaluator
private

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

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

◆ m_global_values

◆ m_max_stack_depth

int octave::call_stack::m_max_stack_depth
private

Definition at line 323 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: