Debugger fixed about command interruption by another one
[scilab.git] / scilab / modules / ast / src / cpp / ast / debuggervisitor.cpp
index 3a87874..d531309 100644 (file)
@@ -21,6 +21,7 @@
 #include "macrofile.hxx"
 #include "commentexp.hxx"
 #include "UTF8.hxx"
+#include "runner.hxx"
 
 extern "C"
 {
@@ -222,6 +223,17 @@ void DebuggerVisitor::visit(const SeqExp  &e)
             }
         }
 
+        // interrupt me to execute a prioritary command
+        while (StaticRunner_isInterruptibleCommand() == 1 && StaticRunner_isRunnerAvailable() == 1)
+        {
+            // save the origin of the actual running command
+            command_origin_t origin = StaticRunner_getCurrentCommandOrigin();
+            StaticRunner_launch();
+            StaticRunner_setInterruptibleCommand(1);
+            // restore the origin of the actual running command
+            StaticRunner_setCurrentCommandOrigin(origin);
+        }
+
         //copy from runvisitor::seqexp
         try
         {