[debugger] use an InternalType as watch value instead of string 59/21059/2
Cedric Delamarre [Tue, 30 Jul 2019 10:11:57 +0000 (12:11 +0200)]
Change-Id: Id7432387a6c68a0c72fa0e536cb457097866bc84

scilab/modules/ast/includes/ast/abstractdebugger.hxx
scilab/modules/ast/src/cpp/ast/debugmanager.cpp

index 75a0af2..ec05aaf 100644 (file)
@@ -19,6 +19,8 @@
 #include <string>
 #include <map>
 
+#include <types.hxx>
+
 extern "C"
 {
 #include "dynlib_ast.h"
@@ -50,7 +52,7 @@ public:
 };
 
 typedef std::map<std::string, AbstractDebugger*> Debuggers;
-typedef std::map<std::string, std::string> Watches;
+typedef std::map<std::string, types::InternalType*> Watches;
 
 }
 #endif /* !__ABSTRACT_DEBUGGER_HXX__ */
index 83da5c3..65ad7ab 100644 (file)
@@ -312,7 +312,6 @@ void DebuggerManager::removeWatches()
 void DebuggerManager::updateWatches(int _iScopeLvl)
 {
     symbol::Context* pCtx = symbol::Context::getInstance();
-
     if(_iScopeLvl < 0)
     {
         // get current scope lvl
@@ -321,17 +320,7 @@ void DebuggerManager::updateWatches(int _iScopeLvl)
 
     for(auto& w : watches)
     {
-        types::InternalType* pIT = pCtx->getAtLevel(symbol::Symbol(scilab::UTF8::toWide(w.first)), _iScopeLvl);
-        if(pIT)
-        {
-            std::wostringstream os;
-            pIT->toString(os);
-            w.second = scilab::UTF8::toUTF8(os.str());
-        }
-        else
-        {
-            w.second.clear();
-        }
+        w.second = pCtx->getAtLevel(symbol::Symbol(scilab::UTF8::toWide(w.first)), _iScopeLvl);
     }
 }