#include <cstdarg>
#include <cstring>
#include <iostream>
#include <sstream>
#include <string>
#include "defun.h"
#include "error.h"
#include "input.h"
#include "pager.h"
#include "oct-obj.h"
#include "oct-map.h"
#include "utils.h"
#include "ov.h"
#include "ov-usr-fcn.h"
#include "pt-pr-code.h"
#include "pt-stmt.h"
#include "toplev.h"
#include "unwind-prot.h"
#include "variables.h"
Go to the source code of this file.
Typedefs | |
typedef void(* | error_fun )(const char *, const char *,...) |
Functions | |
static int | check_state (const std::string &state) |
DEFUN (rethrow, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} rethrow (@var{err})\n\ Reissue a previous error as defined by @var{err}. @var{err} is a structure\n\ that must contain at least the 'message' and 'identifier' fields. @var{err}\n\ can also contain a field 'stack' that gives information on the assumed\n\ location of the error. Typically @var{err} is returned from\n\ @code{lasterror}.\n\ @seealso{lasterror, lasterr, error}\n\ @end deftypefn") | |
DEFUN (error, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} error (@var{template}, @dots{})\n\ @deftypefnx {Built-in Function} {} error (@var{id}, @var{template}, @dots{})\n\ Format the optional arguments under the control of the template string\n\ @var{template} using the same rules as the @code{printf} family of\n\ functions (@pxref{Formatted Output}) and print the resulting message\n\ on the @code{stderr} stream. The message is prefixed by the character\n\ string @samp{error: }.\n\ \n\ Calling @code{error} also sets Octave's internal error state such that\n\ control will return to the top level without evaluating any more\n\ commands. This is useful for aborting from functions or scripts.\n\ \n\ If the error message does not end with a new line character, Octave will\n\ print a traceback of all the function calls leading to the error. For\n\ example, given the following function definitions:\n\ \n\ @example\n\ @group\n\ function f () g (); end\n\ function g () h (); end\n\ function h () nargin == 1 || error (\"nargin != 1\"); end\n\ @end group\n\ @end example\n\ \n\ @noindent\n\ calling the function @code{f} will result in a list of messages that\n\ can help you to quickly locate the exact location of the error:\n\ \n\ @example\n\ @group\n\ f ()\n\ error: nargin != 1\n\ error: called from:\n\ error: error at line -1, column -1\n\ error: h at line 1, column 27\n\ error: g at line 1, column 15\n\ error: f at line 1, column 15\n\ @end group\n\ @end example\n\ \n\ If the error message ends in a new line character, Octave will print the\n\ message but will not display any traceback messages as it returns\n\ control to the top level. For example, modifying the error message\n\ in the previous example to end in a new line causes Octave to only print\n\ a single message:\n\ \n\ @example\n\ @group\n\ function h () nargin == 1 || error (\"nargin != 1\\n\"); end\n\ f ()\n\ error: nargin != 1\n\ @end group\n\ @end example\n\ @end deftypefn") | |
DEFUN (warning, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} warning (@var{template}, @dots{})\n\ @deftypefnx {Built-in Function} {} warning (@var{id}, @var{template}, @dots{})\n\ @deftypefnx {Built-in Function} {} warning (\"on\", @var{id})\n\ @deftypefnx {Built-in Function} {} warning (\"off\", @var{id})\n\ @deftypefnx {Built-in Function} {} warning (\"query\", @var{id})\n\ @deftypefnx {Built-in Function} {} warning (\"error\", @var{id})\n\ Format the optional arguments under the control of the template string\n\ @var{template} using the same rules as the @code{printf} family of\n\ functions (@pxref{Formatted Output}) and print the resulting message\n\ on the @code{stderr} stream. The message is prefixed by the character\n\ string @samp{warning: }.\n\ You should use this function when you want to notify the user\n\ of an unusual condition, but only when it makes sense for your program\n\ to go on.\n\ \n\ The optional message identifier allows users to enable or disable\n\ warnings tagged by @var{id}. A message identifier is of the form\n\ \"NAMESPACE:WARNING-NAME\". Octave's own warnings use the \"Octave\"\n\ namespace (@pxref{doc-warning_ids}). The special identifier @samp{\"all\"}\n\ may be used to set the state of all warnings.\n\ \n\ If the first argument is @samp{\"on\"} or @samp{\"off\"}, set the state\n\ of a particular warning using the identifier @var{id}. If the first\n\ argument is @samp{\"query\"}, query the state of this warning instead.\n\ If the identifier is omitted, a value of @samp{\"all\"} is assumed. If\n\ you set the state of a warning to @samp{\"error\"}, the warning named by\n\ @var{id} is handled as if it were an error instead. So, for example, the\n\ following handles all warnings as errors:\n\ \n\ @example\n\ @group\n\ warning (\"error\");\n\ @end group\n\ @end example\n\ @seealso{warning_ids}\n\ @end deftypefn") | |
DEFUN (lasterror, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{lasterr} =} lasterror ()\n\ @deftypefnx {Built-in Function} {} lasterror (@var{err})\n\ @deftypefnx {Built-in Function} {} lasterror ('reset')\n\ Query or set the last error message structure. When called without\n\ arguments, return a structure containing the last error message and other\n\ information related to this error. The elements of the structure are:\n\ \n\ @table @asis\n\ @item 'message'\n\ The text of the last error message\n\ \n\ @item 'identifier'\n\ The message identifier of this error message\n\ \n\ @item 'stack'\n\ A structure containing information on where the message occurred. This may\n\ be an empty structure if the information cannot\n\ be obtained. The fields of the structure are:\n\ \n\ @table @asis\n\ @item 'file'\n\ The name of the file where the error occurred\n\ \n\ @item 'name'\n\ The name of function in which the error occurred\n\ \n\ @item 'line'\n\ The line number at which the error occurred\n\ \n\ @item 'column'\n\ An optional field with the column number at which the error occurred\n\ @end table\n\ @end table\n\ \n\ The last error structure may be set by passing a scalar structure, @var{err},\n\ as input. Any fields of @var{err} that match those above are set while any\n\ unspecified fields are initialized with default values.\n\ \n\ If @code{lasterror} is called with the argument 'reset', all fields are\n\ set to their default values.\n\ @seealso{lasterr}\n\ @end deftypefn") | |
DEFUN (lasterr, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{msg}, @var{msgid}] =} lasterr ()\n\ @deftypefnx {Built-in Function} {} lasterr (@var{msg})\n\ @deftypefnx {Built-in Function} {} lasterr (@var{msg}, @var{msgid})\n\ Query or set the last error message. When called without input arguments,\n\ return the last error message and message identifier. With one\n\ argument, set the last error message to @var{msg}. With two arguments,\n\ also set the last message identifier.\n\ @seealso{lasterror}\n\ @end deftypefn") | |
DEFUN (lastwarn, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{msg}, @var{msgid}] =} lastwarn (@var{msg}, @var{msgid})\n\ Without any arguments, return the last warning message. With one\n\ argument, set the last warning message to @var{msg}. With two arguments,\n\ also set the last message identifier.\n\ @end deftypefn") | |
DEFUN (usage, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} usage (@var{msg})\n\ Print the message @var{msg}, prefixed by the string @samp{usage: }, and\n\ set Octave's internal error state such that control will return to the\n\ top level without evaluating any more commands. This is useful for\n\ aborting from functions.\n\ \n\ After @code{usage} is evaluated, Octave will print a traceback of all\n\ the function calls leading to the usage message.\n\ \n\ You should use this function for reporting problems errors that result\n\ from an improper call to a function, such as calling a function with an\n\ incorrect number of arguments, or with arguments of the wrong type. For\n\ example, most functions distributed with Octave begin with code like\n\ this\n\ \n\ @example\n\ @group\n\ if (nargin != 2)\n\ usage (\"foo (a, b)\");\n\ endif\n\ @end group\n\ @end example\n\ \n\ @noindent\n\ to check for the proper number of arguments.\n\ @end deftypefn") | |
DEFUN (beep_on_error, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} beep_on_error ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} beep_on_error (@var{new_val})\n\ @deftypefnx {Built-in Function} {} beep_on_error (@var{new_val}, \"local\")\n\ Query or set the internal variable that controls whether Octave will try\n\ to ring the terminal bell before printing an error message.\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ @end deftypefn") | |
DEFUN (debug_on_error, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} debug_on_error ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} debug_on_error (@var{new_val})\n\ @deftypefnx {Built-in Function} {} debug_on_error (@var{new_val}, \"local\")\n\ Query or set the internal variable that controls whether Octave will try\n\ to enter the debugger when an error is encountered. This will also\n\ inhibit printing of the normal traceback message (you will only see\n\ the top-level error message).\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ @seealso{debug_on_warning, debug_on_interrupt}\n\ @end deftypefn") | |
DEFUN (debug_on_warning, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} debug_on_warning ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} debug_on_warning (@var{new_val})\n\ @deftypefnx {Built-in Function} {} debug_on_warning (@var{new_val}, \"local\")\n\ Query or set the internal variable that controls whether Octave will try\n\ to enter the debugger when a warning is encountered.\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ @seealso{debug_on_error, debug_on_interrupt}\n\ @end deftypefn") | |
void | defun_usage_message (const std::string &msg) |
static void | defun_usage_message_1 (const char *fmt,...) |
void | disable_warning (const std::string &id) |
void | error (const char *fmt,...) |
static void | error_1 (std::ostream &os, const char *name, const char *id, const char *fmt, va_list args, bool with_cfn=false) |
static void | error_2 (const char *id, const char *fmt, va_list args, bool with_cfn=false) |
void | error_with_cfn (const char *fmt,...) |
void | error_with_id (const char *id, const char *fmt,...) |
void | error_with_id_cfn (const char *id, const char *fmt,...) |
octave_value_list | Fsprintf (const octave_value_list &, int) |
static std::string | handle_message (error_fun f, const char *id, const char *msg, const octave_value_list &args) |
void | initialize_default_warning_state (void) |
static octave_map | initialize_last_error_stack (void) |
static void | initialize_warning_options (const std::string &state) |
void | interpreter_try (unwind_protect &frame) |
std::string | last_error_id (void) |
std::string | last_error_message (void) |
std::string | last_warning_id (void) |
std::string | last_warning_message (void) |
void | message (const char *name, const char *fmt,...) |
void | message_with_id (const char *name, const char *id, const char *fmt,...) |
void | panic (const char *fmt,...) |
void | parse_error (const char *fmt,...) |
void | parse_error_with_id (const char *id, const char *fmt,...) |
static void | pr_where (const char *who) |
static void | pr_where_1 (const char *fmt,...) |
static void | pr_where_2 (const char *fmt, va_list args) |
void | reset_error_handler (void) |
void | rethrow_error (const char *id, const char *fmt,...) |
octave_value_list | set_warning_state (const octave_value_list &args) |
octave_value_list | set_warning_state (const std::string &id, const std::string &state) |
void | usage (const char *fmt,...) |
void | usage_1 (const char *id, const char *fmt, va_list args) |
void | usage_with_id (const char *id, const char *fmt,...) |
void | verror (const char *fmt, va_list args) |
static void | verror (bool save_last_error, std::ostream &os, const char *name, const char *id, const char *fmt, va_list args, bool with_cfn=false) |
void | verror_with_cfn (const char *fmt, va_list args) |
void | verror_with_id (const char *id, const char *fmt, va_list args) |
void | verror_with_id_cfn (const char *id, const char *fmt, va_list args) |
void | vmessage (const char *name, const char *fmt, va_list args) |
void | vmessage_with_id (const char *name, const char *id, const char *fmt, va_list args) |
void | vparse_error (const char *fmt, va_list args) |
void | vparse_error_with_id (const char *id, const char *fmt, va_list args) |
void | vusage (const char *fmt, va_list args) |
void | vusage_with_id (const char *id, const char *fmt, va_list args) |
static void | vwarning (const char *name, const char *id, const char *fmt, va_list args) |
void | vwarning (const char *fmt, va_list args) |
void | vwarning_with_id (const char *id, const char *fmt, va_list args) |
void | warning (const char *fmt,...) |
static void | warning_1 (const char *id, const char *fmt, va_list args) |
int | warning_enabled (const std::string &id) |
void | warning_with_id (const char *id, const char *fmt,...) |
Variables | |
int | buffer_error_messages = 0 |
bool | discard_error_messages = false |
bool | discard_warning_messages = false |
int | error_state = 0 |
static bool | Vbacktrace_on_warning = false |
static bool | Vbeep_on_error = false |
bool | Vdebug_on_error = false |
bool | Vdebug_on_warning = false |
static std::string | Vlast_error_id |
static std::string | Vlast_error_message |
static octave_map | Vlast_error_stack |
static std::string | Vlast_warning_id |
static std::string | Vlast_warning_message |
static bool | Vquiet_warning = false |
static bool | Vverbose_warning |
static octave_map | warning_options |
int | warning_state = 0 |
static int check_state | ( | const std::string & | state | ) | [static] |
Definition at line 537 of file error.cc.
Referenced by warning_enabled().
DEFUN | ( | rethrow | , | |
args | ||||
) |
Definition at line 829 of file error.cc.
References octave_map::contains(), octave_scalar_map::contains(), octave_map::contents(), octave_scalar_map::contents(), error(), initialize_last_error_stack(), octave_value::map_value(), octave_base_value::nint_value(), octave_map::numel(), pr_where_1(), print_usage(), rethrow_error(), octave_base_value::string_value(), octave_value::string_value(), and strsave().
DEFUN | ( | error | , | |
args | ||||
) |
Definition at line 965 of file error.cc.
References octave_scalar_map::contains(), error_with_id(), octave_scalar_map::getfield(), handle_message(), octave_base_value::is_empty(), octave_base_value::is_map(), octave_value::is_string(), octave_scalar_map::nfields(), print_usage(), octave_value_list::resize(), octave_value::scalar_map_value(), and octave_value::string_value().
DEFUN | ( | warning | , | |
args | , | |||
nargout | ||||
) |
Definition at line 1094 of file error.cc.
References arg(), octave_scalar_map::assign(), octave_map::assign(), octave_map::clear(), octave_map::contains(), octave_map::contents(), error(), handle_message(), initialize_warning_options(), octave_value::is_map(), octave_value::is_string(), octave_value::map_value(), Array< T >::numel(), octave_value_list::resize(), Array< T >::resize(), state, octave_base_value::string_value(), octave_value::string_value(), Vlast_warning_id, Vlast_warning_message, and warning_with_id().
DEFUN | ( | lasterror | , | |
args | ||||
) |
Definition at line 1488 of file error.cc.
References octave_scalar_map::assign(), octave_call_stack::backtrace(), octave_scalar_map::contains(), error(), octave_scalar_map::getfield(), initialize_last_error_stack(), octave_base_value::is_map(), octave_base_value::is_string(), octave_value::nint_value(), print_usage(), unwind_protect::protect_var(), octave_value::scalar_map_value(), octave_value::string_value(), octave_base_value::string_value(), Vlast_error_id, and Vlast_error_message.
DEFUN | ( | lasterr | , | |
args | , | |||
nargout | ||||
) |
Definition at line 1646 of file error.cc.
References error(), print_usage(), unwind_protect::protect_var(), Vlast_error_id, and Vlast_error_message.
DEFUN | ( | lastwarn | , | |
args | , | |||
nargout | ||||
) |
Definition at line 1697 of file error.cc.
References error(), print_usage(), Vlast_warning_id, and Vlast_warning_message.
DEFUN | ( | usage | , | |
args | ||||
) |
Definition at line 1740 of file error.cc.
References handle_message(), and usage_with_id().
DEFUN | ( | beep_on_error | , | |
args | , | |||
nargout | ||||
) |
Definition at line 1774 of file error.cc.
References SET_INTERNAL_VARIABLE.
DEFUN | ( | debug_on_error | , | |
args | , | |||
nargout | ||||
) |
Definition at line 1790 of file error.cc.
References SET_INTERNAL_VARIABLE.
DEFUN | ( | debug_on_warning | , | |
args | , | |||
nargout | ||||
) |
Definition at line 1809 of file error.cc.
References SET_INTERNAL_VARIABLE.
void defun_usage_message | ( | const std::string & | msg | ) |
Definition at line 756 of file error.cc.
References defun_usage_message_1().
static void defun_usage_message_1 | ( | const char * | fmt, | |
... | ||||
) | [static] |
Definition at line 747 of file error.cc.
References error_1(), and octave_stdout.
Referenced by defun_usage_message().
void disable_warning | ( | const std::string & | id | ) |
Definition at line 1454 of file error.cc.
References set_warning_state().
Referenced by initialize_default_warning_state(), and maximum_braindamage().
void error | ( | const char * | fmt, | |
... | ||||
) |
Definition at line 483 of file error.cc.
References verror().
Referenced by octave_char_matrix_str::all_strings(), octave_class::all_strings(), tree_index_expression::append(), tree_colon_expression::append(), octave_value::assign(), octave_base_sparse< T >::assign(), Octave_map::assign(), octave_map::assign(), octave_map::cat(), octave_char_matrix_str::cellstr_value(), octave_cell::cellstr_value(), load_path::check_file_type(), check_version(), Cell::column(), octave_class::exemplar_info::compare(), OCTAVE_VALUE_INT_MATRIX_T::complex_matrix_value(), Octave_map::concat(), octave_map::concat(), convert(), convert_cdata(), tree_argument_list::convert_to_const_vector(), decode_subscripts(), decompose_binary_op(), DEFBINOPX(), DEFCONSTFUN(), tree_parameter_list::define_from_arg_vector(), DEFUN(), DEFUN_DLD(), DEFUNOP(), DEFUNX(), octave_base_sparse< T >::delete_elements(), symbol_info_list::symbol_info::display_line(), do_accumarray_minmax(), do_accumarray_sum(), do_accumdim_sum(), bp_table::do_add_breakpoint(), octave_call_stack::do_backtrace_error_message(), do_bitpack(), do_cumminmax_body(), do_dbstack(), do_dbupdown(), do_extended_gcd(), do_fft(), do_fft2(), do_fftn(), do_fread(), symbol_table::scope_id_cache::do_free(), do_fwrite(), octave_stream_list::do_get_file_number(), octave_stream_list::do_get_info(), do_history(), octave_base_value::do_index_op(), octave_base_sparse< T >::do_index_op(), octave_stream_list::do_insert(), do_isglobal(), do_load(), octave_dynamic_loader::do_load_mex(), octave_dynamic_loader::do_load_oct(), do_merge(), do_minmax_body(), octave_user_function::do_multi_index_op(), octave_user_script::do_multi_index_op(), octave_mex_function::do_multi_index_op(), octave_fcn_handle::do_multi_index_op(), octave_builtin::do_multi_index_op(), octave_base_value::do_multi_index_op(), octave_value::do_non_const_unary_op(), do_num2cell_helper(), do_object2cell(), do_printf_conv(), do_rand(), bp_table::do_remove_all_breakpoints_in_file(), bp_table::do_remove_breakpoint(), do_repelems(), do_simple_cellfun(), do_simple_gcd(), do_strcmp_fun(), do_stream_open(), do_tril(), do_trilu(), do_triu(), octave_lvalue::do_unary_op(), do_who(), octave_scalar_struct::dotref(), octave_struct::dotref(), octave_class::dotref(), octave_stream::error(), eval_error(), tree_colon_expression::eval_error(), tree_identifier::eval_undefined_error(), octave_class::exemplar_info::exemplar_info(), extract_function(), fill_matrix(), filter(), find_file_to_load(), OCTAVE_VALUE_INT_MATRIX_T::float_complex_matrix_value(), OCTAVE_VALUE_INT_MATRIX_T::float_matrix_value(), fopen_mode_to_ios_mode(), symbol_table::free_scope(), get_dim_vector(), get_dimensions(), get_global_value(), get_graphics_object_type(), symbol_table::get_instance(), get_lines_and_columns(), get_mapper_fun_options(), get_property_from_handle(), get_size(), get_sort_mode_option(), get_sscanf_data(), tree_index_expression::get_struct_index(), get_top_level_value(), get_user_input(), tree_checker::gripe(), gripe_2_or_3_dim_plot(), gripe_assign_conversion_failed(), gripe_assign_failed_or_no_method(), gripe_bessel_arg(), gripe_binary_op(), gripe_binary_op_conv(), gripe_cat_op(), gripe_cat_op_conv(), gripe_data_conversion(), gripe_empty_arg(), unwind_protect_safe::gripe_exception(), gripe_failed_assignment(), gripe_file_open(), gripe_indexed_assignment(), gripe_indexed_cs_list(), gripe_internal(), gripe_invalid_conversion(), gripe_invalid_file_id(), gripe_invalid_index1(), gripe_invalid_index_for_assignment(), gripe_invalid_index_type(), gripe_invalid_inquiry_subscript(), gripe_library_execution_error(), gripe_no_conversion(), gripe_nonbraced_cs_list_assignment(), gripe_nonconformant(), gripe_not_implemented(), gripe_not_supported(), gripe_range_invalid(), gripe_set_invalid(), gripe_square_matrix_required(), gripe_string_invalid(), gripe_unary_op(), gripe_unary_op_conv(), gripe_unary_op_conversion_failed(), gripe_unrecognized_data_fmt(), gripe_unrecognized_float_fmt(), gripe_user_returned_invalid(), gripe_user_supplied_eval(), gripe_wrong_type_arg(), gripe_wrong_type_arg_for_binary_op(), gripe_wrong_type_arg_for_unary_op(), identity_matrix(), octave_sparse_matrix::index_vector(), octave_complex::index_vector(), octave_class::index_vector(), octave_base_value::index_vector(), octave_call_stack::instance_ok(), symbol_table::scope_id_cache::instance_ok(), octave_child_list::instance_ok(), octave_diary_stream::instance_ok(), octave_pager_stream::instance_ok(), octave_value_typeinfo::instance_ok(), octave_stream_list::instance_ok(), load_path::instance_ok(), octave_dynamic_loader::instance_ok(), octave_mex_file_list::instance_ok(), octave_shlib_list::instance_ok(), display_info::instance_ok(), bp_table::instance_ok(), octave_comment_buffer::instance_ok(), tree_expression::is_logically_true(), octave_cell::is_sorted(), octave_cell::is_sorted_rows(), octave_cell::is_true(), is_valid_function(), isargout1(), lin_interpn(), octave_scalar_struct::load_ascii(), octave_struct::load_ascii(), octave_char_matrix_str::load_ascii(), octave_scalar::load_ascii(), octave_matrix::load_ascii(), octave_range::load_ascii(), octave_perm_matrix::load_ascii(), octave_lazy_index::load_ascii(), octave_float_matrix::load_ascii(), octave_float_complex_matrix::load_ascii(), octave_float_complex::load_ascii(), octave_float_scalar::load_ascii(), octave_fcn_handle::load_ascii(), octave_complex_matrix::load_ascii(), octave_complex::load_ascii(), octave_class::load_ascii(), octave_cell::load_ascii(), octave_bool::load_ascii(), octave_bool_matrix::load_ascii(), octave_base_sparse< T >::load_ascii(), octave_base_int_scalar< T >::load_ascii(), octave_base_int_matrix< T >::load_ascii(), octave_base_diag< DMT, MT >::load_ascii(), octave_scalar_struct::load_binary(), octave_struct::load_binary(), octave_sparse_matrix::load_binary(), octave_lazy_index::load_binary(), octave_fcn_handle::load_binary(), octave_sparse_complex_matrix::load_binary(), octave_class::load_binary(), octave_cell::load_binary(), octave_sparse_bool_matrix::load_binary(), tree_index_expression::lvalue(), tree_expression::lvalue(), octave_value_list::make_argv(), make_fcn_handle(), make_graphics_object(), make_idx_args(), tree_colon_expression::make_range(), mex::malloc_unmarked(), octave_base_value::map(), symbol_table::symbol_record::symbol_record_rep::mark_global(), symbol_table::symbol_record::symbol_record_rep::mark_persistent(), mat2cell_mismatch(), OCTAVE_VALUE_INT_MATRIX_T::matrix_value(), mexErrMsgIdAndTxt(), mexErrMsgTxt(), mk_tmp_hist_file(), mlock(), octave_base_value::nint_value(), octave_class::numel(), octave_base_value::numeric_assign(), oct_catop_matrix_struct(), oct_catop_struct_matrix(), octave_catch_interrupts(), octave_change_to_directory(), octave_class::octave_class(), octave_fcn_inline::octave_fcn_inline(), Octave_map::Octave_map(), octave_oncleanup::octave_oncleanup(), octave_range::octave_range(), octcellregexp(), octave_value::op_eq_to_binary_op(), open_diary_file(), octave_map::optimize_dimensions(), octave_map::orderfields(), octave_scalar_map::orderfields(), parse_dbfunction_params(), parse_options(), parse_save_options(), symbol_info_list::parse_whos_line_format(), symbol_table::pop_context(), print_usage(), symbol_table::push_context(), qelg(), qp(), raw_mode(), read_ascii_data(), read_binary_data(), read_binary_file_header(), read_mat5_binary_element(), read_mat5_binary_file_header(), read_mat_ascii_data(), read_mat_binary_data(), read_mat_file_header(), reinterpret_copy(), reparent(), profile_data_accumulator::reset(), run_command_and_return_output(), tree_postfix_expression::rvalue(), tree_prefix_expression::rvalue(), tree_matrix::rvalue(), tree_anon_fcn_handle::rvalue(), tree_fcn_handle::rvalue(), tree_expression::rvalue(), tree_decl_elt::rvalue(), tree_constant::rvalue(), tree_colon_expression::rvalue(), tree_cell::rvalue(), tree_boolean_expression::rvalue(), tree_binary_expression::rvalue(), tree_multi_assignment::rvalue(), tree_simple_assignment::rvalue(), tree_expression::rvalue1(), tree_colon_expression::rvalue1(), tree_cell::rvalue1(), tree_simple_assignment::rvalue1(), save_mat5_binary_element(), save_three_d(), save_vars(), octave_base_value::scalar_map_value(), octave_fcn_handle::set_fcn(), set_format_style(), octave_lvalue::set_index(), set_internal_variable(), set_property_in_handle(), symbol_table::set_scope(), symbol_table::set_scope_and_context(), octave_map::setfield(), octave_class::size(), snarf_file(), octave_cell::sort(), octave_cell::sort_rows_idx(), octave_value_list::splice(), octave_base_value::squeeze(), octave_char_matrix_str::string_value(), octave_scalar_struct::subsasgn(), octave_struct::subsasgn(), octave_cell::subsasgn(), octave_base_value::subsasgn(), octave_base_sparse< T >::subsasgn(), octave_base_scalar< ST >::subsasgn(), octave_base_matrix< MT >::subsasgn(), octave_base_diag< DMT, MT >::subsasgn(), octave_class::subsasgn_common(), octave_user_function::subsref(), octave_user_script::subsref(), octave_range::subsref(), octave_perm_matrix::subsref(), octave_mex_function::subsref(), octave_fcn_handle::subsref(), octave_cell::subsref(), octave_builtin::subsref(), octave_base_value::subsref(), octave_base_sparse< T >::subsref(), octave_base_scalar< ST >::subsref(), octave_base_matrix< MT >::subsref(), octave_base_diag< DMT, MT >::subsref(), try_cellfun_internal_ops(), octave_value::unary_op_to_assign_op(), tree_parameter_list::validate(), validate_property_name(), tree_evaluator::visit_complex_for_command(), tree_evaluator::visit_simple_for_command(), tree_evaluator::visit_statement_list(), tree_evaluator::visit_switch_command(), xpow(), mex::~mex(), and octave_oncleanup::~octave_oncleanup().
static void error_1 | ( | std::ostream & | os, | |
const char * | name, | |||
const char * | id, | |||
const char * | fmt, | |||
va_list | args, | |||
bool | with_cfn = false | |||
) | [static] |
Definition at line 275 of file error.cc.
References panic(), strsave(), and verror().
Referenced by defun_usage_message_1(), error_2(), rethrow_error(), vparse_error(), and vparse_error_with_id().
static void error_2 | ( | const char * | id, | |
const char * | fmt, | |||
va_list | args, | |||
bool | with_cfn = false | |||
) | [static] |
Definition at line 454 of file error.cc.
References octave_call_stack::caller_user_code(), do_keyboard(), error_1(), forced_interactive, interactive, pr_where(), and unwind_protect::protect_var().
Referenced by verror(), verror_with_cfn(), verror_with_id(), verror_with_id_cfn(), and warning_1().
void error_with_cfn | ( | const char * | fmt, | |
... | ||||
) |
Definition at line 498 of file error.cc.
References verror_with_cfn().
Referenced by octave_value::int_vector_value(), octave_value::octave_idx_type_vector_value(), and wants_local_change().
Definition at line 528 of file error.cc.
References verror_with_id_cfn().
octave_value_list Fsprintf | ( | const octave_value_list & | , | |
int | ||||
) |
Referenced by handle_message().
static std::string handle_message | ( | error_fun | f, | |
const char * | id, | |||
const char * | msg, | |||
const octave_value_list & | args | |||
) | [static] |
Definition at line 766 of file error.cc.
References f, Fsprintf(), octave_value::is_defined(), octave_value::is_empty(), octave_value::is_string(), octave_value_list::length(), octave_value::string_value(), and strsave().
Referenced by DEFUN().
void initialize_default_warning_state | ( | void | ) |
Definition at line 1460 of file error.cc.
References disable_warning(), initialize_warning_options(), and set_warning_state().
Referenced by octave_main().
static octave_map initialize_last_error_stack | ( | void | ) | [static] |
Definition at line 143 of file error.cc.
References octave_call_stack::empty_backtrace().
static void initialize_warning_options | ( | const std::string & | state | ) | [static] |
Definition at line 132 of file error.cc.
References octave_scalar_map::setfield().
Referenced by DEFUN(), and initialize_default_warning_state().
void interpreter_try | ( | unwind_protect & | frame | ) |
Definition at line 1851 of file error.cc.
References unwind_protect::protect_var().
Referenced by octave_fcn_binder::maybe_binder(), and safe_symbol_lookup().
std::string last_error_id | ( | void | ) |
Definition at line 1833 of file error.cc.
References Vlast_error_id.
Referenced by get_output_list().
std::string last_error_message | ( | void | ) |
Definition at line 1827 of file error.cc.
References Vlast_error_message.
Referenced by get_output_list().
std::string last_warning_id | ( | void | ) |
Definition at line 1845 of file error.cc.
References Vlast_warning_id.
std::string last_warning_message | ( | void | ) |
Definition at line 1839 of file error.cc.
References Vlast_warning_message.
Definition at line 322 of file error.cc.
References vmessage().
Referenced by dump_octave_core(), and octave_yes_or_no().
Definition at line 338 of file error.cc.
References vmessage_with_id().
void panic | ( | const char * | fmt, | |
... | ||||
) |
Definition at line 735 of file error.cc.
References verror().
Referenced by symbol_table::alias_built_in_function(), error_1(), and pr_where_2().
void parse_error | ( | const char * | fmt, | |
... | ||||
) |
Definition at line 702 of file error.cc.
References vparse_error().
Definition at line 717 of file error.cc.
References vparse_error_with_id().
static void pr_where | ( | const char * | who | ) | [static] |
Definition at line 423 of file error.cc.
References octave_call_stack::backtrace(), octave_base_value::columns(), octave_map::contents(), octave_value::int_value(), octave_function::name(), names(), octave_map::numel(), pr_where_1(), and octave_value::string_value().
Referenced by error_2(), and warning_1().
static void pr_where_1 | ( | const char * | fmt, | |
... | ||||
) | [static] |
Definition at line 414 of file error.cc.
References pr_where_2().
Referenced by DEFUN(), and pr_where().
static void pr_where_2 | ( | const char * | fmt, | |
va_list | args | |||
) | [static] |
void reset_error_handler | ( | void | ) |
Definition at line 123 of file error.cc.
Referenced by do_octave_atexit(), get_debug_input(), and main_loop().
octave_value_list set_warning_state | ( | const octave_value_list & | args | ) |
octave_value_list set_warning_state | ( | const std::string & | id, | |
const std::string & | state | |||
) |
Definition at line 1437 of file error.cc.
Referenced by disable_warning(), and initialize_default_warning_state().
void usage | ( | const char * | fmt, | |
... | ||||
) |
Definition at line 360 of file error.cc.
References vusage().
Referenced by DEFUN_DLD(), mk_tmp_hist_file(), and octave_main().
Definition at line 347 of file error.cc.
References verror().
Referenced by vusage(), and vusage_with_id().
void verror | ( | const char * | fmt, | |
va_list | args | |||
) |
static void verror | ( | bool | save_last_error, | |
std::ostream & | os, | |||
const char * | name, | |||
const char * | id, | |||
const char * | fmt, | |||
va_list | args, | |||
bool | with_cfn = false | |||
) | [static] |
Definition at line 190 of file error.cc.
References octave_call_stack::backtrace(), octave_call_stack::caller_user_code(), octave_call_stack::current(), flush_octave_stdout(), initialize_last_error_stack(), octave_function::name(), octave_diary, octave_vformat(), Vlast_error_id, and Vlast_error_message.
Referenced by error(), error_1(), liboctave_fatal(), liboctave_fatal_with_id(), liboctave_warning(), liboctave_warning_with_id(), panic(), pr_where_2(), usage_1(), vmessage(), and vmessage_with_id().
void verror_with_cfn | ( | const char * | fmt, | |
va_list | args | |||
) |
Definition at line 492 of file error.cc.
References error_2().
Referenced by error_with_cfn(), and lo_error_handler().
Definition at line 507 of file error.cc.
References error_2().
Referenced by error_with_id(), and mexErrMsgIdAndTxt().
Definition at line 522 of file error.cc.
References error_2().
Referenced by error_with_id_cfn(), and lo_error_with_id_handler().
void vparse_error | ( | const char * | fmt, | |
va_list | args | |||
) |
void vusage | ( | const char * | fmt, | |
va_list | args | |||
) |
static void vwarning | ( | const char * | name, | |
const char * | id, | |||
const char * | fmt, | |||
va_list | args | |||
) | [static] |
Definition at line 151 of file error.cc.
References flush_octave_stdout(), octave_diary, octave_vformat(), Vlast_warning_id, and Vlast_warning_message.
Referenced by warning(), and warning_1().
void vwarning | ( | const char * | fmt, | |
va_list | args | |||
) |
Definition at line 666 of file error.cc.
References warning_1().
Definition at line 681 of file error.cc.
References warning_1().
Referenced by mexWarnMsgIdAndTxt(), and warning_with_id().
void warning | ( | const char * | fmt, | |
... | ||||
) |
Definition at line 672 of file error.cc.
References vwarning().
Referenced by octave_scalar::convert_to_str_internal(), octave_sparse_matrix::convert_to_str_internal(), octave_matrix::convert_to_str_internal(), octave_float_matrix::convert_to_str_internal(), octave_float_scalar::convert_to_str_internal(), octave_base_int_scalar< T >::convert_to_str_internal(), octave_base_int_matrix< T >::convert_to_str_internal(), daspk_user_function(), daspk_user_jacobian(), dasrt_user_cf(), dasrt_user_f(), dasrt_user_j(), dassl_user_function(), dassl_user_jacobian(), DEFUN(), DEFUN_DLD(), DEFUNX(), load_path::do_add(), do_load(), do_minmax_body(), octave_value_typeinfo::do_register_assign_op(), octave_value_typeinfo::do_register_assignany_op(), octave_value_typeinfo::do_register_binary_class_op(), octave_value_typeinfo::do_register_binary_op(), octave_value_typeinfo::do_register_cat_op(), octave_value_typeinfo::do_register_non_const_unary_op(), octave_value_typeinfo::do_register_pref_assign_conv(), octave_value_typeinfo::do_register_type_conv_op(), octave_value_typeinfo::do_register_unary_class_op(), octave_value_typeinfo::do_register_unary_op(), octave_value_typeinfo::do_register_widening_op(), load_path::do_remove(), do_save(), do_string_escapes(), do_who(), dump_octave_core(), eigs_func(), extract_function(), fopen_mode_to_ios_mode(), mex::free(), mex::free_value(), get_fcn_files(), load_path::dir_info::get_file_list(), get_input_from_file(), mex::global_mark(), mex::global_unmark(), gripe_dim_too_large(), gripe_empty_arg(), gripe_invalid_value_specified(), gripe_wrong_type_arg(), display_info::init(), load_path::dir_info::initialize(), initialize_error_handlers(), octave_class::load_ascii(), octave_class::load_binary(), lsode_user_function(), lsode_user_jacobian(), mex::mark(), mex::mark_foreign(), maybe_initialize_magick(), maybe_warn_exclusive(), mexWarnMsgTxt(), octave_oncleanup::octave_oncleanup(), parse_save_options(), quad_float_user_function(), quad_user_function(), raw_mode(), read_mat5_binary_element(), read_mat5_binary_file_header(), octave_class::reconstruct_exemplar(), octave_sparse_matrix::save_binary(), octave_matrix::save_binary(), octave_diag_matrix::save_binary(), octave_sparse_complex_matrix::save_binary(), octave_complex_matrix::save_binary(), octave_complex_diag_matrix::save_binary(), save_mat_ascii_data(), save_three_d(), save_vars(), set_internal_variable(), solve_singularity_warning(), mex::unmark(), mex::unmark_foreign(), load_path::dir_info::update(), warn_save_load(), write_mat5_array(), xpow(), and octave_oncleanup::~octave_oncleanup().
Definition at line 630 of file error.cc.
References symbol_table::at_top_level(), octave_call_stack::caller_user_code(), do_keyboard(), error_2(), forced_interactive, interactive, pr_where(), unwind_protect::protect_var(), vwarning(), and warning_enabled().
Referenced by vwarning(), and vwarning_with_id().
int warning_enabled | ( | const std::string & | id | ) |
Definition at line 559 of file error.cc.
References check_state(), octave_map::contents(), octave_map::numel(), state, octave_base_value::string_value(), and octave_value::string_value().
Referenced by warning_1().
Definition at line 687 of file error.cc.
References vwarning_with_id().
Referenced by load_path::add_to_fcn_map(), check_dimensions(), clear(), DEFUN(), DEFUN_DLD(), load_path::do_add(), do_clear_function(), do_stream_open(), find_file_to_load(), gripe_divide_by_zero(), gripe_implicit_conversion(), gripe_logical_conversion(), gripe_warn_complex_cmp(), octave_range::index_vector(), initialize_error_handlers(), tree_parameter_list::initialize_undefined_elements(), tree_binary_expression::mark_braindead_shortcircuit(), maybe_warn_former_built_in_variable(), maybe_warn_string_concat(), solve_singularity_warning(), sqrtm_utri_inplace(), and validate_property_name().
Definition at line 114 of file error.cc.
Referenced by DEFUN_DLD(), get_output_list(), maybe_missing_function_hook(), and tree_evaluator::visit_try_catch_command().
bool discard_error_messages = false |
Definition at line 117 of file error.cc.
Referenced by DEFUN(), generate_struct_completions(), and looks_like_struct().
bool discard_warning_messages = false |
Definition at line 120 of file error.cc.
Referenced by generate_struct_completions().
int error_state = 0 |
Definition at line 100 of file error.cc.
Referenced by octave_class::all_strings(), octave_cell::all_strings(), octave_base_value::all_strings(), octave_value::assign(), octave_base_sparse< T >::assign(), octave_base_matrix< MT >::assign(), Octave_map::assign(), octave_map::assign(), call_mex(), octave_base_value::char_matrix_value(), check_limit_vals(), compare_property_values(), octave_value::complex_vector_value(), convert_cdata(), tree_argument_list::convert_to_const_vector(), convert_to_valid_int(), daspk_user_function(), daspk_user_jacobian(), dasrt_user_cf(), dasrt_user_f(), dasrt_user_j(), dassl_user_function(), dassl_user_jacobian(), decode_subscripts(), DEFASSIGNOP(), default_numeric_conversion_function(), DEFUN(), DEFUN_DLD(), DEFUNX(), octave_base_sparse< T >::delete_elements(), octave_map::delete_elements(), dims_to_numel(), do_accumarray_minmax_fun(), load_path::do_add(), octave_call_stack::do_backtrace_error_message(), do_bessel(), do_cellslices_nda(), do_class_concat(), do_cleanup_waitfor_listener(), do_cumminmax_body(), do_cumminmax_red_op(), do_dbstack(), do_dbupdown(), tree_evaluator::do_decl_init_list(), do_extended_gcd(), do_fft(), do_fft2(), do_fftn(), do_fread(), do_fwrite(), do_global_init(), octave_diag_matrix::do_index_op(), octave_range::do_index_op(), octave_perm_matrix::do_index_op(), octave_base_sparse< T >::do_index_op(), octave_base_matrix< MT >::do_index_op(), octave_char_matrix_str::do_index_op_internal(), do_isglobal(), do_keyboard(), do_load(), octave_dynamic_loader::do_load_mex(), octave_dynamic_loader::do_load_oct(), octave_stream_list::do_lookup(), do_mat2cell(), do_minmax_bin_op(), do_minmax_body(), do_minmax_red_op(), octave_user_function::do_multi_index_op(), octave_user_script::do_multi_index_op(), octave_mex_function::do_multi_index_op(), octave_builtin::do_multi_index_op(), do_num2cell(), do_object2cell(), do_permute(), octave_base_stream::do_printf(), do_rand(), octave_stream_list::do_remove(), do_simple_cellfun(), do_stream_open(), do_trilu(), tree_evaluator::do_unwind_protect_cleanup_code(), do_who(), octave_class::dotref(), printf_value_cache::double_value(), dump_octave_core(), eigs_complex_func(), eigs_func(), tree_decl_elt::eval(), tree_identifier::eval_undefined_error(), extract_function(), fill_matrix(), symbol_table::fcn_info::fcn_info_rep::find(), symbol_table::fcn_info::fcn_info_rep::find_user_function(), octave_value::float_complex_vector_value(), octave_value::float_vector_value(), fopen_mode_to_ios_mode(), generate_struct_completions(), get_dimensions(), get_lines_and_columns(), get_output_list(), get_size(), get_sort_mode_option(), tree_index_expression::get_struct_index(), get_user_input(), octave_stream::getl(), octave_stream::gets(), gripe_library_execution_error(), identity_matrix(), Octave_map::index(), octave_map::index(), Cell::index(), octave_class::index_vector(), tm_const::init(), tm_row_const::tm_row_const_rep::init(), printf_value_cache::int_value(), octave_value::int_vector_value(), interactive_input(), octave_value::is_equal(), is_handle(), is_handle_visible(), tree_expression::is_logically_true(), is_valid_function(), tree_switch_case::label_matches(), octave_scalar_struct::load_ascii(), octave_struct::load_ascii(), octave_char_matrix_str::load_ascii(), octave_lazy_index::load_ascii(), octave_class::load_ascii(), octave_scalar_struct::load_binary(), octave_struct::load_binary(), octave_char_matrix_str::load_binary(), octave_scalar::load_binary(), octave_sparse_matrix::load_binary(), octave_matrix::load_binary(), octave_diag_matrix::load_binary(), octave_lazy_index::load_binary(), octave_float_matrix::load_binary(), octave_float_diag_matrix::load_binary(), octave_float_complex_matrix::load_binary(), octave_float_complex_diag_matrix::load_binary(), octave_float_complex::load_binary(), octave_float_scalar::load_binary(), octave_sparse_complex_matrix::load_binary(), octave_complex_matrix::load_binary(), octave_complex_diag_matrix::load_binary(), octave_complex::load_binary(), octave_class::load_binary(), octave_sparse_bool_matrix::load_binary(), looks_like_struct(), lsode_user_function(), lsode_user_jacobian(), tree_index_expression::lvalue(), main_loop(), tree_index_expression::make_arg_struct(), make_graphics_object(), tree_colon_expression::make_range(), make_subs_cell(), make_value_list(), octave_scalar::map(), octave_matrix::map(), octave_fcn_binder::maybe_binder(), Octave_map::maybe_delete_elements(), mexCallMATLAB(), mexEvalString(), mexGet(), mexGetVariable(), mexPutVariable(), octave_value::next_subsref(), octave_base_value::nint_value(), octave_base_value::numeric_assign(), oct_assignop_conv_and_assign(), octave_class::octave_class(), octave_value::octave_idx_type_vector_value(), octave_main(), octcellregexp(), octregexp(), octregexprep(), parse_dbfunction_params(), parse_options(), Octave_map::permute(), permute_to_correct_order(), qp(), quad_float_user_function(), quad_user_function(), quit_loop_now(), octave_stream::read(), read_ascii_data(), read_mat5_binary_element(), read_mat5_binary_file_header(), read_mat_ascii_data(), read_mat_binary_data(), reparent(), tree_index_expression::rvalue(), tree_identifier::rvalue(), tree_multi_assignment::rvalue(), tree_postfix_expression::rvalue1(), tree_prefix_expression::rvalue1(), tree_matrix::rvalue1(), tree_colon_expression::rvalue1(), tree_compound_binary_expression::rvalue1(), tree_boolean_expression::rvalue1(), tree_binary_expression::rvalue1(), tree_simple_assignment::rvalue1(), safe_symbol_lookup(), octave_class::save_ascii(), octave_class::save_binary(), save_mat5_binary_element(), save_mat_ascii_data(), save_vars(), octave_base_value::scalar_map_value(), octave_base_stream::scanf(), octave_stream::seek(), gnuplot_graphics_toolkit::send_quit(), set_internal_variable(), set_property_in_handle(), single_type_concat(), octave_stream::skipl(), Octave_map::squeeze(), octave_base_value::string_value(), printf_value_cache::string_value(), octave_scalar_struct::subsasgn(), octave_struct::subsasgn(), octave_cell::subsasgn(), octave_base_diag< DMT, MT >::subsasgn(), octave_class::subsasgn_common(), octave_struct::subsref(), octave_class::subsref(), octave_cell::subsref(), try_cellfun_internal_ops(), load_path::dir_info::update(), tree_parameter_list::validate(), octave_value::vector_value(), tree_evaluator::visit_break_command(), tree_evaluator::visit_complex_for_command(), tree_evaluator::visit_continue_command(), tree_evaluator::visit_do_until_command(), tree_evaluator::visit_if_command_list(), tree_evaluator::visit_return_command(), tree_evaluator::visit_simple_for_command(), tree_evaluator::visit_statement(), tree_evaluator::visit_statement_list(), tree_evaluator::visit_switch_command(), tree_evaluator::visit_try_catch_command(), tree_evaluator::visit_while_command(), waitfor_del_listener(), waitfor_listener(), octave_stream::write(), xpow(), and octave_oncleanup::~octave_oncleanup().
bool Vbacktrace_on_warning = false [static] |
bool Vbeep_on_error = false [static] |
bool Vdebug_on_error = false |
Definition at line 56 of file error.cc.
Referenced by tree_evaluator::visit_try_catch_command().
bool Vdebug_on_warning = false |
Definition at line 60 of file error.cc.
Referenced by tree_evaluator::visit_try_catch_command().
std::string Vlast_error_id [static] |
Definition at line 86 of file error.cc.
Referenced by DEFUN(), last_error_id(), and verror().
std::string Vlast_error_message [static] |
Definition at line 77 of file error.cc.
Referenced by DEFUN(), last_error_message(), and verror().
octave_map Vlast_error_stack [static] |
std::string Vlast_warning_id [static] |
Definition at line 83 of file error.cc.
Referenced by DEFUN(), last_warning_id(), and vwarning().
std::string Vlast_warning_message [static] |
Definition at line 80 of file error.cc.
Referenced by DEFUN(), last_warning_message(), and vwarning().
bool Vquiet_warning = false [static] |
bool Vverbose_warning [static] |
octave_map warning_options [static] |
int warning_state = 0 |
Definition at line 109 of file error.cc.
Referenced by generate_struct_completions().