Mercurial > hg > octave-jordi
changeset 8013:b3e667f1ab4c
call backtrace_error_message in eval functions, not when popping stack
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 06 Aug 2008 14:40:16 -0400 |
parents | 63dbb85452cc |
children | 44d206ae68c9 |
files | src/ChangeLog src/ov-usr-fcn.cc src/toplev.cc src/toplev.h |
diffstat | 4 files changed, 27 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,15 @@ +2008-08-06 John W. Eaton <jwe@octave.org> + + * ov-usr-fcn.cc (octave_user_function::do_multi_index_op, + octave_user_script::do_multi_index_op): + Call octave_call_stack::backtrace_error_message. + * toplev.h (octave_call_stack::do_pop): Don't call + backtrace_error_message here. + * toplev.cc, toplev.h (octave_call_stack::do_backtrace_error_message): + Rename from octave_call_stack::backtrace_error_message. + * toplev.h (octave_call_stack::backtrace_error_message): + New public static function. + 2008-08-05 John W. Eaton <jwe@octave.org> * gripes.cc (gripe_truncated_conversion,
--- a/src/ov-usr-fcn.cc +++ b/src/ov-usr-fcn.cc @@ -134,6 +134,9 @@ if (tree_break_command::breaking) tree_break_command::breaking--; + + if (error_state) + octave_call_stack::backtrace_error_message (); } else ::error ("max_recursion_limit exceeded"); @@ -444,7 +447,10 @@ tree_break_command::breaking--; if (error_state) - goto abort; + { + octave_call_stack::backtrace_error_message (); + goto abort; + } // Copy return values out.
--- a/src/toplev.cc +++ b/src/toplev.cc @@ -473,7 +473,7 @@ } void -octave_call_stack::backtrace_error_message (void) const +octave_call_stack::do_backtrace_error_message (void) const { if (error_state > 0) {
--- a/src/toplev.h +++ b/src/toplev.h @@ -266,6 +266,12 @@ instance->do_clear (); } + static void backtrace_error_message (void) + { + if (instance_ok ()) + instance->do_backtrace_error_message (); + } + private: // The current call stack. @@ -380,9 +386,6 @@ { if (cs.size () > 1) { - if (error_state) - backtrace_error_message (); - const call_stack_elt& elt = cs.back (); curr_frame = elt.prev; cs.pop_back (); @@ -393,7 +396,7 @@ void do_clear (void) { cs.clear (); } - void backtrace_error_message (void) const; + void do_backtrace_error_message (void) const; }; #endif