26 #if defined (HAVE_CONFIG_H)
114 void repl (
const std::string& prompt =
"debug> ");
162 std::string fcn_file_nm, fcn_nm;
167 fcn_nm = fcn_file_nm.empty () ? caller->
name () : fcn_file_nm;
172 std::ostringstream buf;
176 if (! fcn_nm.empty ())
180 static char ctrl_z =
'Z' & 0x1f;
182 buf << ctrl_z << ctrl_z << fcn_nm <<
':' << curr_debug_line;
194 frm->display_stopped_in_message (buf);
203 frame.
add ([&evmgr, fcn_nm, curr_debug_line] (
void) {
210 std::string line_buf;
215 if (! line_buf.empty ())
216 buf << curr_debug_line <<
": " << line_buf;
224 std::string stopped_in_msg = buf.str ();
226 if (! stopped_in_msg.empty ())
227 std::cerr << stopped_in_msg << std::endl;
229 std::string tmp_prompt = prompt_arg;
231 tmp_prompt =
"[" + std::to_string (
m_level) +
"]" + prompt_arg;
234 input_sys.
PS1 (tmp_prompt);
258 #if defined (OCTAVE_ENABLE_COMMAND_LINE_PUSH_PARSER)
282 debug_parser.
reset ();
284 #if defined (OCTAVE_ENABLE_COMMAND_LINE_PUSH_PARSER)
294 std::string input_line = reader.
get_input (prompt, eof);
302 retval = debug_parser.
run (input_line,
false);
325 std::shared_ptr<tree_statement_list> stmt_list
329 stmt_list->accept (tw);
404 stmt_list->accept (*
this);
443 fname = fcn->
name ();
446 if (opt ==
"fullpathext")
450 size_t epos = fname.rfind (
'.');
453 epos = std::string::npos;
455 if (epos != std::string::npos)
456 fname = fname.substr (0, epos);
458 if (opt ==
"fullpath")
461 if (dpos != std::string::npos)
462 fname = fname.substr (dpos+1);
469 int& parse_status,
int nargout)
477 eval_parser.
reset ();
488 parse_status = eval_parser.
run ();
490 if (parse_status == 0)
492 std::shared_ptr<tree_statement_list> stmt_list
499 if (stmt_list->length () == 1
500 && (stmt = stmt_list->front ())
510 bool do_bind_ans =
false;
517 if (do_bind_ans && !
retval.empty ())
523 else if (nargout == 0)
524 stmt_list->accept (*
this);
526 error (
"eval: invalid use of statement list");
535 while (parse_status == 0);
541 bool silent,
int& parse_status)
554 bool silent,
int& parse_status,
557 std::string s = arg.
xstring_value (
"eval: expecting string argument");
559 return eval_string (s, silent, parse_status, nargout);
565 int parse_status = 0;
567 return eval_string (try_code, nargout > 0, parse_status, nargout);
571 const std::string& catch_code,
578 int parse_status = 0;
580 bool execution_error =
false;
586 tmp =
eval_string (try_code, nargout > 0, parse_status, nargout);
593 execution_error =
true;
596 if (parse_status != 0 || execution_error)
598 tmp =
eval_string (catch_code, nargout > 0, parse_status, nargout);
618 const std::string& try_code,
631 error (
"evalin: CONTEXT must be \"caller\" or \"base\"");
633 int parse_status = 0;
635 return eval_string (try_code, nargout > 0, parse_status, nargout);
639 const std::string& try_code,
640 const std::string& catch_code,
655 error (
"evalin: CONTEXT must be \"caller\" or \"base\"");
659 int parse_status = 0;
661 bool execution_error =
false;
667 tmp =
eval_string (try_code, nargout > 0, parse_status, nargout);
674 execution_error =
true;
677 if (parse_status != 0 || execution_error)
679 tmp =
eval_string (catch_code, nargout > 0, parse_status, nargout);
744 error (
"break must appear in a loop in the same file as loop command");
831 frame.
add ([
this] (
void)
864 for (
const auto& lval : *lvalues)
865 nbh += lval.is_black_hole ();
874 for (
const auto& lval : *lvalues)
876 if (lval.is_black_hole ())
934 else if (
name[1] ==
'=')
955 else if (
name ==
"**")
1027 bool name_is_operator = fcn_name !=
name;
1029 size_t pos = fcn_name.find (
'.');
1031 if (pos != std::string::npos)
1050 std::string meth_nm = fcn_name.substr (pos+1);
1052 if (meth_nm.find (
'.') == std::string::npos)
1054 std::string obj_nm = fcn_name.substr (0, pos);
1061 if (
object.
is_defined () &&
object.is_classdef_object ())
1084 fcn_name = class_nm +
'.' + meth_nm;
1136 if (! name_is_operator)
1141 std::shared_ptr<stack_frame> frame
1169 bool skip_first = name_is_operator;
1257 std::shared_ptr<stack_frame> frame
1260 return frame->is_variable (
name);
1266 std::shared_ptr<stack_frame> frame
1269 return frame->is_local_variable (
name);
1306 std::shared_ptr<stack_frame> frame
1309 return frame->is_variable (sym);
1315 std::shared_ptr<stack_frame> frame
1318 return frame->is_defined (sym);
1323 std::shared_ptr<stack_frame> frame
1326 return frame->is_global (
name);
1332 std::shared_ptr<stack_frame> frame
1335 return frame->varval (sym);
1341 std::shared_ptr<stack_frame> frame
1344 return frame->varval (
name);
1351 std::shared_ptr<stack_frame> frame
1354 return frame->install_variable (
name, value, global);
1392 std::shared_ptr<stack_frame> frame
1395 frame->assign (
name, val);
1416 error (
"assignin: CONTEXT must be \"caller\" or \"base\"");
1425 error (
"assignin: invalid assignment to keyword '%s'",
1431 error (
"assignin: invalid variable name '%s'",
name.c_str ());
1437 bool verbose,
bool require_file)
1472 static std::map<std::string, int> source_call_depth;
1474 std::string file_full_name
1480 std::string dir_name = file_full_name.substr (0, pos);
1486 if (source_call_depth.find (file_full_name) == source_call_depth.end ())
1487 source_call_depth[file_full_name] = -1;
1489 frame.
protect_var (source_call_depth[file_full_name]);
1491 source_call_depth[file_full_name]++;
1494 error (
"max_recursion_depth exceeded");
1506 error (
"source: context must be \"caller\" or \"base\"");
1512 dir_end = (dir_end == std::string::npos) ? 0 : dir_end + 1;
1514 size_t extension = file_name.find_last_of (
'.');
1515 if (extension == std::string::npos)
1516 extension = file_name.length ();
1518 std::string symbol = file_name.substr (dir_end, extension - dir_end);
1554 file_name, dir_name,
"",
"",
1555 require_file,
true,
false,
false);
1559 error (e,
"source: error sourcing file '%s'",
1560 file_full_name.c_str ());
1570 error (
"source: %s is not a script", full_name.c_str ());
1574 octave_stdout <<
"executing commands from " << full_name <<
" ... ";
1613 if (args(i).
is_defined () && args(i).is_magic_colon ())
1616 error (
"no default value for argument %d", i+1);
1687 std::list<octave_value> arg_vals;
1689 for (
auto elt : *args)
1703 arg_vals.push_back (tmp_ovl(i));
1706 arg_vals.push_back (tmp);
1715 const Cell& varargout)
1727 int num_ignored = ignored_outputs.
numel ();
1728 int ignored = num_ignored > 0 ? ignored_outputs(k) - 1 : -1;
1732 int nout = nargout > 0 ? nargout : 1;
1737 if (nargout == 0 && !
is_defined (elt->ident ()))
1740 if (ignored >= 0 && i == ignored)
1744 ignored = k < num_ignored ? ignored_outputs(k) - 1 : -1;
1761 if (ignored >= 0 && i == ignored)
1765 ignored = k < num_ignored ? ignored_outputs(k) - 1 : -1;
1772 retval(i++) = varargout(j);
1811 if (label_value.
iscell ())
1819 bool match = val.
is_equal (cell(i,j));
1839 const std::shared_ptr<stack_frame>& closure_frames)
1889 frm->display_stopped_in_message (os);
1959 std::list<std::shared_ptr<stack_frame>>
1965 std::list<std::shared_ptr<stack_frame>>
1971 std::list<frame_info>
1973 bool print_subfn)
const
1985 bool print_subfn)
const
2004 std::ostringstream buf;
2006 for (
const auto& frm : frames)
2008 buf <<
" " << frm.fcn_name ();
2014 buf <<
" at line " <<
line;
2016 int column = frm.column ();
2019 buf <<
" column " << column;
2055 error (
"mlock: invalid use outside a function");
2059 warning (
"mlock: locking built-in function has no effect");
2071 error (
"munlock: invalid use outside a function");
2075 warning (
"munlock: unlocking built-in function has no effect");
2087 error (
"mislocked: invalid use outside a function");
2105 std::shared_ptr<stack_frame> frame
2129 std::shared_ptr<stack_frame> frame
2132 frame->clear_objects ();
2137 std::shared_ptr<stack_frame> frame
2140 frame->clear_variable (
name);
2145 std::shared_ptr<stack_frame> frame
2148 frame->clear_variable_pattern (pattern);
2153 std::shared_ptr<stack_frame> frame
2156 frame->clear_variable_regexp (pattern);
2161 std::shared_ptr<stack_frame> frame
2164 frame->clear_variables ();
2254 const std::string& class_name)
2262 std::string
name = fname;
2266 auto beg =
name.begin () + 2;
2267 auto end =
name.end () - 1;
2271 size_t name_len =
name.length ();
2273 if (name_len > 2 &&
name.substr (name_len-2) ==
".m")
2274 name =
name.substr (0, name_len-2);
2282 size_t p2 = std::string::npos;
2288 if (p1 == std::string::npos)
2291 std::string dispatch_type =
name.substr (1, p1-1);
2293 p2 =
name.find (
'>', p1);
2295 std::string method =
name.substr (p1+1, p2-1);
2299 else if (! class_name.empty ())
2311 p2 =
name.find (
'>');
2313 std::string main_fcn =
name.substr (0, p2);
2319 std::string subfuns;
2321 if (p2 != std::string::npos)
2322 subfuns =
name.substr (p2+1);
2327 if (! user_code || subfuns.empty ())
2347 return curfcn->
name ();
2377 init_list->
accept (*
this);
2392 error (
"declaration list element not global or persistent");
2435 #if defined (HAVE_LLVM)
2465 loop_body->
accept (*
this);
2479 loop_body->
accept (*
this);
2496 if (rhs.
ndims () > 2)
2499 if (nrows > 0 && steps > 0)
2529 loop_body->
accept (*
this);
2542 error (
"invalid type in for loop expression near line %d, column %d",
2570 error (
"in statement 'for [X, Y] = VAL', VAL must be a structure");
2578 auto p = lhs->
begin ();
2601 std::string key = keys[i];
2613 loop_body->
accept (*
this);
2636 if (args.
length () != 0 || nargout != 0)
2637 error (
"invalid call to script %s", file_name.c_str ());
2645 error (
"max_recursion_depth exceeded");
2654 cmd_list->
accept (*
this);
2694 ret_args = args.
slice (0, 1,
true);
2701 #if defined (HAVE_LLVM)
2708 error (
"max_recursion_depth exceeded");
2729 error (
"%s: invalid classdef constructor, no output argument defined",
2745 frame->clear_values ();
2757 assert (cmd_list->
length () == 1);
2771 cmd_list->
accept (*
this);
2791 varargout = varargout_varval.
xcell_value (
"varargout must be a cell array object");
2823 std::string nm =
f->name ();
2886 stmt_lst->
accept (*
this);
3036 bool do_bind_ans =
false;
3049 catch (
const std::bad_alloc&)
3057 "out of memory or dimension too large for Octave's index type");
3059 catch (
const interrupt_exception&)
3104 auto p = lst.
begin ();
3106 if (p != lst.
end ())
3113 error (
"invalid statement found in statement list!");
3125 if (p == lst.
end ())
3176 error (
"missing value in switch command near line %d, column %d",
3192 stmt_lst->
accept (*
this);
3210 bool execution_error =
false;
3228 try_code->
accept (*
this);
3232 execution_error =
true;
3249 if (execution_error)
3265 catch_code->
accept (*
this);
3366 if (unwind_protect_code)
3370 unwind_protect_code->
accept (*
this);
3391 catch (
const interrupt_exception&)
3416 #if defined (HAVE_LLVM)
3441 loop_body->
accept (*
this);
3462 #if defined (HAVE_LLVM)
3470 int until_line = cmd.
line ();
3471 int until_column = cmd.
column ();
3484 loop_body->
accept (*
this);
3513 static std::string ans =
"ans";
3532 feval (
"display", args);
3547 bool is_end_of_fcn_or_script)
3549 bool break_on_this_statement =
false;
3552 break_on_this_statement =
true;
3565 break_on_this_statement =
true;
3582 break_on_this_statement =
true;
3589 break_on_this_statement =
true;
3601 if (is_end_of_fcn_or_script
3606 if (break_on_this_statement)
3616 const char *warn_for)
3618 bool expr_value =
false;
3625 error (
"%s: undefined value used in conditional expression", warn_for);
3635 "max_recursion_depth", 0);
3670 func_names(i) = fcn_fname.first;
3671 file_names(i) = fcn_fname.second;
3678 m.assign (
"function", func_names);
3679 m.assign (
"file", file_names);
3702 std::list<std::string> names;
3705 names.push_back (fcn_fname.first);
3710 std::list<std::string>
3713 std::list<std::string> names;
3716 if (nm == fcn_fname.second)
3717 names.push_back (fcn_fname.first);
3723 const std::string& nm)
3731 const std::string& nm)
3747 "whos_line_format");
3754 "silent_functions");
3761 "string_fill_char");
3771 std::string extra_message;
3775 std::string var = expr->
name ();
3787 if (fp && fp->
name () == var)
3789 =
" (note: variable '" + var +
"' shadows function)";
3793 std::string msg = e.message () + extra_message;
3800 bool return_list,
bool verbose)
3823 std::list<octave_value> arg_vals;
3827 for (
auto elt : *args)
3843 arg_vals.push_back (tmp_ovl(i));
3846 arg_vals.push_back (tmp);
3855 retval.stash_name_tags (arg_nm);
3860 std::list<octave_lvalue>
3863 std::list<octave_lvalue>
retval;
3866 retval.push_back (elt->lvalue (*
this));
3969 std::string arg0 = argv[0];
3973 else if (arg0 ==
"off")
3981 error (
"echo: no such file %s", arg0.c_str ());
4008 p->second = ! p->second;
4017 std::string arg0 = argv[0];
4018 std::string arg1 = argv[1];
4020 if (arg1 ==
"on" || arg1 ==
"off")
4021 std::swap (arg0, arg1);
4036 error (
"echo: no such file %s", arg1.c_str ());
4042 else if (arg0 ==
"off")
4055 error (
"echo: no such file %s", arg1.c_str ());
4099 int ndims = dv.
ndims ();
4101 if (num_indices < ndims)
4103 for (
int i = num_indices; i < ndims; i++)
4104 dv(num_indices-1) *= dv(i);
4106 if (num_indices == 1)
4114 ndims = num_indices;
4119 return (index_position < ndims
4126 int nargin = args.
length ();
4128 if (nargin != 0 && nargin != 3)
4134 = args(1).xidx_type_value (
"end: K must be integer value");
4137 error (
"end: K must be greater than zero");
4140 = args(2).xidx_type_value (
"end: N must be integer value");
4143 error (
"end: N must be greater than zero");
4155 error (
"invalid use of 'end': may only be used to index existing value");
4196 error (
"error evaluating partial expression for END");
4206 std::string dispatch_class = expr_result.
class_name ();
4271 std::deque<std::string> lines
4274 for (
auto& elt : lines)
4298 const Matrix& ignored_outputs,
4299 int nargin,
int nargout,
4319 std::string full_name = nm;
4329 if (! fname.empty ())
4338 full_name = fname + nm;
4346 "autoload: '%s' is not an absolute filename",
4353 DEFMETHOD (max_recursion_depth, interp, args, nargout,
4388 DEFMETHOD (whos_line_format, interp, args, nargout,
4466 DEFMETHOD (silent_functions, interp, args, nargout,
4500 DEFMETHOD (string_fill_char, interp, args, nargout,
4568 return tw.
PS4 (args, nargout);
4614 return tw.
echo (args, nargout);
F77_RET_T const F77_DBLE const F77_DBLE const F77_INT const F77_DBLE const F77_DBLE const F77_DBLE F77_DBLE F77_DBLE F77_INT F77_INT const F77_INT const F77_INT F77_INT F77_INT F77_DBLE *F77_RET_T const F77_DBLE const F77_INT const F77_DBLE const F77_DBLE F77_DBLE F77_DBLE F77_INT F77_INT const F77_INT const F77_INT F77_INT F77_INT F77_DBLE *F77_RET_T const F77_REAL const F77_REAL const F77_INT const F77_REAL const F77_REAL const F77_REAL F77_REAL F77_REAL F77_INT F77_INT const F77_INT const F77_INT F77_INT F77_INT F77_REAL *F77_RET_T const F77_REAL const F77_INT const F77_REAL const F77_REAL F77_REAL F77_REAL F77_INT F77_INT const F77_INT const F77_INT F77_INT F77_INT F77_REAL *static F77_INT user_function(const double &x, int &, double &result)
void resize(const dim_vector &dv, const T &rfv)
Size of the specified dimension.
octave_idx_type columns(void) const
octave_idx_type numel(void) const
Number of elements in the array.
octave_idx_type rows(void) const
double elem(octave_idx_type i) const
octave_idx_type numel(void) const
Vector representing the dimensions (size) of an Array.
void resize(int n, int fill_value=0)
octave_idx_type ndims(void) const
Number of dimensions.
dim_vector redim(int n) const
Force certain dimensionality, preserving numel ().
line(const graphics_handle &mh, const graphics_handle &p)
void add_method(T *obj, void(T::*method)(Params...), Args &&... args)
void add_fcn(void(*fcn)(Params...), Args &&... args)
void add(F &&fcn, Args &&... args)
static bool forced_interactive(void)
void forced_interactive(bool arg)
static application * app(void)
size_t length(void) const
void disallow_command_syntax(void)
bool at_end_of_input(void) const
void statement_list(std::shared_ptr< tree_statement_list > &lst)
bool have_breakpoints(void)
bool debug_on_err(const std::string &id)
bool debug_on_caught(const std::string &id)
bool at_top_level(void) const
symbol_info_list glob_symbol_info(const std::string &pattern) const
void clear_global_variables(void)
std::string get_dispatch_class(void) const
octave_value global_varval(const std::string &name) const
bool goto_frame(size_t n=0, bool verbose=false)
bool is_class_constructor_executing(std::string &dispatch_class) const
void push(const symbol_scope &scope)
std::list< frame_info > backtrace_info(octave_idx_type &curr_user_frame, bool print_subfn=true) const
octave_user_code * current_user_code(void) const
size_t current_frame(void) const
void goto_base_frame(void)
size_t dbupdown(size_t start, int n, bool verbose)
void set_top_level_value(const std::string &name, const octave_value &value)
void make_persistent(const symbol_record &sym)
int current_line(void) const
std::list< std::string > global_variable_names(void) const
octave_value get_auto_fcn_var(stack_frame::auto_var_type avt) const
std::list< std::string > top_level_variable_names(void) const
symbol_info_list top_scope_symbol_info(void) const
void set_dispatch_class(const std::string &class_name)
octave_map backtrace(octave_idx_type &curr_user_frame, bool print_subfn=true) const
void goto_caller_frame(void)
void restore_frame(size_t n)
symbol_info_list regexp_symbol_info(const std::string &pattern) const
std::list< std::shared_ptr< stack_frame > > backtrace_frames(octave_idx_type &curr_user_frame) const
void set_auto_fcn_var(stack_frame::auto_var_type avt, const octave_value &val)
std::shared_ptr< stack_frame > current_user_frame(void) const
octave_value & global_varref(const std::string &name)
octave_user_code * debug_user_code(void) const
void set_location(int l, int c)
void make_global(const symbol_record &sym)
unwind_protect * curr_fcn_unwind_protect_frame(void)
octave_value get_top_level_value(const std::string &name) const
symbol_info_list get_symbol_info(void)
octave_value do_who(int argc, const string_vector &argv, bool return_list, bool verbose=false)
bool is_class_method_executing(std::string &dispatch_class) const
octave_map empty_backtrace(void) const
std::list< std::string > variable_names(void) const
void clear_global_variable(const std::string &name)
void clear_global_variable_regexp(const std::string &pattern)
octave_value max_stack_depth(const octave_value_list &args, int nargout)
void clear_global_variable_pattern(const std::string &pattern)
int debug_user_code_column(void) const
symbol_scope top_scope(void) const
int debug_user_code_line(void) const
octave_function * current_function(bool skip_first=false) const
size_t find_current_user_frame(void) const
int current_column(void) const
std::shared_ptr< stack_frame > get_current_stack_frame(void) const
symbol_scope current_scope(void) const
cdef_method find_method(const std::string &nm, bool local=false)
octave_value find_method(const std::string &class_name, const std::string &name) const
bool is_static(void) const
octave_value get_function(void) const
cdef_class get_class(void) const
static bool interrupt(bool=true)
static std::string decode_prompt_string(const std::string &s)
static bool erase_empty_line(bool flag)
static void ignore_entries(bool=true)
static bool ignoring_entries(void)
void repl(const std::string &prompt="debug> ")
debugger(interpreter &interp, size_t level)
bool in_debug_repl(void) const
void dbquit(bool all=false)
interpreter & m_interpreter
execution_mode m_execution_mode
bool quitting_debugger(void) const
octave_value last_error_message(const octave_value_list &args, int nargout)
void save_exception(const execution_exception &e)
void set_debug_on_warning(bool flag)
octave_value debug_on_error(const octave_value_list &args, int nargout)
void display_exception(const execution_exception &e, std::ostream &os) const
octave_value debug_on_caught(const octave_value_list &args, int nargout)
octave_value last_error_id(const octave_value_list &args, int nargout)
void set_debug_on_error(bool flag)
octave_map last_error_stack(void) const
octave_value debug_on_warning(const octave_value_list &args, int nargout)
Provides threadsafe access to octave.
void enter_debugger_event(const std::string &fcn_name, const std::string &fcn_file_name, int line)
void execute_in_debugger_event(const std::string &file, int line)
virtual const char * err_id(void) const =0
void set_var(const std::string &var_arg="")
octave_value_list feval(const char *name, const octave_value_list &args=octave_value_list(), int nargout=0)
Evaluate an Octave function (built-in or interpreted) and return the list of result values.
input_system & get_input_system(void)
bool in_top_level_repl(void) const
load_path & get_load_path(void)
void recover_from_exception(void)
cdef_manager & get_cdef_manager(void)
bool interactive(void) const
symbol_table & get_symbol_table(void)
error_system & get_error_system(void)
event_manager & get_event_manager(void)
tree_evaluator & get_evaluator(void)
std::string find_file(const std::string &file) const
void assign(octave_value::assign_op, const octave_value &)
void define(const octave_value &v)
bool is_undefined(void) const
quit_debug_exception(bool all=false)
~quit_debug_exception(void)=default
quit_debug_exception & operator=(const quit_debug_exception &)=default
quit_debug_exception(const quit_debug_exception &)=default
std::map< std::string, octave_value > local_vars_map
octave_value find_user_function(const std::string &name)
octave_value find_function(const std::string &name, const symbol_scope &search_scope=symbol_scope())
void clear_function(const std::string &name)
void install_cmdline_function(const std::string &name, const octave_value &fcn)
octave_value fcn_table_find(const std::string &name, const octave_value_list &args=ovl(), const symbol_scope &search_scope=symbol_scope())
void clear_function_pattern(const std::string &pat)
void clear_dld_function(const std::string &name)
void clear_functions(bool force=false)
octave_value find_method(const std::string &name, const std::string &dispatch_type)
void clear_function_regexp(const std::string &pat)
octave_value find_scoped_function(const std::string &name, const symbol_scope &search_scope)
static bool absolute_pathname(const std::string &s)
static std::string make_absolute(const std::string &s, const std::string &dot_path=get_current_directory())
tree_expression * control_expr(void)
tree_statement_list * body(void)
tree_argument_list * left_hand_side(void)
tree_decl_init_list * initializer_list(void)
bool is_global(void) const
tree_expression * expression(void)
tree_identifier * ident(void)
bool is_persistent(void) const
void accept(tree_walker &tw)
octave_user_code * get_user_code(const std::string &fname="", const std::string &class_name="")
symbol_scope get_top_scope(void) const
void clear_symbol_pattern(const std::string &pattern)
bool is_class_method_executing(std::string &dispatch_class) const
void visit_octave_user_function_header(octave_user_function &)
octave_function * caller_function(void) const
octave_user_code * current_user_code(void) const
bool at_top_level(void) const
void remove_autoload(const std::string &fcn, const std::string &nm)
void clear_global_variables(void)
octave_map backtrace(void) const
size_t current_call_stack_frame_number(void) const
void visit_prefix_expression(tree_prefix_expression &)
octave_value evaluate(tree_decl_elt *)
void visit_statement_list(tree_statement_list &)
void visit_multi_assignment(tree_multi_assignment &)
void set_auto_fcn_var(stack_frame::auto_var_type avt, const octave_value &val=octave_value())
bool mislocked(bool skip_first=false) const
int debug_user_code_line(void) const
octave_value global_varval(const std::string &name) const
std::list< octave_value_list > m_index_list
octave_value varval(const symbol_record &sym) const
std::list< std::string > autoloaded_functions(void) const
void visit_decl_command(tree_decl_command &)
bool in_debug_repl(void) const
void visit_boolean_expression(tree_boolean_expression &)
bool is_defined(const tree_expression *expr) const
void visit_binary_expression(tree_binary_expression &)
bool is_variable(const std::string &name) const
std::list< std::string > global_variable_names(void) const
void set_echo_state(int type, const std::string &file_name, size_t pos)
bool is_global(const std::string &name) const
octave_value make_fcn_handle(const std::string &nm)
octave_value & global_varref(const std::string &name)
symbol_info_list glob_symbol_info(const std::string &pattern) const
bool quiet_breakpoint_flag(void) const
void visit_cell(tree_cell &)
int dbstep_flag(void) const
int continuing(void) const
std::map< std::string, std::string > m_autoload_map
void clear_variables(void)
symbol_info_list top_scope_symbol_info(void) const
octave_value do_who(int argc, const string_vector &argv, bool return_list, bool verbose=false)
bool maybe_push_echo_state_cleanup(void)
void install_variable(const std::string &name, const octave_value &value, bool global)
std::string PS4(void) const
void clear_symbol_regexp(const std::string &pattern)
void visit_simple_for_command(tree_simple_for_command &)
void maybe_set_echo_state(void)
void visit_octave_user_function_trailer(octave_user_function &)
void clear_global_variable_pattern(const std::string &pattern)
void clear_global_variable_regexp(const std::string &pattern)
std::list< octave_lvalue > make_lvalue_list(tree_argument_list *)
octave_value m_indexed_object
bool switch_case_label_matches(tree_switch_case *expr, const octave_value &val)
std::string mfilename(const std::string &opt="") const
std::list< frame_info > backtrace_info(void) const
void visit_parameter_list(tree_parameter_list &)
std::stack< debugger * > m_debugger_stack
bool silent_functions(void) const
const std::list< octave_lvalue > * m_lvalue_list
void visit_switch_command(tree_switch_command &)
void visit_decl_elt(tree_decl_elt &)
void visit_simple_assignment(tree_simple_assignment &)
octave_value_list execute_user_script(octave_user_script &user_script, int nargout, const octave_value_list &args)
void final_index_error(index_exception &e, const tree_expression *expr)
void restore_frame(size_t n)
void mlock(bool skip_first=false) const
void visit_do_until_command(tree_do_until_command &)
void undefine_parameter_list(tree_parameter_list *param_list)
void visit_if_command(tree_if_command &)
std::string m_echo_file_name
int m_max_recursion_depth
void visit_break_command(tree_break_command &)
std::map< std::string, bool > m_echo_files
void bind_ans(const octave_value &val, bool print)
std::string current_function_name(bool skip_first=false) const
octave_value top_level_varval(const std::string &name) const
void visit_postfix_expression(tree_postfix_expression &)
std::string m_whos_line_format
octave_value_list execute_user_function(octave_user_function &user_function, int nargout, const octave_value_list &args)
int current_line(void) const
void goto_base_frame(void)
octave_user_code * debug_user_code(void) const
std::list< std::string > variable_names(void) const
int debug_user_code_column(void) const
void pop_stack_frame(void)
void visit_if_clause(tree_if_clause &)
octave_value get_auto_fcn_var(stack_frame::auto_var_type avt) const
std::string backtrace_message(void) const
void visit_compound_binary_expression(tree_compound_binary_expression &)
octave_function * current_function(bool skip_first=false) const
int num_indices(void) const
void visit_statement(tree_statement &)
int max_recursion_depth(void) const
void assignin(const std::string &context, const std::string &name, const octave_value &val=octave_value())
octave_map get_autoload_map(void) const
octave_value_list evalin(const std::string &context, const std::string &try_code, int nargout)
void top_level_assign(const std::string &name, const octave_value &val=octave_value())
void visit_anon_fcn_handle(tree_anon_fcn_handle &)
void source_file(const std::string &file_name, const std::string &context="", bool verbose=false, bool require_file=true)
std::string whos_line_format(void) const
std::string lookup_autoload(const std::string &nm) const
void clear_variable(const std::string &name)
bool goto_frame(size_t n=0, bool verbose=false)
bool is_class_constructor_executing(std::string &dispatch_class) const
void visit_index_expression(tree_index_expression &)
Matrix ignored_fcn_outputs(void) const
void define_parameter_list_from_arg_vector(tree_parameter_list *param_list, const octave_value_list &args)
void uwp_set_echo_state(bool state, const std::string &file_name, size_t pos)
void clear_variable_pattern(const std::string &pattern)
void visit_return_command(tree_return_command &)
void clear_all(bool force=false)
std::string get_dispatch_class(void) const
void visit_octave_user_function(octave_user_function &)
octave_value find(const std::string &name)
void visit_if_command_list(tree_if_command_list &)
unwind_protect * curr_fcn_unwind_protect_frame(void)
bool in_user_code(void) const
octave_value_list evaluate_end_expression(const octave_value_list &args)
bool eval_decl_elt(tree_decl_elt *elt)
interpreter & m_interpreter
symbol_info_list regexp_symbol_info(const std::string &pattern) const
octave_value max_stack_depth(const octave_value_list &args, int nargout)
void assign(const std::string &name, const octave_value &val=octave_value())
void set_dispatch_class(const std::string &class_name)
void display_call_stack(void) const
bool is_logically_true(tree_expression *expr, const char *warn_for)
void clear_global_variable(const std::string &name)
octave_value PS4(const octave_value_list &args, int nargout)
symbol_info_list get_symbol_info(void)
void push_dummy_scope(const std::string &name)
octave_value whos_line_format(const octave_value_list &args, int nargout)
bool statement_printing_enabled(void)
void push_echo_state(int type, const std::string &file_name, size_t pos=1)
void keyboard(const std::string &prompt="keyboard> ")
int returning(void) const
void visit_identifier(tree_identifier &)
void visit_while_command(tree_while_command &)
octave_map empty_backtrace(void) const
void visit_complex_for_command(tree_complex_for_command &)
void dbquit(bool all=false)
void bind_auto_fcn_vars(const string_vector &arg_names, const Matrix &ignored_outputs, int nargin, int nargout, bool takes_varargs, const octave_value_list &va_args)
size_t debug_frame(void) const
octave_value_list convert_to_const_vector(tree_argument_list *arg_list)
std::list< std::shared_ptr< stack_frame > > backtrace_frames() const
stmt_list_type m_statement_context
bool echo_this_file(const std::string &file, int type) const
void visit_constant(tree_constant &)
void dbupdown(int n, bool verbose=false)
std::list< std::string > reverse_lookup_autoload(const std::string &nm) const
void add_autoload(const std::string &fcn, const std::string &nm)
std::string check_autoload_file(const std::string &nm) const
char string_fill_char(void) const
octave_value_list make_value_list(tree_argument_list *args, const string_vector &arg_nm)
void do_unwind_protect_cleanup_code(tree_statement_list *list)
void do_breakpoint(tree_statement &stmt)
void visit_switch_case_list(tree_switch_case_list &)
void eval(std::shared_ptr< tree_statement_list > &stmt_list, bool interactive)
void goto_caller_frame(void)
void visit_switch_case(tree_switch_case &)
void visit_try_catch_command(tree_try_catch_command &)
std::shared_ptr< stack_frame > current_user_frame(void) const
void visit_octave_user_script(octave_user_script &)
void visit_matrix(tree_matrix &)
void clear_symbol(const std::string &name)
void reset_debug_state(void)
void visit_continue_command(tree_continue_command &)
void visit_function_def(tree_function_def &)
void visit_argument_list(tree_argument_list &)
void debug_where(std::ostream &os) const
void visit_unwind_protect_command(tree_unwind_protect_command &)
octave_value_list eval_string(const std::string &eval_str, bool silent, int &parse_status, int nargout)
void munlock(bool skip_first=false) const
void enter_debugger(const std::string &prompt="debug> ")
void push_echo_state_cleanup(unwind_protect &frame)
void visit_metaclass_query(tree_metaclass_query &)
void global_assign(const std::string &name, const octave_value &val=octave_value())
int current_column(void) const
void push_stack_frame(const symbol_scope &scope)
void clear_variable_regexp(const std::string &pattern)
void echo_code(size_t line)
bool is_local_variable(const std::string &name) const
std::list< std::string > top_level_variable_names(void) const
void visit_colon_expression(tree_colon_expression &)
void visit_superclass_ref(tree_superclass_ref &)
octave_value echo(const octave_value_list &args, int nargout)
symbol_scope get_current_scope(void) const
int index_position(void) const
void visit_fcn_handle(tree_fcn_handle &)
octave_value_list convert_return_list_to_const_vector(tree_parameter_list *ret_list, int nargout, const Matrix &ignored_outputs, const Cell &varargout)
void visit_no_op_command(tree_no_op_command &)
virtual bool is_identifier(void) const
virtual octave_value_list evaluate_n(tree_evaluator &tw, int nargout=1)=0
virtual octave_lvalue lvalue(tree_evaluator &)
virtual std::string name(void) const
virtual octave_value evaluate(tree_evaluator &tw, int nargout=1)=0
virtual bool is_assignment_expression(void) const
tree_expression * set_print_flag(bool print)
bool print_result(void) const
octave_value function(void)
octave_value evaluate(tree_evaluator &tw, int nargout=1)
octave_lvalue lvalue(tree_evaluator &tw)
symbol_record symbol(void) const
virtual bool is_black_hole(void) const
void accept(tree_walker &tw)
tree_if_command_list * cmd_list(void)
static bool execute(tree_simple_for_command &cmd, const octave_value &bounds)
bool is_end_of_fcn_or_script(void) const
bool takes_varargs(void) const
tree_expression * control_expr(void)
tree_expression * left_hand_side(void)
tree_statement_list * body(void)
void accept(tree_walker &tw)
bool is_end_of_fcn_or_script(void) const
bool is_active_breakpoint(tree_evaluator &tw) const
bool is_expression(void) const
tree_expression * expression(void)
void accept(tree_walker &tw)
tree_command * command(void)
tree_expression * case_label(void)
tree_switch_case_list * case_list(void)
tree_expression * switch_value(void)
tree_statement_list * cleanup(void)
tree_identifier * identifier(void)
tree_statement_list * body(void)
tree_statement_list * cleanup(void)
tree_statement_list * body(void)
tree_statement_list * body(void)
tree_expression * condition(void)
virtual int column(void) const
bool is_active_breakpoint(tree_evaluator &tw) const
virtual void accept(tree_walker &tw)=0
virtual int line(void) const
virtual bool is_user_code(void) const
virtual bool is_user_function(void) const
virtual bool is_builtin_function(void) const
octave::cdef_object get_object(void) const
octave_classdef * classdef_object_value(bool=false)
std::string class_name(void) const
std::string dispatch_class(void) const
bool is_private_function(void) const
bool is_class_method(const std::string &cname="") const
bool is_class_constructor(const std::string &cname="") const
virtual bool is_subfunction(void) const
virtual std::list< std::string > parent_fcn_names(void) const
bool islocked(void) const
virtual octave_value_list call(octave::tree_evaluator &tw, int nargout=0, const octave_value_list &args=octave_value_list())
std::string name(void) const
virtual bool is_nested_function(void) const
string_vector keys(void) const
const Cell & contents(const_iterator p) const
void assign(const std::string &k, const octave_value &val)
std::string get_code_line(size_t line)
std::string fcn_file_name(void) const
octave::tree_statement_list * body(void)
virtual octave_value find_subfunction(const std::string &) const
std::deque< std::string > get_code_lines(size_t line, size_t num_lines)
Cell cell_value(void) const
void resize(octave_idx_type n, const octave_value &rfv=octave_value())
void stash_name_tags(const string_vector &nm)
octave_idx_type length(void) const
string_vector name_tags(void) const
octave_value_list slice(octave_idx_type offset, octave_idx_type len, bool tags=false) const
string_vector make_argv(const std::string &="") const
bool is_function(void) const
Cell xcell_value(const char *fmt,...) const
octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
bool is_scalar_type(void) const
Range range_value(void) const
bool is_cs_list(void) const
bool is_string(void) const
octave_user_code * user_code_value(bool silent=false) const
bool is_user_code(void) const
bool is_defined(void) const
Cell cell_value(void) const
bool is_equal(const octave_value &) const
std::string class_name(void) const
octave_function * function_value(bool silent=false) const
bool isstruct(void) const
octave_value reshape(const dim_vector &dv) const
bool is_matrix_type(void) const
octave_value storable_value(void) const
bool is_range(void) const
octave_value_list list_value(void) const
bool isobject(void) const
std::string xstring_value(const char *fmt,...) const
octave_map map_value(void) const
bool is_undefined(void) const
dim_vector dims(void) const
octave_idx_type numel(void) const
OCTINTERP_API void print_usage(void)
#define DEFMETHOD(name, interp_name, args_name, nargout_name, doc)
Macro to define a builtin method.
#define DEFCONSTMETHOD(name, interp_name, args_name, nargout_name, doc)
Macro to define a builtin method that cannot be hidden by a variable.
void error_with_id(const char *id, const char *fmt,...)
void warning(const char *fmt,...)
void interpreter_try(octave::unwind_protect &frame)
void warning_with_id(const char *id, const char *fmt,...)
void error(const char *fmt,...)
#define panic_impossible()
void err_indexed_cs_list(void)
std::string dir_sep_str(void)
std::string tilde_expand(const std::string &name)
std::string dir_sep_chars(void)
std::string canonicalize_file_name(const std::string &name)
octave_value parse_fcn_file(interpreter &interp, const std::string &full_file, const std::string &file, const std::string &dir_name, const std::string &dispatch_type, const std::string &package_name, bool require_file, bool force_script, bool autoload, bool relative_lookup)
static uint32_t state[624]
bool valid_identifier(const char *s)
static double f(double k, double l_nu, double c_pm)
static llvm::LLVMContext & context
bool iskeyword(const std::string &s)
static std::string get_operator_function_name(const std::string &name)
std::string fcn_file_in_path(const std::string &name)
static octave_value end_value(const octave_value &value, octave_idx_type index_position, octave_idx_type num_indices)
octave_value_list feval(const char *name, const octave_value_list &args, int nargout)
Evaluate an Octave function (built-in or interpreted) and return the list of result values.
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
octave_value::octave_value(const Array< char > &chm, char type) return retval
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.
sig_atomic_t octave_interrupt_state
octave_value set_internal_variable(bool &var, const octave_value_list &args, int nargout, const char *nm)