# HG changeset patch # User jwe # Date 1199734311 0 # Node ID 5426a55a0cac17d4a4721210b581f1187f9a5c1d # Parent a16658ac8eb99eee2f304afeaf4ae01d356c6cbb [3-0-0-branch @ 2008-01-07 19:31:51 by jwe] diff -r a16658ac8eb9 -r 5426a55a0cac src/ChangeLog --- a/src/ChangeLog Mon Jan 07 18:54:22 2008 +0000 +++ b/src/ChangeLog Mon Jan 07 19:31:51 2008 +0000 @@ -1,3 +1,13 @@ +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. + + 2008-01-04 John Swensen * debug.cc (bp_table::do_remove_all_breakpoints_in_file): diff -r a16658ac8eb9 -r 5426a55a0cac src/error.cc --- a/src/error.cc Mon Jan 07 18:54:22 2008 +0000 +++ b/src/error.cc Mon Jan 07 19:31:51 2008 +0000 @@ -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 -r a16658ac8eb9 -r 5426a55a0cac src/error.h --- a/src/error.h Mon Jan 07 18:54:22 2008 +0000 +++ b/src/error.h Mon Jan 07 19:31:51 2008 +0000 @@ -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 -r a16658ac8eb9 -r 5426a55a0cac src/pt-except.cc --- a/src/pt-except.cc Mon Jan 07 18:54:22 2008 +0000 +++ b/src/pt-except.cc Mon Jan 07 19:31:51 2008 +0000 @@ -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.