# HG changeset patch # User jwe # Date 1199734360 0 # Node ID 516ddd88e45af4d1ed06f863bd00e72667d876aa # Parent fab9bc33b9495aeeb4873ea7f360952b546f75a9 [project @ 2008-01-07 19:32:40 by jwe] diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,12 @@ 2008-01-07 John W. Eaton + * src/pt-except.cc (tree_try_catch_command::eval): + Set Vdebug_on_error and Vdebug_on_warning to false while executing + try block. + + * error.cc (Vdebug_on_error, Vdebug_on_warning): No longer static. + * error.h: Provide decls. + * gripes.cc (gripe_wrong_type_arg (const std::string&, const octave_value&, bool)): New function. * gripes.h: Provide decl. diff --git a/src/error.cc b/src/error.cc --- a/src/error.cc +++ b/src/error.cc @@ -1,7 +1,7 @@ /* Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006, 2007 John W. Eaton + 2002, 2003, 2004, 2005, 2006, 2007, 2008 John W. Eaton This file is part of Octave. @@ -53,11 +53,11 @@ // TRUE means that Octave will try to enter the debugger when an error // is encountered. This will also inhibit printing of the normal // traceback message (you will only see the top-level error message). -static bool Vdebug_on_error = false; +bool Vdebug_on_error = false; // TRUE means that Octave will try to enter the debugger when a warning // is encountered. -static bool Vdebug_on_warning = false; +bool Vdebug_on_warning = false; // TRUE means that Octave will try to display a stack trace when a // warning is encountered. diff --git a/src/error.h b/src/error.h --- a/src/error.h +++ b/src/error.h @@ -1,7 +1,7 @@ /* Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003, - 2004, 2005, 2006, 2007 John W. Eaton + 2004, 2005, 2006, 2007, 2008 John W. Eaton This file is part of Octave. @@ -88,6 +88,15 @@ extern OCTINTERP_API void disable_warning (const std::string& id); extern OCTINTERP_API void initialize_default_warning_state (void); +// TRUE means that Octave will try to enter the debugger when an error +// is encountered. This will also inhibit printing of the normal +// traceback message (you will only see the top-level error message). +extern OCTINTERP_API bool Vdebug_on_error; + +// TRUE means that Octave will try to enter the debugger when a warning +// is encountered. +extern OCTINTERP_API bool Vdebug_on_warning; + // Current error state. extern OCTINTERP_API int error_state; diff --git a/src/pt-except.cc b/src/pt-except.cc --- a/src/pt-except.cc +++ b/src/pt-except.cc @@ -1,7 +1,7 @@ /* Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, - 2006, 2007 John W. Eaton + 2006, 2007, 2008 John W. Eaton This file is part of Octave. @@ -96,7 +96,12 @@ MAYBE_DO_BREAKPOINT; unwind_protect_int (buffer_error_messages); + unwind_protect_bool (Vdebug_on_error); + unwind_protect_bool (Vdebug_on_warning); + buffer_error_messages++; + Vdebug_on_error = false; + Vdebug_on_warning = false; unwind_protect::add (do_catch_code, catch_code); @@ -118,7 +123,10 @@ // For clearing the do_catch_code cleanup function. unwind_protect::discard (); - // For restoring buffer_error_messages. + // For restoring Vdebug_on_warning, Vdebug_on_error, and + // buffer_error_messages. + unwind_protect::run (); + unwind_protect::run (); unwind_protect::run (); // Also clear the frame marker.