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

#include "call-stack.h"

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 () const
 
symbol_info_list all_variables ()
 
bool at_top_level () const
 
octave_map backtrace () const
 
octave_map backtrace (octave_idx_type &curr_user_frame, bool print_subfn=true) const
 
std::list< std::shared_ptr< stack_frame > > backtrace_frames () const
 
std::list< std::shared_ptr< stack_frame > > backtrace_frames (octave_idx_type &curr_user_frame) const
 
std::list< frame_info > backtrace_info () const
 
std::list< frame_info > backtrace_info (octave_idx_type &curr_user_frame, bool print_subfn=true) const
 
octave_functioncaller_function () const
 
void clear ()
 
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 ()
 
unwind_protectcurr_fcn_unwind_protect_frame ()
 
int current_column () const
 
std::size_t current_frame () const
 
octave_functioncurrent_function (bool skip_first=false) const
 
int current_line () const
 
symbol_scope current_scope () const
 
octave_user_codecurrent_user_code () const
 
int current_user_code_column () const
 
int current_user_code_line () const
 
std::shared_ptr< stack_framecurrent_user_frame () 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 () const
 
int debug_user_code_column () const
 
int debug_user_code_line () const
 
void display () 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 () const
 
std::size_t find_current_user_frame () const
 
octave_value get_auto_fcn_var (stack_frame::auto_var_type avt) const
 
std::shared_ptr< stack_frameget_current_stack_frame () const
 
std::string get_dispatch_class () const
 
symbol_info_list get_symbol_info ()
 
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 () const
 
octave_valueglobal_varref (const std::string &name)
 
octave_value global_varval (const std::string &name) const
 
void goto_base_frame ()
 
void goto_caller_frame ()
 
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 ()
 
std::shared_ptr< stack_framepop_return ()
 
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_nargin (int nargin)
 
void set_nargout (int nargout)
 
void set_top_level_value (const std::string &name, const octave_value &value)
 
std::size_t size () const
 
std::list< std::string > top_level_variable_names () const
 
symbol_scope top_scope () const
 
symbol_info_list top_scope_symbol_info () const
 
std::list< std::string > variable_names () const
 

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 ( ) const

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

References f.

◆ all_variables()

symbol_info_list call_stack::all_variables ( )

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

◆ at_top_level()

bool call_stack::at_top_level ( ) 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 ( ) const

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

◆ backtrace() [2/2]

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

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

References backtrace_frames().

Referenced by tree_evaluator::backtrace().

◆ backtrace_frames() [1/2]

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

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

Referenced by backtrace(), and backtrace_info().

◆ backtrace_frames() [2/2]

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

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

References find_current_user_frame(), and n.

Referenced by tree_evaluator::backtrace_frames().

◆ backtrace_info() [1/2]

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

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

◆ backtrace_info() [2/2]

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

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

References backtrace_frames().

Referenced by tree_evaluator::backtrace_info().

◆ caller_function()

octave_function* call_stack::caller_function ( ) const
inline

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

Referenced by do_global_who_two().

◆ clear()

void call_stack::clear ( )

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

References pop().

◆ clear_global_variable()

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

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

References octave_value().

Referenced by tree_evaluator::clear_global_variable().

◆ clear_global_variable_pattern()

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

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

References symbol_match::match(), and octave_value().

Referenced by tree_evaluator::clear_global_variable_pattern().

◆ clear_global_variable_regexp()

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

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

References regexp::is_match(), and octave_value().

Referenced by tree_evaluator::clear_global_variable_regexp().

◆ clear_global_variables()

void call_stack::clear_global_variables ( )

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

References octave_value().

Referenced by tree_evaluator::clear_global_variables().

◆ curr_fcn_unwind_protect_frame()

unwind_protect * call_stack::curr_fcn_unwind_protect_frame ( )

◆ current_column()

int call_stack::current_column ( ) const

◆ current_frame()

◆ current_function()

◆ current_line()

int call_stack::current_line ( ) const

◆ current_scope()

symbol_scope call_stack::current_scope ( ) const
inline

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

References symbol_scope::invalid().

Referenced by tree_evaluator::get_current_scope().

◆ current_user_code()

octave_user_code * call_stack::current_user_code ( ) const

◆ current_user_code_column()

int call_stack::current_user_code_column ( ) const

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

References f, and find_current_user_frame().

◆ current_user_code_line()

int call_stack::current_user_code_line ( ) const

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

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

◆ current_user_frame()

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

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

References find_current_user_frame().

Referenced by tree_evaluator::debug_where().

◆ dbupdown() [1/2]

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

Definition at line 632 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 541 of file call-stack.cc.

References error(), 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 ( ) const

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

References f.

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

◆ debug_user_code_column()

int call_stack::debug_user_code_column ( ) const

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

References f.

Referenced by tree_evaluator::debug_user_code_column().

◆ debug_user_code_line()

int call_stack::debug_user_code_line ( ) const

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

References f.

Referenced by tree_evaluator::debug_user_code_line().

◆ display()

void call_stack::display ( ) const

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

References 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 1083 of file call-stack.cc.

References 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 ( ) const

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

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 1225 of file call-stack.cc.

Referenced by tree_evaluator::get_auto_fcn_var().

◆ get_current_stack_frame()

◆ get_dispatch_class()

std::string call_stack::get_dispatch_class ( ) const

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

Referenced by tree_evaluator::get_dispatch_class().

◆ get_symbol_info()

symbol_info_list call_stack::get_symbol_info ( )

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

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 970 of file call-stack.cc.

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 912 of file call-stack.cc.

Referenced by tree_evaluator::glob_symbol_info().

◆ global_variable_names()

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

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

Referenced by tree_evaluator::global_variable_names().

◆ global_varref()

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

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

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 956 of file call-stack.cc.

References octave_value().

Referenced by tree_evaluator::global_varval().

◆ goto_base_frame()

void call_stack::goto_base_frame ( )

◆ goto_caller_frame()

void call_stack::goto_caller_frame ( )

◆ goto_frame()

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

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

References n, and octave_stdout.

Referenced by tree_evaluator::evaluate_end_expression(), and tree_evaluator::goto_frame().

◆ is_class_constructor_executing()

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

Definition at line 326 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 311 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 950 of file call-stack.cc.

Referenced by tree_evaluator::visit_decl_elt().

◆ make_persistent()

void call_stack::make_persistent ( const symbol_record sym)

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

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 936 of file call-stack.cc.

References octave::set_internal_variable().

Referenced by tree_evaluator::max_stack_depth().

◆ pop()

void call_stack::pop ( )

◆ pop_return()

std::shared_ptr< stack_frame > call_stack::pop_return ( )

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

Referenced by tree_evaluator::pop_return_stack_frame().

◆ push() [1/5]

void call_stack::push ( const symbol_scope scope)

◆ push() [2/5]

void call_stack::push ( octave_function fcn)

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

References stack_frame::create().

◆ 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> () 
)

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

References stack_frame::create().

◆ push() [4/5]

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

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

References stack_frame::create().

◆ push() [5/5]

void call_stack::push ( octave_user_script script)

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

References stack_frame::create().

◆ regexp_symbol_info()

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

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

Referenced by tree_evaluator::regexp_symbol_info().

◆ restore_frame()

void call_stack::restore_frame ( std::size_t  n)
inline

◆ set_auto_fcn_var()

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

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

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 305 of file call-stack.cc.

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_nargin()

void call_stack::set_nargin ( int  nargin)

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

Referenced by tree_evaluator::set_nargin().

◆ set_nargout()

void call_stack::set_nargout ( int  nargout)

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

Referenced by tree_evaluator::set_nargout().

◆ set_top_level_value()

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

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

Referenced by tree_evaluator::top_level_assign().

◆ size()

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

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

Referenced by display(), and tree_evaluator::execute_user_script().

◆ top_level_variable_names()

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

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

Referenced by tree_evaluator::top_level_variable_names().

◆ top_scope()

symbol_scope call_stack::top_scope ( ) 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 ( ) const

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

Referenced by tree_evaluator::top_scope_symbol_info().

◆ variable_names()

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

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

Referenced by tree_evaluator::variable_names().


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