diff libgui/src/m-editor/file-editor-tab.cc @ 23553:14723784b9f2

don't use singleton for call_stack * call-stack.h, call-stack.cc (class call_stack): Don't use singleton pattern. Store reference to parent intepreter object in call stack. * pt-eval.h, pt-eval.cc (tree_evaluator::m_call_stack): New data member. (tree_evaluator::get_call_stack): New function. * interpreter-private.h, interpreter-private.cc (__get_call_stack__): New function. * interpreter.h, interpreter.cc (interpreter::get_call_stack): New function. Change all uses of call_stack to access call_stack object from the interpreter.
author John W. Eaton <jwe@octave.org>
date Wed, 07 Jun 2017 02:13:05 -0400
parents 7463c8e91dba
children 5cb3a2bb5e1e
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc	Wed Jun 07 02:08:22 2017 -0400
+++ b/libgui/src/m-editor/file-editor-tab.cc	Wed Jun 07 02:13:05 2017 -0400
@@ -71,15 +71,16 @@
 
 #include "bp-table.h"
 #include "call-stack.h"
+#include "defaults.h"
+#include "interpreter-private.h"
+#include "interpreter.h"
+#include "oct-map.h"
 #include "octave-qt-link.h"
-#include "version.h"
-#include "utils.h"
-#include "defaults.h"
 #include "ov-usr-fcn.h"
 #include "symtab.h"
-#include "interpreter.h"
 #include "unwind-prot.h"
-#include <oct-map.h>
+#include "utils.h"
+#include "version.h"
 
 bool file_editor_tab::_cancelled = false;
 
@@ -1803,7 +1804,9 @@
   bool retval = true;
   octave_idx_type curr_frame = -1;
   size_t nskip = 0;
-  octave_map stk = octave::call_stack::backtrace (nskip, curr_frame, false);
+  octave::call_stack& cs
+    = octave::__get_call_stack__ ("file_editor_tab::exit_debug_and_clear");
+  octave_map stk = cs.backtrace (nskip, curr_frame, false);
   Cell names = stk.contents ("name");
   for (octave_idx_type i = names.numel () - 1; i >= 0; i--)
     {
@@ -1821,7 +1824,7 @@
               while (names.numel () > i)
                 {
                   octave_sleep (0.01);
-                  stk = octave::call_stack::backtrace (nskip, curr_frame, false);
+                  stk = cs.backtrace (nskip, curr_frame, false);
                   names = stk.contents ("name");
                 }
             }