Mercurial > hg > octave-terminal
changeset 11607:5426a55a0cac release-3-0-x
[3-0-0-branch @ 2008-01-07 19:31:51 by jwe]
author | jwe |
---|---|
date | Mon, 07 Jan 2008 19:31:51 +0000 |
parents | a16658ac8eb9 |
children | e20f4ad90c7e |
files | src/ChangeLog src/error.cc src/error.h src/pt-except.cc |
diffstat | 4 files changed, 33 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2008-01-07 John W. Eaton <jwe@octave.org> + + * 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. + + 2008-01-04 John Swensen <jpswensen@comcast.net> * debug.cc (bp_table::do_remove_all_breakpoints_in_file):
--- 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.
--- 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;
--- 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.