diff libinterp/parse-tree/pt.cc @ 27160:6b0c61a5a0f0

move global error configuration and status variables inside a class * error.h, error.cc (error_system): New class. (Vbacktrace_on_warning, Vbeep_on_error, Vdebug_on_caught, Vdebug_on_error, Vdebug_on_warning, Vlast_error_id, Vlast_error_message, Vlast_error_stack, Vlast_warning_id, Vlast_warning_message, Vquiet_warning, Vverbose_warning, buffer_error_messages, discard_error_messages, discard_warning_messages, in_try_catch, warning_options): Move global and file-scope static variables inside error_system class. Change all uses. * interpreter.h, interpreter.cc (m_error_system): New member variable. (get_error_system): New function. * interpreter-private.h, interpreter-private.cc (__get_error_system__): New function.
author John W. Eaton <jwe@octave.org>
date Fri, 31 May 2019 15:49:38 +0000
parents a7c570394f1d
children fd32c1a9b1bd
line wrap: on
line diff
--- a/libinterp/parse-tree/pt.cc	Fri Jun 07 13:29:41 2019 -0400
+++ b/libinterp/parse-tree/pt.cc	Fri May 31 15:49:38 2019 +0000
@@ -27,6 +27,7 @@
 #include <sstream>
 #include <string>
 
+#include "interpreter.h"
 #include "ov-fcn.h"
 #include "pt.h"
 #include "pt-eval.h"
@@ -89,8 +90,13 @@
           }
         catch (const execution_exception& e)
           {
+            interpreter& interp = tw.get_interpreter ();
+            error_system& es = interp.get_error_system ();
+
+            std::string tmp = es.last_error_message ();
+
             warning ("Error evaluating breakpoint condition:\n    %s",
-                     last_error_message ().c_str ());
+                     tmp.c_str ());
           }
       }
     return retval;