# HG changeset patch # User John W. Eaton # Date 1603380026 14400 # Node ID d632d99d5c2e9772dc1a93e5b8dea4f36b3f923c # Parent c6f81afdcd2895022ec481ff66b28fbe069a8a1c# Parent a745a046b70597c698ded18f859a9ac56d0fed2b maint: merge stable to default. diff -r c6f81afdcd28 -r d632d99d5c2e libinterp/corefcn/error.cc --- a/libinterp/corefcn/error.cc Thu Oct 22 14:07:35 2020 +0200 +++ b/libinterp/corefcn/error.cc Thu Oct 22 11:20:26 2020 -0400 @@ -894,25 +894,6 @@ void error_system::throw_error (execution_exception& ex) { - tree_evaluator& tw = m_interpreter.get_evaluator (); - - bp_table& bptab = tw.get_bp_table (); - - if ((m_interpreter.interactive () || application::forced_interactive ()) - && ((debug_on_error () - && bptab.debug_on_err (last_error_id ())) - || (debug_on_caught () - && bptab.debug_on_caught (last_error_id ()))) - && tw.in_user_code ()) - { - save_exception (ex); - display_exception (ex, std::cerr); - - tw.enter_debugger (); - } - - // Throw the exception even if we entered the debugger. - throw ex; } diff -r c6f81afdcd28 -r d632d99d5c2e libinterp/parse-tree/pt-eval.cc --- a/libinterp/parse-tree/pt-eval.cc Thu Oct 22 14:07:35 2020 +0200 +++ b/libinterp/parse-tree/pt-eval.cc Thu Oct 22 11:20:26 2020 -0400 @@ -3193,6 +3193,32 @@ else throw; } + catch (const execution_exception& ee) + { + error_system& es = m_interpreter.get_error_system (); + + if ((m_interpreter.interactive () + || application::forced_interactive ()) + && ((es.debug_on_error () + && m_bp_table.debug_on_err (es.last_error_id ())) + || (es.debug_on_caught () + && m_bp_table.debug_on_caught (es.last_error_id ()))) + && in_user_code ()) + { + es.save_exception (ee); + es.display_exception (ee, std::cerr); + + enter_debugger (); + + // It doesn't make sense to continue execution after an + // error occurs so force the debugger to quit all debug + // levels and return the the top prompt. + + throw quit_debug_exception (true); + } + else + throw; + } } }