Command line debugger first version 96/17196/5
Antoine ELIAS [Fri, 4 Sep 2015 07:41:18 +0000 (09:41 +0200)]
features :
  - continue
  - next
  - quit
  - abort
  - where
  - callstack
  - help
  - stepin
  - stepout
  - breakpoints (add, delete, show, enable, disable)
  - stop on errors
  - list

Change-Id: Ie683a612ec85d681239d66669fbe93ec2f5e9ea4

154 files changed:
scilab/modules/api_scilab/src/cpp/api_common.cpp
scilab/modules/ast/Makefile.am
scilab/modules/ast/Makefile.in
scilab/modules/ast/ast.vcxproj
scilab/modules/ast/ast.vcxproj.filters
scilab/modules/ast/core_Import.def
scilab/modules/ast/includes/analysis/AnalysisVisitor.hxx
scilab/modules/ast/includes/analysis/ConstantVisitor.hxx
scilab/modules/ast/includes/analysis/data/GlobalsCollector.hxx
scilab/modules/ast/includes/analysis/data/LoopAnalyzer.hxx
scilab/modules/ast/includes/analysis/gvn/TestGVNVisitor.hxx
scilab/modules/ast/includes/analysis/tools.hxx
scilab/modules/ast/includes/ast/abstractdebugger.hxx [new file with mode: 0644]
scilab/modules/ast/includes/ast/breakpoint.hxx [new file with mode: 0644]
scilab/modules/ast/includes/ast/consoledebugger.hxx [new file with mode: 0644]
scilab/modules/ast/includes/ast/debuggervisitor.hxx [new file with mode: 0644]
scilab/modules/ast/includes/ast/debugmanager.hxx [new file with mode: 0644]
scilab/modules/ast/includes/ast/dummyvisitor.hxx
scilab/modules/ast/includes/ast/execvisitor.hxx
scilab/modules/ast/includes/ast/macrovarvisitor.hxx
scilab/modules/ast/includes/ast/mutevisitor.hxx [deleted file]
scilab/modules/ast/includes/ast/prettyprintvisitor.hxx [moved from scilab/modules/ast/includes/ast/debugvisitor.hxx with 94% similarity]
scilab/modules/ast/includes/ast/printvisitor.hxx
scilab/modules/ast/includes/ast/serializervisitor.hxx
scilab/modules/ast/includes/ast/stepvisitor.hxx
scilab/modules/ast/includes/ast/timedvisitor.hxx
scilab/modules/ast/includes/ast/visitor.hxx
scilab/modules/ast/includes/exps/controlexp.hxx
scilab/modules/ast/includes/exps/exp.hxx
scilab/modules/ast/includes/exps/tableintselectexp.hxx
scilab/modules/ast/includes/parse/parser.hxx
scilab/modules/ast/includes/parse/parser_private.hxx
scilab/modules/ast/includes/system_env/configvariable.hxx
scilab/modules/ast/includes/system_env/configvariable_interface.h
scilab/modules/ast/includes/types/arrayof.hxx
scilab/modules/ast/includes/types/callable.hxx
scilab/modules/ast/includes/types/function.hxx
scilab/modules/ast/includes/types/gatewaystruct.hxx
scilab/modules/ast/includes/types/graphichandle.hxx
scilab/modules/ast/includes/types/implicitlist.hxx
scilab/modules/ast/includes/types/internal.hxx
scilab/modules/ast/includes/types/list.hxx
scilab/modules/ast/includes/types/macro.hxx
scilab/modules/ast/includes/types/macrofile.hxx
scilab/modules/ast/includes/types/mlist.hxx
scilab/modules/ast/includes/types/overload.hxx
scilab/modules/ast/includes/types/sparse.hxx
scilab/modules/ast/includes/types/struct.hxx
scilab/modules/ast/includes/types/tlist.hxx
scilab/modules/ast/includes/types/user.hxx
scilab/modules/ast/src/cpp/analysis/FunctionBlock.cpp
scilab/modules/ast/src/cpp/ast/consoledebugger.cpp [new file with mode: 0644]
scilab/modules/ast/src/cpp/ast/debuggervisitor.cpp [new file with mode: 0644]
scilab/modules/ast/src/cpp/ast/debugmanager.cpp [new file with mode: 0644]
scilab/modules/ast/src/cpp/ast/mutevisitor.cpp [deleted file]
scilab/modules/ast/src/cpp/ast/prettyprintvisitor.cpp [moved from scilab/modules/ast/src/cpp/ast/debugvisitor.cpp with 81% similarity]
scilab/modules/ast/src/cpp/ast/printvisitor.cpp
scilab/modules/ast/src/cpp/ast/run_CallExp.hpp
scilab/modules/ast/src/cpp/ast/run_MatrixExp.hpp
scilab/modules/ast/src/cpp/ast/run_OpExp.hpp
scilab/modules/ast/src/cpp/ast/runvisitor.cpp
scilab/modules/ast/src/cpp/ast/visitor_common.cpp
scilab/modules/ast/src/cpp/operations/types_addition.cpp
scilab/modules/ast/src/cpp/operations/types_subtraction.cpp
scilab/modules/ast/src/cpp/parse/parser.cpp
scilab/modules/ast/src/cpp/symbol/libraries.cpp
scilab/modules/ast/src/cpp/symbol/variables.cpp
scilab/modules/ast/src/cpp/system_env/configvariable.cpp
scilab/modules/ast/src/cpp/system_env/configvariable_interface.cpp
scilab/modules/ast/src/cpp/system_env/sci_tmpdir.cpp
scilab/modules/ast/src/cpp/types/arrayof.cpp
scilab/modules/ast/src/cpp/types/callable.cpp
scilab/modules/ast/src/cpp/types/cell.cpp
scilab/modules/ast/src/cpp/types/function.cpp
scilab/modules/ast/src/cpp/types/graphichandle.cpp
scilab/modules/ast/src/cpp/types/implicitlist.cpp
scilab/modules/ast/src/cpp/types/internal.cpp
scilab/modules/ast/src/cpp/types/macro.cpp
scilab/modules/ast/src/cpp/types/macrofile.cpp
scilab/modules/ast/src/cpp/types/mlist.cpp
scilab/modules/ast/src/cpp/types/overload.cpp
scilab/modules/ast/src/cpp/types/polynom.cpp
scilab/modules/ast/src/cpp/types/sparse.cpp
scilab/modules/ast/src/cpp/types/struct.cpp
scilab/modules/ast/src/cpp/types/tlist.cpp
scilab/modules/cacsd/sci_gateway/cpp/sci_arl2_ius.cpp
scilab/modules/cacsd/sci_gateway/cpp/sci_ppol.cpp
scilab/modules/cacsd/sci_gateway/cpp/sci_tzer.cpp
scilab/modules/console/includes/prompt.h
scilab/modules/console/src/c/prompt.c
scilab/modules/console/src/cpp/scilabRead.cpp
scilab/modules/core/Makefile.am
scilab/modules/core/Makefile.in
scilab/modules/core/help/en_US/debugging/debug.xml
scilab/modules/core/help/en_US/debugging/delbpt.xml [deleted file]
scilab/modules/core/help/en_US/debugging/dispbpt.xml [deleted file]
scilab/modules/core/help/en_US/debugging/setbpt.xml [deleted file]
scilab/modules/core/help/fr_FR/debugging/debug.xml
scilab/modules/core/help/ja_JP/debugging/delbpt.xml [deleted file]
scilab/modules/core/help/ja_JP/debugging/dispbpt.xml [deleted file]
scilab/modules/core/help/ja_JP/debugging/setbpt.xml [deleted file]
scilab/modules/core/help/pt_BR/debugging/delbpt.xml [deleted file]
scilab/modules/core/help/pt_BR/debugging/dispbpt.xml [deleted file]
scilab/modules/core/help/pt_BR/debugging/setbpt.xml [deleted file]
scilab/modules/core/help/ru_RU/debugging/delbpt.xml [deleted file]
scilab/modules/core/help/ru_RU/debugging/dispbpt.xml [deleted file]
scilab/modules/core/help/ru_RU/debugging/setbpt.xml [deleted file]
scilab/modules/core/includes/core_gw.hxx
scilab/modules/core/includes/gw_core.h
scilab/modules/core/includes/runner.hxx
scilab/modules/core/includes/tasks.hxx
scilab/modules/core/sci_gateway/cpp/core_gw.cpp
scilab/modules/core/sci_gateway/cpp/core_gw.vcxproj
scilab/modules/core/sci_gateway/cpp/core_gw.vcxproj.filters
scilab/modules/core/sci_gateway/cpp/sci_abort.cpp
scilab/modules/core/sci_gateway/cpp/sci_debug.cpp [new file with mode: 0644]
scilab/modules/core/sci_gateway/cpp/sci_pause.cpp
scilab/modules/core/sci_gateway/cpp/sci_quit.cpp
scilab/modules/core/sci_gateway/cpp/sci_where.cpp
scilab/modules/core/src/cpp/InitScilab.cpp
scilab/modules/core/src/cpp/runner.cpp
scilab/modules/core/src/cpp/setlines.cpp
scilab/modules/core/src/cpp/storeCommand.cpp
scilab/modules/core/src/cpp/tasks.cpp
scilab/modules/differential_equations/src/cpp/differentialequationfunctions.cpp
scilab/modules/elementary_functions/sci_gateway/cpp/elem_func_gw.cpp
scilab/modules/elementary_functions/sci_gateway/cpp/sci_max.cpp
scilab/modules/external_objects/src/cpp/EOType.cpp
scilab/modules/external_objects/src/cpp/EOType.hxx
scilab/modules/external_objects/src/cpp/ScilabObjects.cpp
scilab/modules/external_objects/src/cpp/deff.cpp
scilab/modules/functions/sci_gateway/cpp/sci_exec.cpp
scilab/modules/functions/sci_gateway/cpp/sci_execstr.cpp
scilab/modules/functions/sci_gateway/cpp/sci_getCurrentThreadId.cpp
scilab/modules/functions/sci_gateway/cpp/sci_getThreads.cpp
scilab/modules/functions/sci_gateway/cpp/sci_testAnalysis.cpp
scilab/modules/functions/sci_gateway/cpp/sci_testGVN.cpp
scilab/modules/functions_manager/src/cpp/funcmanager.cpp
scilab/modules/hdf5/sci_gateway/cpp/sci_hdf5_file_version.cpp
scilab/modules/linear_algebra/src/cpp/schurSelect.cpp
scilab/modules/linear_algebra/src/cpp/scischur.cpp
scilab/modules/mexlib/src/cpp/mexlib.cpp
scilab/modules/optimization/src/cpp/optimizationfunctions.cpp
scilab/modules/polynomials/sci_gateway/cpp/sci_bezout.cpp
scilab/modules/polynomials/sci_gateway/cpp/sci_poly.cpp
scilab/modules/polynomials/sci_gateway/cpp/sci_roots.cpp
scilab/modules/scicos/sci_gateway/cpp/sci_buildouttb.cpp
scilab/modules/scicos/src/cpp/sciblk2.cpp
scilab/modules/scicos/src/cpp/sciblk4.cpp
scilab/modules/scicos/src/cpp/view_scilab/BaseAdapter.hxx
scilab/modules/signal_processing/src/cpp/signalprocessingfunctions.cpp
scilab/modules/sparse/sci_gateway/cpp/sci_luget.cpp
scilab/modules/types/sci_gateway/cpp/sci_typeof.cpp
scilab/modules/ui_data/sci_gateway/cpp/ui_data_gw.cpp

index 6705506..87b995f 100644 (file)
@@ -248,7 +248,7 @@ int callScilabFunction(void* _pvCtx, char const* _pstName, int _iStart, int _iLh
         in[i]->IncreaseRef();
     }
 
-    callResult = Overload::call(wsFunName, in, _iLhs, out, pStr->m_pVisitor);
+    callResult = Overload::call(wsFunName, in, _iLhs, out);
 
     //unprotect input arguments
     for (int i = 0 ; i < _iRhs ; i++)
@@ -303,7 +303,7 @@ int callOverloadFunction(void* _pvCtx, int _iVar, char* _pstName, unsigned int _
         (*pStr->m_pIn)[i]->IncreaseRef();
     }
 
-    callResult = Overload::call(wsFunName, *(pStr->m_pIn), *(pStr->m_piRetCount), tlReturnedValues, pStr->m_pVisitor);
+    callResult = Overload::call(wsFunName, *(pStr->m_pIn), *(pStr->m_piRetCount), tlReturnedValues);
 
     //unprotect input arguments
     for (int i = 0 ; i < pStr->m_pIn->size() ; i++)
index c454b02..81da5ba 100644 (file)
@@ -24,15 +24,17 @@ src/c/operations/matrix_multiplication.c \
 src/c/operations/matrix_power.c \
 src/c/operations/matrix_transpose.c \
 src/c/operations/operations_tools.c \
-src/cpp/ast/debugvisitor.cpp \
 src/cpp/ast/expHistory.cpp \
 src/cpp/ast/macrovarvisitor.cpp \
-src/cpp/ast/mutevisitor.cpp \
 src/cpp/ast/printvisitor.cpp \
 src/cpp/ast/runvisitor.cpp \
 src/cpp/ast/shortcutvisitor.cpp \
 src/cpp/ast/treevisitor.cpp \
 src/cpp/ast/visitor_common.cpp \
+src/cpp/ast/consoledebugger.cpp \
+src/cpp/ast/debuggervisitor.cpp \
+src/cpp/ast/debugmanager.cpp \
+src/cpp/ast/prettyprintvisitor.cpp \
 src/cpp/operations/interface_addition.cpp \
 src/cpp/operations/operations.cpp \
 src/cpp/operations/types_addition.cpp \
@@ -318,14 +320,12 @@ includes/analysis/ForList.hxx \
 includes/analysis/Result.hxx \
 includes/analysis/TIType.hxx \
 includes/analysis/tools.hxx \
-includes/ast/debugvisitor.hxx \
 includes/ast/deserializervisitor.hxx \
 includes/ast/dummyvisitor.hxx \
 includes/ast/dynlib_ast.h \
 includes/ast/execvisitor.hxx \
 includes/ast/expHistory.hxx \
 includes/ast/macrovarvisitor.hxx \
-includes/ast/mutevisitor.hxx \
 includes/ast/printvisitor.hxx \
 includes/ast/runvisitor.hxx \
 includes/ast/scilabexception.hxx \
@@ -335,6 +335,12 @@ includes/ast/stepvisitor.hxx \
 includes/ast/timedvisitor.hxx \
 includes/ast/visitor_common.hxx \
 includes/ast/visitor.hxx \
+includes/ast/abstractdebugger.hxx \
+includes/ast/breakpoint.hxx \
+includes/ast/consoledebugger.hxx \
+includes/ast/debuggervisitor.hxx \
+includes/ast/debugmanager.hxx \
+includes/ast/prettyprintvisitor.hxx \
 includes/exps/alldec.hxx \
 includes/exps/allexp.hxx \
 includes/exps/all.hxx \
index 85a5a5a..8660b0d 100644 (file)
@@ -183,12 +183,13 @@ am__libsciast_la_SOURCES_DIST = src/c/operations/doublecomplex.c \
        src/c/operations/matrix_multiplication.c \
        src/c/operations/matrix_power.c \
        src/c/operations/matrix_transpose.c \
-       src/c/operations/operations_tools.c \
-       src/cpp/ast/debugvisitor.cpp src/cpp/ast/expHistory.cpp \
-       src/cpp/ast/macrovarvisitor.cpp src/cpp/ast/mutevisitor.cpp \
-       src/cpp/ast/printvisitor.cpp src/cpp/ast/runvisitor.cpp \
-       src/cpp/ast/shortcutvisitor.cpp src/cpp/ast/treevisitor.cpp \
-       src/cpp/ast/visitor_common.cpp \
+       src/c/operations/operations_tools.c src/cpp/ast/expHistory.cpp \
+       src/cpp/ast/macrovarvisitor.cpp src/cpp/ast/printvisitor.cpp \
+       src/cpp/ast/runvisitor.cpp src/cpp/ast/shortcutvisitor.cpp \
+       src/cpp/ast/treevisitor.cpp src/cpp/ast/visitor_common.cpp \
+       src/cpp/ast/consoledebugger.cpp \
+       src/cpp/ast/debuggervisitor.cpp src/cpp/ast/debugmanager.cpp \
+       src/cpp/ast/prettyprintvisitor.cpp \
        src/cpp/operations/interface_addition.cpp \
        src/cpp/operations/operations.cpp \
        src/cpp/operations/types_addition.cpp \
@@ -376,15 +377,17 @@ am_libsciast_la_OBJECTS =  \
        src/c/operations/libsciast_la-matrix_power.lo \
        src/c/operations/libsciast_la-matrix_transpose.lo \
        src/c/operations/libsciast_la-operations_tools.lo \
-       src/cpp/ast/libsciast_la-debugvisitor.lo \
        src/cpp/ast/libsciast_la-expHistory.lo \
        src/cpp/ast/libsciast_la-macrovarvisitor.lo \
-       src/cpp/ast/libsciast_la-mutevisitor.lo \
        src/cpp/ast/libsciast_la-printvisitor.lo \
        src/cpp/ast/libsciast_la-runvisitor.lo \
        src/cpp/ast/libsciast_la-shortcutvisitor.lo \
        src/cpp/ast/libsciast_la-treevisitor.lo \
        src/cpp/ast/libsciast_la-visitor_common.lo \
+       src/cpp/ast/libsciast_la-consoledebugger.lo \
+       src/cpp/ast/libsciast_la-debuggervisitor.lo \
+       src/cpp/ast/libsciast_la-debugmanager.lo \
+       src/cpp/ast/libsciast_la-prettyprintvisitor.lo \
        src/cpp/operations/libsciast_la-interface_addition.lo \
        src/cpp/operations/libsciast_la-operations.lo \
        src/cpp/operations/libsciast_la-types_addition.lo \
@@ -966,7 +969,6 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
-runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -986,12 +988,13 @@ libsciast_la_SOURCES = src/c/operations/doublecomplex.c \
        src/c/operations/matrix_multiplication.c \
        src/c/operations/matrix_power.c \
        src/c/operations/matrix_transpose.c \
-       src/c/operations/operations_tools.c \
-       src/cpp/ast/debugvisitor.cpp src/cpp/ast/expHistory.cpp \
-       src/cpp/ast/macrovarvisitor.cpp src/cpp/ast/mutevisitor.cpp \
-       src/cpp/ast/printvisitor.cpp src/cpp/ast/runvisitor.cpp \
-       src/cpp/ast/shortcutvisitor.cpp src/cpp/ast/treevisitor.cpp \
-       src/cpp/ast/visitor_common.cpp \
+       src/c/operations/operations_tools.c src/cpp/ast/expHistory.cpp \
+       src/cpp/ast/macrovarvisitor.cpp src/cpp/ast/printvisitor.cpp \
+       src/cpp/ast/runvisitor.cpp src/cpp/ast/shortcutvisitor.cpp \
+       src/cpp/ast/treevisitor.cpp src/cpp/ast/visitor_common.cpp \
+       src/cpp/ast/consoledebugger.cpp \
+       src/cpp/ast/debuggervisitor.cpp src/cpp/ast/debugmanager.cpp \
+       src/cpp/ast/prettyprintvisitor.cpp \
        src/cpp/operations/interface_addition.cpp \
        src/cpp/operations/operations.cpp \
        src/cpp/operations/types_addition.cpp \
@@ -1230,14 +1233,12 @@ includes/analysis/ForList.hxx \
 includes/analysis/Result.hxx \
 includes/analysis/TIType.hxx \
 includes/analysis/tools.hxx \
-includes/ast/debugvisitor.hxx \
 includes/ast/deserializervisitor.hxx \
 includes/ast/dummyvisitor.hxx \
 includes/ast/dynlib_ast.h \
 includes/ast/execvisitor.hxx \
 includes/ast/expHistory.hxx \
 includes/ast/macrovarvisitor.hxx \
-includes/ast/mutevisitor.hxx \
 includes/ast/printvisitor.hxx \
 includes/ast/runvisitor.hxx \
 includes/ast/scilabexception.hxx \
@@ -1247,6 +1248,12 @@ includes/ast/stepvisitor.hxx \
 includes/ast/timedvisitor.hxx \
 includes/ast/visitor_common.hxx \
 includes/ast/visitor.hxx \
+includes/ast/abstractdebugger.hxx \
+includes/ast/breakpoint.hxx \
+includes/ast/consoledebugger.hxx \
+includes/ast/debuggervisitor.hxx \
+includes/ast/debugmanager.hxx \
+includes/ast/prettyprintvisitor.hxx \
 includes/exps/alldec.hxx \
 includes/exps/allexp.hxx \
 includes/exps/all.hxx \
@@ -1598,15 +1605,11 @@ src/cpp/ast/$(am__dirstamp):
 src/cpp/ast/$(DEPDIR)/$(am__dirstamp):
        @$(MKDIR_P) src/cpp/ast/$(DEPDIR)
        @: > src/cpp/ast/$(DEPDIR)/$(am__dirstamp)
-src/cpp/ast/libsciast_la-debugvisitor.lo: src/cpp/ast/$(am__dirstamp) \
-       src/cpp/ast/$(DEPDIR)/$(am__dirstamp)
 src/cpp/ast/libsciast_la-expHistory.lo: src/cpp/ast/$(am__dirstamp) \
        src/cpp/ast/$(DEPDIR)/$(am__dirstamp)
 src/cpp/ast/libsciast_la-macrovarvisitor.lo:  \
        src/cpp/ast/$(am__dirstamp) \
        src/cpp/ast/$(DEPDIR)/$(am__dirstamp)
-src/cpp/ast/libsciast_la-mutevisitor.lo: src/cpp/ast/$(am__dirstamp) \
-       src/cpp/ast/$(DEPDIR)/$(am__dirstamp)
 src/cpp/ast/libsciast_la-printvisitor.lo: src/cpp/ast/$(am__dirstamp) \
        src/cpp/ast/$(DEPDIR)/$(am__dirstamp)
 src/cpp/ast/libsciast_la-runvisitor.lo: src/cpp/ast/$(am__dirstamp) \
@@ -1619,6 +1622,17 @@ src/cpp/ast/libsciast_la-treevisitor.lo: src/cpp/ast/$(am__dirstamp) \
 src/cpp/ast/libsciast_la-visitor_common.lo:  \
        src/cpp/ast/$(am__dirstamp) \
        src/cpp/ast/$(DEPDIR)/$(am__dirstamp)
+src/cpp/ast/libsciast_la-consoledebugger.lo:  \
+       src/cpp/ast/$(am__dirstamp) \
+       src/cpp/ast/$(DEPDIR)/$(am__dirstamp)
+src/cpp/ast/libsciast_la-debuggervisitor.lo:  \
+       src/cpp/ast/$(am__dirstamp) \
+       src/cpp/ast/$(DEPDIR)/$(am__dirstamp)
+src/cpp/ast/libsciast_la-debugmanager.lo: src/cpp/ast/$(am__dirstamp) \
+       src/cpp/ast/$(DEPDIR)/$(am__dirstamp)
+src/cpp/ast/libsciast_la-prettyprintvisitor.lo:  \
+       src/cpp/ast/$(am__dirstamp) \
+       src/cpp/ast/$(DEPDIR)/$(am__dirstamp)
 src/cpp/operations/$(am__dirstamp):
        @$(MKDIR_P) src/cpp/operations
        @: > src/cpp/operations/$(am__dirstamp)
@@ -2440,10 +2454,12 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/analysis/$(DEPDIR)/libsciast_la-check_uint64.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/analysis/$(DEPDIR)/libsciast_la-check_uint8.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/analysis/$(DEPDIR)/libsciast_la-check_zeros.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/ast/$(DEPDIR)/libsciast_la-debugvisitor.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/ast/$(DEPDIR)/libsciast_la-consoledebugger.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/ast/$(DEPDIR)/libsciast_la-debuggervisitor.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/ast/$(DEPDIR)/libsciast_la-debugmanager.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/ast/$(DEPDIR)/libsciast_la-expHistory.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/ast/$(DEPDIR)/libsciast_la-macrovarvisitor.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/ast/$(DEPDIR)/libsciast_la-mutevisitor.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/ast/$(DEPDIR)/libsciast_la-prettyprintvisitor.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/ast/$(DEPDIR)/libsciast_la-printvisitor.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/ast/$(DEPDIR)/libsciast_la-runvisitor.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/ast/$(DEPDIR)/libsciast_la-shortcutvisitor.Plo@am__quote@
@@ -2643,13 +2659,6 @@ src/c/operations/libsciast_la-operations_tools.lo: src/c/operations/operations_t
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
 
-src/cpp/ast/libsciast_la-debugvisitor.lo: src/cpp/ast/debugvisitor.cpp
-@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciast_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/ast/libsciast_la-debugvisitor.lo -MD -MP -MF src/cpp/ast/$(DEPDIR)/libsciast_la-debugvisitor.Tpo -c -o src/cpp/ast/libsciast_la-debugvisitor.lo `test -f 'src/cpp/ast/debugvisitor.cpp' || echo '$(srcdir)/'`src/cpp/ast/debugvisitor.cpp
-@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/ast/$(DEPDIR)/libsciast_la-debugvisitor.Tpo src/cpp/ast/$(DEPDIR)/libsciast_la-debugvisitor.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='src/cpp/ast/debugvisitor.cpp' object='src/cpp/ast/libsciast_la-debugvisitor.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciast_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/ast/libsciast_la-debugvisitor.lo `test -f 'src/cpp/ast/debugvisitor.cpp' || echo '$(srcdir)/'`src/cpp/ast/debugvisitor.cpp
-
 src/cpp/ast/libsciast_la-expHistory.lo: src/cpp/ast/expHistory.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciast_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/ast/libsciast_la-expHistory.lo -MD -MP -MF src/cpp/ast/$(DEPDIR)/libsciast_la-expHistory.Tpo -c -o src/cpp/ast/libsciast_la-expHistory.lo `test -f 'src/cpp/ast/expHistory.cpp' || echo '$(srcdir)/'`src/cpp/ast/expHistory.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/ast/$(DEPDIR)/libsciast_la-expHistory.Tpo src/cpp/ast/$(DEPDIR)/libsciast_la-expHistory.Plo
@@ -2664,13 +2673,6 @@ src/cpp/ast/libsciast_la-macrovarvisitor.lo: src/cpp/ast/macrovarvisitor.cpp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciast_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/ast/libsciast_la-macrovarvisitor.lo `test -f 'src/cpp/ast/macrovarvisitor.cpp' || echo '$(srcdir)/'`src/cpp/ast/macrovarvisitor.cpp
 
-src/cpp/ast/libsciast_la-mutevisitor.lo: src/cpp/ast/mutevisitor.cpp
-@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciast_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/ast/libsciast_la-mutevisitor.lo -MD -MP -MF src/cpp/ast/$(DEPDIR)/libsciast_la-mutevisitor.Tpo -c -o src/cpp/ast/libsciast_la-mutevisitor.lo `test -f 'src/cpp/ast/mutevisitor.cpp' || echo '$(srcdir)/'`src/cpp/ast/mutevisitor.cpp
-@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/ast/$(DEPDIR)/libsciast_la-mutevisitor.Tpo src/cpp/ast/$(DEPDIR)/libsciast_la-mutevisitor.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='src/cpp/ast/mutevisitor.cpp' object='src/cpp/ast/libsciast_la-mutevisitor.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciast_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/ast/libsciast_la-mutevisitor.lo `test -f 'src/cpp/ast/mutevisitor.cpp' || echo '$(srcdir)/'`src/cpp/ast/mutevisitor.cpp
-
 src/cpp/ast/libsciast_la-printvisitor.lo: src/cpp/ast/printvisitor.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciast_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/ast/libsciast_la-printvisitor.lo -MD -MP -MF src/cpp/ast/$(DEPDIR)/libsciast_la-printvisitor.Tpo -c -o src/cpp/ast/libsciast_la-printvisitor.lo `test -f 'src/cpp/ast/printvisitor.cpp' || echo '$(srcdir)/'`src/cpp/ast/printvisitor.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/ast/$(DEPDIR)/libsciast_la-printvisitor.Tpo src/cpp/ast/$(DEPDIR)/libsciast_la-printvisitor.Plo
@@ -2706,6 +2708,34 @@ src/cpp/ast/libsciast_la-visitor_common.lo: src/cpp/ast/visitor_common.cpp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciast_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/ast/libsciast_la-visitor_common.lo `test -f 'src/cpp/ast/visitor_common.cpp' || echo '$(srcdir)/'`src/cpp/ast/visitor_common.cpp
 
+src/cpp/ast/libsciast_la-consoledebugger.lo: src/cpp/ast/consoledebugger.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciast_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/ast/libsciast_la-consoledebugger.lo -MD -MP -MF src/cpp/ast/$(DEPDIR)/libsciast_la-consoledebugger.Tpo -c -o src/cpp/ast/libsciast_la-consoledebugger.lo `test -f 'src/cpp/ast/consoledebugger.cpp' || echo '$(srcdir)/'`src/cpp/ast/consoledebugger.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/ast/$(DEPDIR)/libsciast_la-consoledebugger.Tpo src/cpp/ast/$(DEPDIR)/libsciast_la-consoledebugger.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='src/cpp/ast/consoledebugger.cpp' object='src/cpp/ast/libsciast_la-consoledebugger.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciast_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/ast/libsciast_la-consoledebugger.lo `test -f 'src/cpp/ast/consoledebugger.cpp' || echo '$(srcdir)/'`src/cpp/ast/consoledebugger.cpp
+
+src/cpp/ast/libsciast_la-debuggervisitor.lo: src/cpp/ast/debuggervisitor.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciast_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/ast/libsciast_la-debuggervisitor.lo -MD -MP -MF src/cpp/ast/$(DEPDIR)/libsciast_la-debuggervisitor.Tpo -c -o src/cpp/ast/libsciast_la-debuggervisitor.lo `test -f 'src/cpp/ast/debuggervisitor.cpp' || echo '$(srcdir)/'`src/cpp/ast/debuggervisitor.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/ast/$(DEPDIR)/libsciast_la-debuggervisitor.Tpo src/cpp/ast/$(DEPDIR)/libsciast_la-debuggervisitor.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='src/cpp/ast/debuggervisitor.cpp' object='src/cpp/ast/libsciast_la-debuggervisitor.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciast_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/ast/libsciast_la-debuggervisitor.lo `test -f 'src/cpp/ast/debuggervisitor.cpp' || echo '$(srcdir)/'`src/cpp/ast/debuggervisitor.cpp
+
+src/cpp/ast/libsciast_la-debugmanager.lo: src/cpp/ast/debugmanager.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciast_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/ast/libsciast_la-debugmanager.lo -MD -MP -MF src/cpp/ast/$(DEPDIR)/libsciast_la-debugmanager.Tpo -c -o src/cpp/ast/libsciast_la-debugmanager.lo `test -f 'src/cpp/ast/debugmanager.cpp' || echo '$(srcdir)/'`src/cpp/ast/debugmanager.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/ast/$(DEPDIR)/libsciast_la-debugmanager.Tpo src/cpp/ast/$(DEPDIR)/libsciast_la-debugmanager.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='src/cpp/ast/debugmanager.cpp' object='src/cpp/ast/libsciast_la-debugmanager.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciast_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/ast/libsciast_la-debugmanager.lo `test -f 'src/cpp/ast/debugmanager.cpp' || echo '$(srcdir)/'`src/cpp/ast/debugmanager.cpp
+
+src/cpp/ast/libsciast_la-prettyprintvisitor.lo: src/cpp/ast/prettyprintvisitor.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciast_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/ast/libsciast_la-prettyprintvisitor.lo -MD -MP -MF src/cpp/ast/$(DEPDIR)/libsciast_la-prettyprintvisitor.Tpo -c -o src/cpp/ast/libsciast_la-prettyprintvisitor.lo `test -f 'src/cpp/ast/prettyprintvisitor.cpp' || echo '$(srcdir)/'`src/cpp/ast/prettyprintvisitor.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/ast/$(DEPDIR)/libsciast_la-prettyprintvisitor.Tpo src/cpp/ast/$(DEPDIR)/libsciast_la-prettyprintvisitor.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='src/cpp/ast/prettyprintvisitor.cpp' object='src/cpp/ast/libsciast_la-prettyprintvisitor.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciast_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/ast/libsciast_la-prettyprintvisitor.lo `test -f 'src/cpp/ast/prettyprintvisitor.cpp' || echo '$(srcdir)/'`src/cpp/ast/prettyprintvisitor.cpp
+
 src/cpp/operations/libsciast_la-interface_addition.lo: src/cpp/operations/interface_addition.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciast_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/operations/libsciast_la-interface_addition.lo -MD -MP -MF src/cpp/operations/$(DEPDIR)/libsciast_la-interface_addition.Tpo -c -o src/cpp/operations/libsciast_la-interface_addition.lo `test -f 'src/cpp/operations/interface_addition.cpp' || echo '$(srcdir)/'`src/cpp/operations/interface_addition.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/operations/$(DEPDIR)/libsciast_la-interface_addition.Tpo src/cpp/operations/$(DEPDIR)/libsciast_la-interface_addition.Plo
index 04ee1f2..2edd0b9 100644 (file)
@@ -322,15 +322,19 @@ lib /DEF:"$(ProjectDir)string_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform
     <ClInclude Include="includes\analysis\Result.hxx" />
     <ClInclude Include="includes\analysis\TIType.hxx" />
     <ClInclude Include="includes\analysis\tools.hxx" />
-    <ClInclude Include="includes\ast\debugvisitor.hxx" />
+    <ClInclude Include="includes\ast\abstractdebugger.hxx" />
+    <ClInclude Include="includes\ast\breakpoint.hxx" />
+    <ClInclude Include="includes\ast\consoledebugger.hxx" />
+    <ClInclude Include="includes\ast\debuggervisitor.hxx" />
+    <ClInclude Include="includes\ast\debugmanager.hxx" />
     <ClInclude Include="includes\ast\deserializervisitor.hxx" />
     <ClInclude Include="includes\ast\dummyvisitor.hxx" />
     <ClInclude Include="includes\ast\dynlib_ast.h" />
     <ClInclude Include="includes\ast\execvisitor.hxx" />
     <ClInclude Include="includes\ast\expHistory.hxx" />
+    <ClInclude Include="includes\ast\prettyprintvisitor.hxx" />
     <ClInclude Include="includes\ast\treevisitor.hxx" />
     <ClInclude Include="includes\ast\macrovarvisitor.hxx" />
-    <ClInclude Include="includes\ast\mutevisitor.hxx" />
     <ClInclude Include="includes\ast\printvisitor.hxx" />
     <ClInclude Include="includes\ast\runvisitor.hxx" />
     <ClInclude Include="includes\ast\scilabexception.hxx" />
@@ -635,11 +639,13 @@ lib /DEF:"$(ProjectDir)string_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform
     <ClCompile Include="src\cpp\analysis\VisitTypeExps.cpp" />
     <ClCompile Include="src\cpp\analysis\VisitVarDec.cpp" />
     <ClCompile Include="src\cpp\analysis\XBlock.cpp" />
-    <ClCompile Include="src\cpp\ast\debugvisitor.cpp" />
+    <ClCompile Include="src\cpp\ast\consoledebugger.cpp" />
+    <ClCompile Include="src\cpp\ast\debuggervisitor.cpp" />
+    <ClCompile Include="src\cpp\ast\debugmanager.cpp" />
     <ClCompile Include="src\cpp\ast\expHistory.cpp" />
+    <ClCompile Include="src\cpp\ast\prettyprintvisitor.cpp" />
     <ClCompile Include="src\cpp\ast\treevisitor.cpp" />
     <ClCompile Include="src\cpp\ast\macrovarvisitor.cpp" />
-    <ClCompile Include="src\cpp\ast\mutevisitor.cpp" />
     <ClCompile Include="src\cpp\ast\printvisitor.cpp" />
     <ClCompile Include="src\cpp\ast\runvisitor.cpp" />
     <ClCompile Include="src\cpp\ast\shortcutvisitor.cpp" />
index 2152d6e..e781c1f 100644 (file)
     <ClInclude Include="includes\exps\whileexp.hxx">
       <Filter>Header Files\exps</Filter>
     </ClInclude>
-    <ClInclude Include="includes\ast\debugvisitor.hxx">
-      <Filter>Header Files\ast</Filter>
-    </ClInclude>
     <ClInclude Include="includes\ast\deserializervisitor.hxx">
       <Filter>Header Files\ast</Filter>
     </ClInclude>
     <ClInclude Include="includes\ast\macrovarvisitor.hxx">
       <Filter>Header Files\ast</Filter>
     </ClInclude>
-    <ClInclude Include="includes\ast\mutevisitor.hxx">
-      <Filter>Header Files\ast</Filter>
-    </ClInclude>
     <ClInclude Include="includes\ast\printvisitor.hxx">
       <Filter>Header Files\ast</Filter>
     </ClInclude>
     <ClInclude Include="includes\exps\tableintselectexp.hxx">
       <Filter>Header Files\exps</Filter>
     </ClInclude>
+    <ClInclude Include="includes\ast\breakpoint.hxx">
+      <Filter>Header Files\ast</Filter>
+    </ClInclude>
+    <ClInclude Include="includes\ast\consoledebugger.hxx">
+      <Filter>Header Files\ast</Filter>
+    </ClInclude>
+    <ClInclude Include="includes\ast\debuggervisitor.hxx">
+      <Filter>Header Files\ast</Filter>
+    </ClInclude>
+    <ClInclude Include="includes\ast\debugmanager.hxx">
+      <Filter>Header Files\ast</Filter>
+    </ClInclude>
+    <ClInclude Include="includes\ast\abstractdebugger.hxx">
+      <Filter>Header Files\ast</Filter>
+    </ClInclude>
+    <ClInclude Include="includes\ast\prettyprintvisitor.hxx">
+      <Filter>Header Files\ast</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="src\cpp\ast\debugvisitor.cpp">
-      <Filter>Source Files\ast</Filter>
-    </ClCompile>
     <ClCompile Include="src\cpp\ast\expHistory.cpp">
       <Filter>Source Files\ast</Filter>
     </ClCompile>
     <ClCompile Include="src\cpp\ast\macrovarvisitor.cpp">
       <Filter>Source Files\ast</Filter>
     </ClCompile>
-    <ClCompile Include="src\cpp\ast\mutevisitor.cpp">
-      <Filter>Source Files\ast</Filter>
-    </ClCompile>
     <ClCompile Include="src\cpp\ast\printvisitor.cpp">
       <Filter>Source Files\ast</Filter>
     </ClCompile>
     <ClCompile Include="src\cpp\analysis\VisitVarDec.cpp">
       <Filter>Source Files\analysis</Filter>
     </ClCompile>
+    <ClCompile Include="src\cpp\ast\consoledebugger.cpp">
+      <Filter>Source Files\ast</Filter>
+    </ClCompile>
+    <ClCompile Include="src\cpp\ast\debuggervisitor.cpp">
+      <Filter>Source Files\ast</Filter>
+    </ClCompile>
+    <ClCompile Include="src\cpp\ast\debugmanager.cpp">
+      <Filter>Source Files\ast</Filter>
+    </ClCompile>
+    <ClCompile Include="src\cpp\ast\prettyprintvisitor.cpp">
+      <Filter>Source Files\ast</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file
index fb1c930..b5b284b 100644 (file)
@@ -9,3 +9,4 @@ StaticRunner_isRunnerAvailable
 StaticRunner_isInterruptibleCommand
 StaticRunner_setInterruptibleCommand
 StoreConsoleCommand
+parseCommand
\ No newline at end of file
index d7b248f..2e78ec3 100644 (file)
@@ -21,7 +21,7 @@
 #include <vector>
 
 #include "visitor.hxx"
-#include "debugvisitor.hxx"
+#include "prettyprintvisitor.hxx"
 #include "execvisitor.hxx"
 #include "printvisitor.hxx"
 #include "allexp.hxx"
@@ -60,7 +60,7 @@ private:
     PolymorphicMacroCache pmc;
     ConstraintManager cm;
     ConstantVisitor cv;
-    ast::DebugVisitor dv;
+    ast::PrettyPrintVisitor dv;
     ast::PrintVisitor pv;
     std::vector<Result> multipleLHS;
     logging::Logger logger;
@@ -88,6 +88,11 @@ public:
         //std::cerr << "delete AnalysisVisitor" << std::endl;
     }
 
+    virtual AnalysisVisitor* clone()
+    {
+        return new AnalysisVisitor();
+    }
+
     inline CallAnalyzer * getAnalyzer(const symbol::Symbol & sym)
     {
         MapSymCall::iterator it = symscall.find(sym.getName());
@@ -126,7 +131,7 @@ public:
         return pv;
     }
 
-    inline ast::DebugVisitor & getDV()
+    inline ast::PrettyPrintVisitor & getDV()
     {
         return dv;
     }
index 8b6c20f..11cd0a6 100644 (file)
@@ -56,6 +56,19 @@ public:
     {
     }
 
+
+    virtual ConstantVisitor* clone()
+    {
+        if (parent)
+        {
+            return new ConstantVisitor(parent);
+        }
+        else
+        {
+            return new ConstantVisitor(evalSymbols);
+        }
+    }
+
     inline void print_info()
     {
         stop_chrono();
index df4908d..ff6a2d7 100644 (file)
@@ -42,6 +42,11 @@ public:
 
     virtual ~GlobalsCollector() { }
 
+    virtual GlobalsCollector* clone()
+    {
+        return new GlobalsCollector(macrodef);
+    }
+
     static void collect(MacroDef & macrodef);
     const tools::SymbolOrdSet & getGlobals() const;
     void print_info();
index c54a7a3..59378cd 100644 (file)
@@ -50,6 +50,12 @@ public:
     {
     }
 
+    virtual LoopAnalyzer* clone()
+    {
+        return new LoopAnalyzer(seq->clone());
+    }
+
+
     inline bool isAssigned(ast::Exp * e, const symbol::Symbol & sym) const
     {
         if (e)
index 7f2d711..e90770c 100644 (file)
@@ -44,6 +44,11 @@ public:
     {
     }
 
+    virtual TestGVNVisitor* clone()
+    {
+        return new TestGVNVisitor();
+    }
+
     inline void print_info()
     {
         //stop_chrono();
index f553bfb..7c312ae 100644 (file)
@@ -115,12 +115,12 @@ inline static IntType getIntType(const double x)
     {
         if (x >= 0)
         {
-            if (x <= (double)std::numeric_limits<uint64_t>::max())
+            if (x <= (double)(std::numeric_limits<uint64_t>::max)())
             {
                 return UNSIGNED;
             }
         }
-        else if (x >= (double)std::numeric_limits<int64_t>::min())
+        else if (x >= (double)(std::numeric_limits<int64_t>::min)())
         {
             return SIGNED;
         }
diff --git a/scilab/modules/ast/includes/ast/abstractdebugger.hxx b/scilab/modules/ast/includes/ast/abstractdebugger.hxx
new file mode 100644 (file)
index 0000000..17e1c7b
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2015 - Scilab Enterprises - Antoine ELIAS
+ *
+ *  This file must be used under the terms of the CeCILL.
+ *  This source file is licensed as described in the file COPYING, which
+ *  you should have received as part of this distribution.  The terms
+ *  are also available at
+ *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#ifndef __ABSTRACT_DEBUGGER_HXX__
+#define __ABSTRACT_DEBUGGER_HXX__
+
+#include <string>
+#include <vector>
+
+extern "C"
+{
+#include "dynlib_ast.h"
+}
+
+
+namespace debugger
+{
+class EXTERN_AST AbstractDebugger
+{
+public:
+    AbstractDebugger() {}
+    virtual ~AbstractDebugger() {}
+
+    //interface
+    virtual void onStop(int index) = 0; //when a bp is trigger
+    virtual void onResume() = 0;//when "play" is trigger
+    virtual void onAbort() = 0;//when execution is abort
+    virtual void onErrorInFile(const std::wstring& filemane) = 0;//when an error is trigger in a file
+    virtual void onErrorInScript(const std::wstring& funcname) = 0;//when an error is trigger in a script
+    virtual void onQuit() = 0; //when debugger is killed or replace by another one
+
+    virtual void updateBreakpoints() = 0;
+
+};
+
+typedef std::vector<AbstractDebugger*> Debuggers;
+}
+#endif /* !__ABSTRACT_DEBUGGER_HXX__ */
diff --git a/scilab/modules/ast/includes/ast/breakpoint.hxx b/scilab/modules/ast/includes/ast/breakpoint.hxx
new file mode 100644 (file)
index 0000000..06cdb33
--- /dev/null
@@ -0,0 +1,127 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2015 - Scilab Enterprises - Antoine ELIAS
+ *
+ *  This file must be used under the terms of the CeCILL.
+ *  This source file is licensed as described in the file COPYING, which
+ *  you should have received as part of this distribution.  The terms
+ *  are also available at
+ *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#ifndef __BREAKPOINT_HXX__
+#define __BREAKPOINT_HXX__
+
+#include <string>
+#include "macro.hxx"
+#include "exp.hxx"
+#include "tasks.hxx"
+
+namespace debugger
+{
+struct Breakpoint
+{
+    Breakpoint(const std::wstring& functionName, int iLine = -1, const std::wstring& condition = L"")
+        : _pFunctionName(functionName), _iMacroLine(iLine), _file(L""), _iFileLine(0), _condition(condition), _conditionExp(NULL), enable(true) {}
+    //Breakpoint(std::wstring& file, int iLine = -1, ast::Exp* condition = NULL)
+    //    : _pFunctionName(NULL), _iMacroLine(iLine), _file(file), _condition(condition) {}
+
+    ~Breakpoint()
+    {
+        if(_conditionExp)
+        {
+            delete _conditionExp;
+        }
+    };
+
+    void setFile(std::wstring& file)
+    {
+        _file = file;
+    }
+    const std::wstring& getFile() const
+    {
+        return _file;
+    }
+
+    void setFunctionName(std::wstring& functionName)
+    {
+        _pFunctionName = functionName;
+    }
+    const std::wstring& getFunctioName() const
+    {
+        return _pFunctionName;
+    }
+
+    void setMacroLine(int line)
+    {
+        _iMacroLine = line;
+    }
+    int getMacroLine() const
+    {
+        return _iMacroLine;
+    }
+
+    void setFileLine(int line)
+    {
+        _iFileLine = line;
+    }
+    int getFileLine() const
+    {
+        return _iFileLine;
+    }
+
+    bool isMacro() const
+    {
+        return _pFunctionName.empty() == false;
+    }
+
+    bool isFile() const
+    {
+        return isMacro() == false;
+    }
+
+    void setEnable()
+    {
+        enable = true;
+    }
+    void setDisable()
+    {
+        enable = false;
+    }
+    bool isEnable() const
+    {
+        return enable;
+    }
+
+    const std::wstring& getCondition() const
+    {
+        return _condition;
+    }
+
+    ast::Exp* getConditionExp()
+    {
+        if (_conditionExp)
+        {
+            return _conditionExp;
+        }
+
+        _conditionExp = parseCommand(_condition);
+        return _conditionExp;
+    }
+
+private:
+    std::wstring _pFunctionName;
+    std::wstring _file;
+    std::wstring _condition;
+    ast::Exp* _conditionExp;
+    int _iFileLine;
+    int _iMacroLine;
+    bool enable;
+};
+
+typedef std::vector<Breakpoint*> Breakpoints;
+
+}
+
+#endif /* !__BREAKPOINT_HXX__ */
diff --git a/scilab/modules/ast/includes/ast/consoledebugger.hxx b/scilab/modules/ast/includes/ast/consoledebugger.hxx
new file mode 100644 (file)
index 0000000..8fad4d6
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2015 - Scilab Enterprises - Antoine ELIAS
+ *
+ *  This file must be used under the terms of the CeCILL.
+ *  This source file is licensed as described in the file COPYING, which
+ *  you should have received as part of this distribution.  The terms
+ *  are also available at
+ *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#ifndef __CONSOLE_DEBUGGER_HXX__
+#define __CONSOLE_DEBUGGER_HXX__
+
+#include "abstractdebugger.hxx"
+
+extern "C"
+{
+#include "sciprint.h"
+#include "charEncoding.h"
+#include "dynlib_ast.h"
+}
+
+namespace debugger
+{
+class EXTERN_AST ConsoleDebugger : public AbstractDebugger
+{
+
+    void printExp();
+public:
+
+    ConsoleDebugger() {}
+    virtual ~ConsoleDebugger() {}
+
+    virtual void onStop(int index);
+    virtual void onResume();
+    virtual void onAbort();
+    virtual void onErrorInFile(const std::wstring& filemane);
+    virtual void onErrorInScript(const std::wstring& funcname);
+    virtual void onQuit();
+    virtual void updateBreakpoints();
+};
+}
+
+#endif /* !__CONSOLE_DEBUGGER_HXX__ */
diff --git a/scilab/modules/ast/includes/ast/debuggervisitor.hxx b/scilab/modules/ast/includes/ast/debuggervisitor.hxx
new file mode 100644 (file)
index 0000000..3316ab5
--- /dev/null
@@ -0,0 +1,232 @@
+/*
+  *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+  *  Copyright (C) 2015 - Scilab Enterprises - Antoine ELIAS
+  *
+  *  This file must be used under the terms of the CeCILL.
+  *  This source file is licensed as described in the file COPYING, which
+  *  you should have received as part of this distribution.  The terms
+  *  are also available at
+  *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+  *
+  */
+
+#ifndef AST_DEBUGGERVISITOR_HXX
+#define AST_DEBUGGERVISITOR_HXX
+
+#include "runvisitor.hxx"
+#include "printvisitor.hxx"
+
+extern "C"
+{
+#include "sciprint.h"
+}
+namespace ast
+{
+class EXTERN_AST DebuggerVisitor : public RunVisitorT<DebuggerVisitor>
+{
+public:
+
+    DebuggerVisitor* clone()
+    {
+        return new DebuggerVisitor();
+    }
+
+    void visit(const SeqExp  &e);
+
+    void visit(const CallExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const MatrixExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const MatrixLineExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const CellExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const StringExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const CommentExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const DoubleExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const BoolExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const NilExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const SimpleVar &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const ColonVar &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const DollarVar &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const ArrayListVar &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const FieldExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const OpExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const LogicalOpExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const AssignExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const CellCallExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const IfExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const TryCatchExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const WhileExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const ForExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const BreakExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const ContinueExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const ReturnExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const SelectExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const CaseExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const ArrayListExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const AssignListExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const NotExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const TransposeExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const VarDec &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const FunctionDec &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const ListExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const OptimizedExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const MemfillExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const DAXPYExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const IntSelectExp &e)
+    {
+        visitprivate(e);
+    }
+
+    void visit(const StringSelectExp &e)
+    {
+        visitprivate(e);
+    }
+};
+}
+#endif // !AST_DEBUGGERVISITOR_HXX
diff --git a/scilab/modules/ast/includes/ast/debugmanager.hxx b/scilab/modules/ast/includes/ast/debugmanager.hxx
new file mode 100644 (file)
index 0000000..bcbadae
--- /dev/null
@@ -0,0 +1,182 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2015 - Scilab Enterprises - Antoine ELIAS
+ *
+ *  This file must be used under the terms of the CeCILL.
+ *  This source file is licensed as described in the file COPYING, which
+ *  you should have received as part of this distribution.  The terms
+ *  are also available at
+ *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#ifndef __DEBUGGER_MANAGER_HXX__
+#define __DEBUGGER_MANAGER_HXX__
+
+#include "abstractdebugger.hxx"
+#include "breakpoint.hxx"
+#include "dynlib_ast.h"
+
+namespace debugger
+{
+class EXTERN_AST DebuggerMagager
+{
+public :
+    enum DebugAction
+    {
+        Continue,
+        StepNext,
+        StepIn,
+        StepOut
+    };
+
+private:
+    static DebuggerMagager* me;
+    DebuggerMagager() :
+        breakpoints(),
+        debuggers(), pExp(nullptr), interrupted(false), currentBreakPoint(-1), action(Continue), level(0) {}
+
+    Debuggers debuggers;
+    Breakpoints breakpoints;
+
+    ast::Exp* pExp;
+    bool interrupted;
+    int currentBreakPoint;
+    DebugAction action;
+    int level;
+
+    void internal_stop();
+public:
+
+    static DebuggerMagager* getInstance();
+
+    //debuggers functions
+    void addDebugger(AbstractDebugger* _debug);
+    void removeDebugger(int _iDebugger);
+    AbstractDebugger* getDebugger(int _iDebugger);
+    int getDebuggerCount();
+    Debuggers& getAllDebugger();
+
+    void setExp(const ast::Exp* _pExp)
+    {
+        pExp = const_cast<ast::Exp*>(_pExp);
+    }
+    void clearExp()
+    {
+        pExp = NULL;
+    }
+    ast::Exp* getExp()
+    {
+        return pExp;
+    }
+
+    bool isInterrupted()
+    {
+        return interrupted;
+    }
+
+    Breakpoint* getCurrentBreakPoint()
+    {
+        if (currentBreakPoint != -1)
+        {
+            return getBreakPoint(currentBreakPoint);
+        }
+
+        return nullptr;
+    }
+    //send information to debuggers
+    void sendStop(int index);
+    void sendResume();
+    void sendAbort();
+    void sendErrorInFile(const std::wstring& filename) const;
+    void sendErrorInScript(const std::wstring& funcname) const;
+    void sendQuit();
+    void sendUpdate() const;
+
+    void stop(const ast::Exp* pExp, int index);
+    void errorInFile(const std::wstring filename, const ast::Exp* pExp);
+    void errorInScript(const std::wstring funcname, const ast::Exp* pExp);
+    //breakpoints functions
+    void addBreakPoint(Breakpoint* bp);
+    void removeBreakPoint(int _iBreakPoint);
+    void removeAllBreakPoints();
+    void disableAllBreakPoints();
+    void disableBreakPoint(int _iBreakPoint);
+    void enableAllBreakPoints();
+    void enableBreakPoint(int _iBreakPoint);
+    bool isEnableBreakPoint(int _iBreakPoint);
+    Breakpoint* getBreakPoint(int _iBreakPoint);
+    int getBreakPointCount();
+    Breakpoints& getAllBreakPoint();
+
+
+    //actions called by debuggers
+    inline void setStepIn() //enter macro
+    {
+        action = StepIn;
+        level = symbol::Context::getInstance()->getScopeLevel();
+    }
+    inline bool isStepIn()
+    {
+        int l = symbol::Context::getInstance()->getScopeLevel();
+        //if stepIn failed ( not a macro ), stepIn become a stepNext
+        return action == StepIn && l >= level;
+    }
+    inline void resetStepIn()
+    {
+        if (isStepIn())
+        {
+            action = Continue;
+        }
+    }
+
+    inline void setStepOut() //exit macro
+    {
+        action = StepOut;
+        level = symbol::Context::getInstance()->getScopeLevel();
+    }
+    inline bool isStepOut()
+    {
+        int l = symbol::Context::getInstance()->getScopeLevel();
+        return action == StepOut && l < level;
+    }
+    inline void resetStepOut()
+    {
+        if (isStepOut())
+        {
+            action = Continue;
+        }
+    }
+
+    inline void setStepNext() //next statement
+    {
+        action = StepNext;
+        level = symbol::Context::getInstance()->getScopeLevel();
+    }
+    inline bool isStepNext()
+    {
+        int l = symbol::Context::getInstance()->getScopeLevel();
+        //if stepNext failed ( end of macro ), stepNext become a stepOut
+        return action == StepNext && l <= level;
+    }
+    inline void resetStepNext()
+    {
+        if (isStepNext())
+        {
+            action = Continue;
+        }
+    }
+
+    inline void resetStep()
+    {
+        if (isInterrupted() == false)
+        {
+            action = Continue;
+        }
+    }
+    void resume(); //resume execution
+    void abort(); //abort execution
+};
+
+}
+#endif /* !__DEBUGGER_MANAGER_HXX__ */
index 1dd94f0..1d2da58 100644 (file)
@@ -30,6 +30,11 @@ class EXTERN_AST DummyVisitor : public ConstVisitor
 protected:
     DummyVisitor() {}
 
+    DummyVisitor* clone()
+    {
+        return new DummyVisitor();
+    }
+    
     virtual void visit(const MatrixExp &e)
     {
         exps_t lines = e.getLines();
index 7e4f994..7a69a29 100644 (file)
@@ -19,7 +19,12 @@ namespace ast
 {
 class EXTERN_AST ExecVisitor : public RunVisitorT<ExecVisitor>
 {
-    void visit (const SeqExp  &e)
+    ExecVisitor* clone()
+    {
+        return new ExecVisitor();
+    }
+        
+    void visit(const SeqExp  &e)
     {
         visitprivate(e);
     }
index b8cfc98..ec63c7a 100644 (file)
@@ -35,6 +35,11 @@ public:
     }
     ~MacrovarVisitor() {}
 
+    MacrovarVisitor* clone()
+    {
+        return new MacrovarVisitor();
+    }
+
     void visit (const MatrixLineExp &e);
     void visit (const SimpleVar &e);
     void visit(const OpExp &e);
diff --git a/scilab/modules/ast/includes/ast/mutevisitor.hxx b/scilab/modules/ast/includes/ast/mutevisitor.hxx
deleted file mode 100644 (file)
index ae57731..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- *  Copyright (C) 2008-2008 - DIGITEO - Bruno JOFRET
- *
- *  This file must be used under the terms of the CeCILL.
- *  This source file is licensed as described in the file COPYING, which
- *  you should have received as part of this distribution.  The terms
- *  are also available at
- *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-
-#ifndef AST_MUTEVISITOR_HXX
-#define AST_MUTEVISITOR_HXX
-
-#include <iostream>
-#include <sstream>
-
-#include "visitor.hxx"
-#include "allexp.hxx"
-#include "allvar.hxx"
-#include "alldec.hxx"
-
-namespace ast
-{
-class MuteVisitor : public GenVisitor<const_kind>
-{
-public:
-    MuteVisitor() {}
-
-    /** \name Visit Matrix Expressions nodes.
-     ** \{ */
-public :
-    virtual void visit (const MatrixExp &e);
-    virtual void visit (const MatrixLineExp &e);
-    /** \} */
-
-    /** \name Visit Cell Expressions nodes.
-     ** \{ */
-public :
-    virtual void visit (const CellExp &e);
-    /** \} */
-
-    /** \name Visit Constant Expressions nodes.
-     ** \{ */
-public :
-    virtual void visit (const StringExp &e);
-    virtual void visit (const CommentExp &e);
-    virtual void visit (const DoubleExp  &e);
-    virtual void visit (const BoolExp  &e);
-    virtual void visit (const NilExp &e);
-    /** \} */
-
-    /** \name Visit Variable related nodes.
-     ** \{ */
-    virtual void visit (const SimpleVar &e);
-    virtual void visit (const ColonVar &e);
-    virtual void visit (const DollarVar &e);
-    virtual void visit (const ArrayListVar &e);
-    /** \} */
-
-    /** \name Visit Control Expressions or Instructions nodes.
-     ** \{ */
-    virtual void visit (const FieldExp &e);
-    virtual void visit (const OpExp &e);
-    virtual void visit (const LogicalOpExp &e);
-    virtual void visit (const AssignExp  &e);
-    virtual void visit (const CellCallExp &e);
-    virtual void visit (const CallExp &e);
-    virtual void visit (const IfExp  &e);
-    virtual void visit (const TryCatchExp  &e);
-    virtual void visit (const WhileExp  &e);
-    virtual void visit (const ForExp  &e);
-    virtual void visit (const BreakExp &e);
-    virtual void visit (const ContinueExp &e);
-    virtual void visit (const ReturnExp &e);
-    virtual void visit (const SelectExp &e);
-    virtual void visit (const CaseExp &e);
-    virtual void visit (const SeqExp  &e);
-    virtual void visit (const ArrayListExp  &e);
-    virtual void visit (const AssignListExp  &e);
-    /** \} */
-
-    /** \name Visit Single Operation nodes.
-     ** \{ */
-    virtual void visit (const NotExp &e);
-    virtual void visit (const TransposeExp &e);
-    /** \} */
-
-    /** \name Visit Declaration nodes.
-     ** \{ */
-    /** \brief Visit Var declarations. */
-    virtual void visit (const VarDec  &e);
-    virtual void visit (const FunctionDec  &e);
-    /** \} */
-
-    /** \name Visit Type dedicated Expressions related node.
-     ** \{ */
-public:
-    virtual void visit(const ListExp &e);
-    /** \} */
-};
-}
-#endif // !AST_MUTEVISITOR_HXX
@@ -40,16 +40,20 @@ enum TermColor
 
 namespace ast
 {
-class EXTERN_AST DebugVisitor : public GenVisitor<const_kind>
+class EXTERN_AST PrettyPrintVisitor : public GenVisitor<const_kind>
 {
 public:
-    DebugVisitor(std::wostream & my_ostr = std::wcerr, const bool _printDecoration = false, const bool _colored = false) :
+    PrettyPrintVisitor(std::wostream & my_ostr = std::wcerr, const bool _printDecoration = false, const bool _colored = false) :
         ostr(&my_ostr),
         printDecoration(_printDecoration)
     {
         colored = _colored;
     }
 
+    PrettyPrintVisitor* clone()
+    {
+        return new PrettyPrintVisitor(*ostr);
+    }
     /** \name Visit Matrix Expressions nodes.
      ** \{ */
 public :
index f005450..dd9dcf8 100644 (file)
@@ -27,12 +27,18 @@ class EXTERN_AST PrintVisitor : public GenVisitor<const_kind>
 {
 public:
 
-    PrintVisitor(std::wostream& my_ostr, bool parenthesis_display = true, bool _displayOriginal = true) :
+    PrintVisitor(std::wostream& my_ostr, bool parenthesis_display = true, bool _displayOriginal = true, bool _headerOnly = false) :
         ostr (&my_ostr),
         force_parenthesis (parenthesis_display),
         displayOriginal(_displayOriginal),
+        headerOnly(_headerOnly),
         indent(0) { }
 
+    PrintVisitor* clone()
+    {
+        return new PrintVisitor(*ostr, force_parenthesis, displayOriginal, headerOnly);
+    }
+
     /** \name Visit Matrix Expressions nodes.
     ** \{ */
 public :
@@ -121,6 +127,7 @@ protected:
     int             indent;
     bool            force_parenthesis;
     const bool      displayOriginal;
+    const bool      headerOnly;
     bool            is_last_matrix_line;
     bool            is_last_column_comment;
 
index 956be61..76eee6c 100644 (file)
@@ -606,6 +606,11 @@ private :
 public :
     SerializeVisitor(Exp* _ast) : ast(_ast), buf(NULL), buflen(0), bufsize(0), saveNodeNumber(true) {}
 
+    SerializeVisitor* clone()
+    {
+        return new SerializeVisitor(ast);
+    }
+
     unsigned char* serialize(bool _saveNodeNumber = true, bool _saveLocation = true)
     {
         saveNodeNumber = _saveNodeNumber;
index 393f499..eadbd0c 100644 (file)
 #include <iostream>
 
 #include "runvisitor.hxx"
-#include "execvisitor.hxx"
 #include "printvisitor.hxx"
 
 namespace ast
 {
 class EXTERN_AST StepVisitor : public RunVisitorT<StepVisitor>
 {
+    StepVisitor* clone()
+    {
+        return new StepVisitor();
+    }
+
     void visit(const SeqExp &e)
     {
         for (exps_t::const_iterator it = e.getExps().begin (), itEnd = e.getExps().end(); it != itEnd; ++it)
index 820dcae..36747e6 100644 (file)
@@ -29,7 +29,13 @@ namespace ast
 class EXTERN_AST TimedVisitor : public RunVisitorT<TimedVisitor>
 {
 public :
-    void visit (const SeqExp &e)
+
+    TimedVisitor* clone()
+    {
+        return new TimedVisitor();
+    }
+
+    void visit(const SeqExp &e)
     {
         Timer timer;
         timer.start();
index 8a52f32..2c97652 100644 (file)
@@ -84,6 +84,10 @@ public:
     }
     /** \} */
 
+    //force devrived class to implement clone method
+    virtual GenVisitor* clone() = 0;
+
+
     /** \name Visit Variable related nodes.
      ** \{ */
 public:
index f0484bc..c396d51 100644 (file)
@@ -63,6 +63,11 @@ public:
         }
     }
 
+    inline bool isControlExp() const
+    {
+        return true;
+    }
+
 };
 } // namespace ast
 #endif /* !AST_CONTROLEXP_HXX */
index 7b685f6..e1ca1e3 100644 (file)
@@ -32,10 +32,10 @@ typedef std::vector<Exp *> exps_t;
 /** \brief Abstract an Expression node. */
 class Exp : public Ast
 {
-
+public:
     /** \name Ctor & dtor.
     ** \{ */
-public:
+
     /** \brief Construct an Expression node.
     ** \param location scanner position informations */
     Exp (const Location& location)
@@ -442,6 +442,11 @@ public:
         return false;
     }
 
+    inline virtual bool isControlExp() const
+    {
+        return false;
+    }
+
     inline virtual bool isIfExp() const
     {
         return false;
@@ -652,6 +657,7 @@ public:
         return _exps;
     }
 
+
 private:
     bool _verbose;
     bool _bBreak;
index 0becd0c..5f69187 100644 (file)
@@ -28,12 +28,12 @@ public:
                       Exp& select,
                       exps_t& cases,
                       Exp& defaultCase,
-                      const std::vector<int64_t> & _keys, const int64_t _min, const int64_t _max) : IntSelectExp(location, select, cases, defaultCase), min(_min), max(_max), table(_max - _min + 1, &defaultCase), keys(_keys)
+                      const std::vector<int64_t> & _keys, const int64_t min, const int64_t max) : IntSelectExp(location, select, cases, defaultCase), _min(min), _max(max), table(_max - _min + 1, &defaultCase), keys(_keys)
     {
         exps_t::iterator i = std::next(_exps.begin());
         for (const auto & key : keys)
         {
-            table[key - min] = *i;
+            table[key - _min] = *i;
             ++i;
         }
     }
@@ -41,12 +41,12 @@ public:
     TableIntSelectExp(const Location& location,
                       Exp& select,
                       exps_t& cases,
-                      const std::vector<int64_t> & _keys, const int64_t _min, const int64_t _max) : IntSelectExp(location, select, cases), min(_min), max(_max), table(_max - _min + 1, nullptr), keys(_keys)
+                      const std::vector<int64_t> & _keys, const int64_t min, const int64_t max) : IntSelectExp(location, select, cases), _min(min), _max(max), table(_max - _min + 1, nullptr), keys(_keys)
     {
         exps_t::iterator i = std::next(_exps.begin());
         for (const auto & key : keys)
         {
-            table[key - min] = *i;
+            table[key - _min] = *i;
             ++i;
         }
     }
@@ -61,11 +61,11 @@ public:
         TableIntSelectExp * cloned = nullptr;
         if (_hasDefault)
         {
-            cloned = new TableIntSelectExp(getLocation(), *getSelect()->clone(), *cases, *getDefaultCase()->clone(), keys, min, max);
+            cloned = new TableIntSelectExp(getLocation(), *getSelect()->clone(), *cases, *getDefaultCase()->clone(), keys, _min, _max);
         }
         else
         {
-            cloned = new TableIntSelectExp(getLocation(), *getSelect()->clone(), *cases, keys, min, max);
+            cloned = new TableIntSelectExp(getLocation(), *getSelect()->clone(), *cases, keys, _min, _max);
         }
 
         cloned->setVerbose(isVerbose());
@@ -74,9 +74,9 @@ public:
 
     inline Exp * getExp(const int64_t key) const
     {
-        if (key >= min && key <= max)
+        if (key >= _min && key <= _max)
         {
-            return table[key - min];
+            return table[key - _min];
         }
 
         return getDefaultCase();
@@ -94,12 +94,12 @@ public:
 
     inline int64_t getMin() const
     {
-        return min;
+        return _min;
     }
 
     inline int64_t getMax() const
     {
-        return max;
+        return _max;
     }
 
     inline const std::vector<Exp *> & getTable() const
@@ -109,7 +109,7 @@ public:
 
 private:
 
-    int64_t min, max;
+    int64_t _min, _max;
     std::vector<Exp *> table;
     std::vector<int64_t> keys;
 
index f3efa3d..8eae147 100644 (file)
@@ -154,8 +154,11 @@ public:
     {
         _stop_on_first_error = false;
     }
+
+    void releaseTmpFile();
     /** \} */
 
+
 private :
     const std::wstring _file_name;
     const std::wstring _prog_name;
index 487fc96..7e9a13f 100644 (file)
@@ -144,6 +144,7 @@ public :
         _error_message.clear();
     }
 
+    static void releaseTmpFile();
     /*
     ** \brief This funnction returns the parsed code written
     ** at the given line.
index 97640b2..8205985 100644 (file)
@@ -22,9 +22,7 @@
 #include <list>
 #include <map>
 #include <string>
-#include "callable.hxx"
-#include "threadId.hxx"
-#include "cell.hxx"
+#include "visitor.hxx"
 
 extern "C"
 {
@@ -37,6 +35,13 @@ extern "C"
 #define ICONSOLELINES_MIN 0
 #define ICONSOLEWIDTH_MIN 10
 
+namespace types
+{
+class Cell;
+class ThreadId;
+class Callable;
+}
+
 class EXTERN_AST ConfigVariable
 {
     //module list
@@ -390,9 +395,11 @@ public :
         WhereEntry(int line, int absolute_line, const std::wstring& name, int first_line, const std::wstring& file_name) :
             m_line(line), m_absolute_line(absolute_line), m_name(name), m_macro_first_line(first_line), m_file_name(file_name) {}
     };
+    typedef std::vector<WhereEntry> WhereVector;
+        
     static void where_begin(int _iLineNum, int _iLineLocation, types::Callable* _pCall);
     static void where_end();
-    static const std::vector<WhereEntry>& getWhere();
+    static const WhereVector& getWhere();
     static void fillWhereError(int _iErrorLine);
     static void resetWhereError();
 
@@ -402,10 +409,9 @@ public :
     static void setFileNameToLastWhere(const std::wstring& _fileName);
     static void whereErrorToString(std::wostringstream &ostr);
 private :
-    static std::vector<WhereEntry> m_Where;
-    static std::vector<WhereEntry> m_WhereError;
+    static WhereVector m_Where;
+    static WhereVector m_WhereError;
     static std::vector<int> m_FirstMacroLine;
-
     //module called with variable by reference
 private :
     static std::list<std::wstring> m_ReferenceModules;
@@ -458,6 +464,16 @@ public:
     static void setScilabCommand(int _isciCmd);
     static int isScilabCommand();
 
+
+    //debugger information
+    static bool m_bEnabledebug;
+    static ast::ConstVisitor* m_defaultvisitor;
+
+    static bool getEnableDebug();
+    static void setEnableDebug(bool _enable);
+
+    static void setDefaultVisitor(ast::ConstVisitor* _default);
+    static ast::ConstVisitor* getDefaultVisitor();
 };
 
 #endif /* !__CONFIGVARIABLE_HXX__ */
index 94b7bd8..d7e659d 100644 (file)
@@ -76,4 +76,6 @@ EXTERN_AST int getEntryPointPosition(wchar_t* _pwstEntryPointName);
 typedef void(*dynlib_ptr)();
 EXTERN_AST dynlib_ptr getEntryPointFromPosition(int position);
 
+EXTERN_AST int isEnableDebug();
+EXTERN_AST int isDebugInterrupted();
 #endif /* !__CONFIGVARIABLE_INTERFACE_H__ */
index 9428bf3..64029dd 100644 (file)
@@ -390,7 +390,7 @@ public :
     InternalType* extract(typed_list* _pArgs);
     bool resize(int* _piDims, int _iDims);
 
-    virtual bool invoke(typed_list & in, optional_list & /*opt*/, int /*_iRetCount*/, typed_list & out, ast::ConstVisitor & /*execFunc*/, const ast::Exp & e);
+    virtual bool invoke(typed_list & in, optional_list & /*opt*/, int /*_iRetCount*/, typed_list & out, const ast::Exp & e) override;
     virtual bool isInvokable() const;
     virtual bool hasInvokeOption() const;
     virtual int getInvokeNbIn();
index b7a33e4..98d5567 100644 (file)
@@ -47,9 +47,9 @@ public :
         return true;
     }
 
-    virtual ReturnValue   call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc) = 0;
+    virtual ReturnValue call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out) = 0;
 
-    virtual bool invoke(typed_list & in, optional_list & opt, int _iRetCount, typed_list & out, ast::ConstVisitor & execFunc, const ast::Exp & e);
+    virtual bool invoke(typed_list & in, optional_list & opt, int _iRetCount, typed_list & out, const ast::Exp & e)  override;
 
     virtual bool isInvokable() const
     {
index 63f4896..263c86d 100644 (file)
@@ -87,7 +87,7 @@ public :
 
     bool                    toString(std::wostringstream& ostr);
 
-    virtual ReturnValue     call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc);
+    virtual ReturnValue     call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out) override;
 
     /* return type as string ( double, int, cell, list, ... )*/
     virtual std::wstring    getTypeStr()
@@ -124,7 +124,7 @@ private :
 public :
     OptFunction(const std::wstring& _wstName, GW_FUNC_OPT _pFunc, LOAD_DEPS _pLoadDeps, const std::wstring& _wstModule);
 
-    Callable::ReturnValue call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc);
+    Callable::ReturnValue   call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out) override;
     InternalType*           clone();
 
     GW_FUNC_OPT             getFunc()
@@ -132,7 +132,7 @@ public :
         return m_pFunc;
     }
 
-private :
+private:
     GW_FUNC_OPT             m_pFunc;
 };
 
@@ -144,7 +144,7 @@ private :
 public :
     WrapFunction(const std::wstring& _wstName, OLDGW_FUNC _pFunc, LOAD_DEPS _pLoadDeps, const std::wstring& _wstModule);
 
-    Callable::ReturnValue call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc);
+    Callable::ReturnValue   call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out) override;
     InternalType*           clone();
 
     OLDGW_FUNC              getFunc()
@@ -163,7 +163,7 @@ private :
 public :
     WrapMexFunction(const std::wstring& _wstName, MEXGW_FUNC _pFunc, LOAD_DEPS _pLoadDeps, const std::wstring& _wstModule);
 
-    Callable::ReturnValue call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc);
+    Callable::ReturnValue call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out) override;
     InternalType*           clone();
 
     MEXGW_FUNC              getFunc()
@@ -185,7 +185,8 @@ public :
     virtual ~DynamicFunction();
 
     DynamicFunction(const std::wstring& _wstName, const std::wstring& _wstEntryPointName, const std::wstring& _wstLibName, FunctionType _iType, const std::wstring& _wstLoadDepsName, const std::wstring& _wstModule, bool _bCloseLibAfterCall = false);
-    Callable::ReturnValue   call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc);
+    Callable::ReturnValue   call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out) override;
+
 private :
     Callable::ReturnValue   Init();
     void                    Clear();
index cb7d46a..e22685a 100644 (file)
@@ -29,7 +29,6 @@ public :
     int*                    m_piRetCount;
     char*                   m_pstName;
     int*                    m_pOutOrder;
-    ast::ConstVisitor*      m_pVisitor;
 
     GatewayStruct() {};
     ~GatewayStruct() {};
index 719ae04..50d15cb 100644 (file)
@@ -77,7 +77,7 @@ public :
         return true;
     }
 
-    virtual bool invoke(typed_list & in, optional_list & opt, int _iRetCount, typed_list & out, ast::ConstVisitor & execFunc, const ast::Exp & e);
+    virtual bool invoke(typed_list & in, optional_list & opt, int _iRetCount, typed_list & out, const ast::Exp & e) override ;
 
 protected :
     inline ScilabType          getType(void)
index 66e4ba3..970893f 100644 (file)
@@ -130,7 +130,7 @@ public :
     InternalType* extractFullMatrix();
 
     virtual InternalType* extract(typed_list* _pArgs);
-    virtual bool invoke(typed_list & in, optional_list & opt, int _iRetCount, typed_list & out, ast::ConstVisitor & execFunc, const ast::Exp & e);
+    virtual bool invoke(typed_list & in, optional_list & opt, int _iRetCount, typed_list & out, const ast::Exp & e) override ;
 
 
     /* return type as string ( double, int, cell, list, ... )*/
index 4319328..a3fe59c 100644 (file)
@@ -307,7 +307,7 @@ public :
     virtual bool transpose(InternalType *& /*out*/);
     virtual bool adjoint(InternalType *& out);
     virtual bool isFieldExtractionOverloadable() const;
-    virtual bool invoke(typed_list & /*in*/, optional_list & /*opt*/, int /*_iRetCount*/, typed_list & /*out*/, ast::ConstVisitor & /*execFunc*/, const ast::Exp & /*e*/);
+    virtual bool invoke(typed_list & /*in*/, optional_list & /*opt*/, int /*_iRetCount*/, typed_list & /*out*/, const ast::Exp & /*e*/);
     virtual bool isInvokable() const;
     virtual bool hasInvokeOption() const;
     virtual int getInvokeNbIn();
index 588ad9b..0ea48ea 100644 (file)
@@ -66,7 +66,7 @@ public :
     InternalType*                   insert(typed_list* _pArgs, InternalType* _pSource);
     InternalType*                   extract(typed_list* _pArgs);
 
-    virtual bool invoke(typed_list & in, optional_list & /*opt*/, int /*_iRetCount*/, typed_list & out, ast::ConstVisitor & /*execFunc*/, const ast::Exp & /*e*/)
+    virtual bool invoke(typed_list & in, optional_list & /*opt*/, int /*_iRetCount*/, typed_list & out, const ast::Exp & /*e*/) override
     {
         if (in.size() == 0)
         {
index a44e162..2c65a1f 100644 (file)
@@ -57,7 +57,7 @@ public :
 
     bool                        toString(std::wostringstream& ostr);
 
-    Callable::ReturnValue       call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc);
+    Callable::ReturnValue       call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out) override;
 
     inline void cleanCall(symbol::Context * pContext, int oldPromptMode);
 
index ca5fb15..1a7b9b7 100644 (file)
@@ -48,7 +48,7 @@ public :
 
     bool                    toString(std::wostringstream& ostr);
 
-    Callable::ReturnValue   call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc);
+    Callable::ReturnValue   call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out) override;
     bool                    parse(void);
 
     Macro*                  getMacro(void);
index 4a9404c..5a23877 100644 (file)
@@ -46,7 +46,7 @@ public :
         return false;
     }
 
-    virtual bool invoke(typed_list & in, optional_list & opt, int _iRetCount, typed_list & out, ast::ConstVisitor & execFunc, const ast::Exp & e);
+    virtual bool invoke(typed_list & in, optional_list & opt, int _iRetCount, typed_list & out, const ast::Exp & e) override;
 
 protected :
     MList(MList *_oMListCopyMe) : TList(_oMListCopyMe) {}
index 00bbd0a..1d1b1fd 100644 (file)
@@ -30,12 +30,12 @@ public:
     /**
      */
     static types::Function::ReturnValue generateNameAndCall(const std::wstring& _stFunctionName, types::typed_list &in, int _iRetCount,
-            types::typed_list &out, ast::ConstVisitor *_execMe = nullptr, bool _isOperator = false);
+            types::typed_list &out, bool _isOperator = false);
 
     /**
      */
     static types::Function::ReturnValue call(const std::wstring& _stFunctionName, types::typed_list &in, int _iRetCount,
-            types::typed_list &out, ast::ConstVisitor *_execMe = nullptr, bool _isOperator = false);
+            types::typed_list &out, bool _isOperator = false);
 
     static std::wstring getNameFromOper(const int);
 
index b68a3d9..0fbd366 100644 (file)
@@ -204,7 +204,7 @@ struct EXTERN_AST Sparse : GenericType
      */
     InternalType* extract(typed_list* _pArgs);
     Sparse* extract(int _iSeqCount, int* _piSeqCoord, int* _piMaxDim, int* _piDimSize, bool _bAsVector) SPARSE_CONST;
-    virtual bool invoke(typed_list & in, optional_list & /*opt*/, int /*_iRetCount*/, typed_list & out, ast::ConstVisitor & /*execFunc*/, const ast::Exp & e);
+    virtual bool invoke(typed_list & in, optional_list & /*opt*/, int /*_iRetCount*/, typed_list & out, const ast::Exp & e);
     virtual bool isInvokable() const;
     virtual bool hasInvokeOption() const;
     virtual int getInvokeNbIn();
@@ -540,7 +540,7 @@ struct EXTERN_AST SparseBool : GenericType
     SparseBool* extract(int _iSeqCount, int* _piSeqCoord, int* _piMaxDim, int* _piDimSize, bool _bAsVector) SPARSE_CONST;
     InternalType* extract(typed_list* _pArgs);
 
-    virtual bool invoke(typed_list & in, optional_list &/*opt*/, int /*_iRetCount*/, typed_list & out, ast::ConstVisitor & /*execFunc*/, const ast::Exp & e);
+    virtual bool invoke(typed_list & in, optional_list &/*opt*/, int /*_iRetCount*/, typed_list & out, const ast::Exp & e);
     virtual bool isInvokable() const;
     virtual bool hasInvokeOption() const;
     virtual int getInvokeNbIn();
index 72f0439..c310b4d 100644 (file)
@@ -123,7 +123,7 @@ public :
     using ArrayOf<SingleStruct *>::extract;
     bool extract(const std::wstring& name, InternalType *& out);
 
-    virtual bool invoke(typed_list & in, optional_list & opt, int _iRetCount, typed_list & out, ast::ConstVisitor & execFunc, const ast::Exp & e);
+    virtual bool invoke(typed_list & in, optional_list & opt, int _iRetCount, typed_list & out, const ast::Exp & e) override;
 
     virtual int getInvokeNbOut()
     {
index b58bc7f..4c3c0a7 100644 (file)
@@ -54,7 +54,7 @@ public :
     using List::extract; // to avoid this extract to hide extract in list
     bool                            extract(const std::wstring& name, InternalType *& out);
 
-    virtual bool invoke(typed_list & in, optional_list & opt, int _iRetCount, typed_list & out, ast::ConstVisitor & execFunc, const ast::Exp & e);
+    virtual bool invoke(typed_list & in, optional_list & opt, int _iRetCount, typed_list & out, const ast::Exp & e) override;
 
     bool isFieldExtractionOverloadable() const
     {
index 53bd48f..c7a786b 100644 (file)
@@ -131,7 +131,7 @@ public :
     // Outputs :
     // if false, Scilab will call the macro %UserType_e,where UserType is the string return by the method getShortTypeStr()
     // if true, Scilab will set each elements of out in Scilab variables
-    virtual bool invoke(types::typed_list & in, types::optional_list & /*opt*/, int /*_iRetCount*/, types::typed_list & out, ast::ConstVisitor & /*execFunc*/, const ast::Exp & /*e*/)
+    virtual bool invoke(types::typed_list & in, types::optional_list & /*opt*/, int /*_iRetCount*/, types::typed_list & out, const ast::Exp & /*e*/) override
     {
         InternalType* pIT = extract(&in);
         if (pIT)
index ab1bb3a..7ee083b 100644 (file)
@@ -10,7 +10,7 @@
  *
  */
 
-#include "debugvisitor.hxx"
+#include "prettyprintvisitor.hxx"
 #include "printvisitor.hxx"
 
 #include "data/DataManager.hxx"
@@ -303,10 +303,7 @@ std::wostream & operator<<(std::wostream & out, const FunctionBlock & fblock)
         }
     }
 
-    //ast::PrintVisitor pv(out, true, false);
-    //fblock.exp->accept(pv);
-
-    ast::DebugVisitor dv(out, true, true);
+    ast::PrettyPrintVisitor dv(out);
     fblock.exp->accept(dv);
 
     return out;
diff --git a/scilab/modules/ast/src/cpp/ast/consoledebugger.cpp b/scilab/modules/ast/src/cpp/ast/consoledebugger.cpp
new file mode 100644 (file)
index 0000000..00b614c
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2015 - Scilab Enterprises - Antoine ELIAS
+ *
+ *  This file must be used under the terms of the CeCILL.
+ *  This source file is licensed as described in the file COPYING, which
+ *  you should have received as part of this distribution.  The terms
+ *  are also available at
+ *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#include "consoledebugger.hxx"
+#include "debugmanager.hxx"
+#include "printvisitor.hxx"
+
+extern "C"
+{
+#include "sciprint.h"
+#include "prompt.h"
+}
+
+namespace debugger
+{
+void ConsoleDebugger::onStop(int index)
+{
+    if (index >= 0)
+    {
+        debugger::DebuggerMagager* manager = debugger::DebuggerMagager::getInstance();
+        debugger::Breakpoint* bp = manager->getBreakPoint(index);
+        if (bp)
+        {
+            sciprint(_("debugger stop on breakpoint(%d) in function %ls line %d\n"), index, bp->getFunctioName().data(), bp->getMacroLine());
+        }
+    }
+
+    printExp();
+}
+
+void ConsoleDebugger::onResume()
+{
+    //sciprint("ConsoleDebugger::onResume.\n");
+}
+
+void ConsoleDebugger::onAbort()
+{
+    sciprint(_("Execution aborted.\n"));
+}
+
+void ConsoleDebugger::onErrorInFile(const std::wstring& filename)
+{
+    debugger::DebuggerMagager* manager = debugger::DebuggerMagager::getInstance();
+    ast::Exp* exp = manager->getExp();
+    sciprint(_("debugger stop on error in file %ls line %d\n"), filename.data(), exp->getLocation().first_line);
+    printExp();
+}
+
+void ConsoleDebugger::onErrorInScript(const std::wstring& funcname)
+{
+    debugger::DebuggerMagager* manager = debugger::DebuggerMagager::getInstance();
+    ast::Exp* exp = manager->getExp();
+    sciprint(_("debugger stop on error in function %ls line %d\n"), funcname.data(), exp->getLocation().first_line);
+    printExp();
+}
+
+void ConsoleDebugger::onQuit()
+{
+    sciprint(_("Leave debugger.\n"));
+}
+
+void ConsoleDebugger::updateBreakpoints()
+{
+    debugger::DebuggerMagager* manager = debugger::DebuggerMagager::getInstance();
+    debugger::Breakpoints& brks = manager->getAllBreakPoint();
+
+    if (brks.size() == 0)
+    {
+        sciprint("No breakpoint\n");
+        return;
+    }
+
+    sciprint("% 3ls % 7ls %24ls % 5ls %ls\n\n", L"num", L"enable", L"function", L"line", L"condition");
+    int i = 0;
+    for (const auto& b : brks)
+    {
+        if (b->isMacro())
+        {
+            std::wstring condition = b->getCondition();
+            sciprint("% 3d % 7s %24ls % 5d %ls\n", i, b->isEnable() ? "true" : "false", b->getFunctioName().c_str(), b->getMacroLine(),
+                     condition.size() < 30 ? condition.c_str() :
+                     (std::wstring(condition.begin(), condition.begin() + 27) + L"...").c_str());
+        }
+
+        ++i;
+    }
+}
+
+void ConsoleDebugger::printExp()
+{
+    debugger::DebuggerMagager* manager = debugger::DebuggerMagager::getInstance();
+    std::wostringstream ostr;
+    ast::PrintVisitor pp(ostr, true, true, true);
+    manager->getExp()->accept(pp);
+    sciprint("%s%ls\n", SCIPROMPT_PAUSE, ostr.str().data());
+}
+}
diff --git a/scilab/modules/ast/src/cpp/ast/debuggervisitor.cpp b/scilab/modules/ast/src/cpp/ast/debuggervisitor.cpp
new file mode 100644 (file)
index 0000000..538fced
--- /dev/null
@@ -0,0 +1,312 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2015 - Scilab Enterprises - Antoine ELIAS
+ *
+ *  This file must be used under the terms of the CeCILL.
+ *  This source file is licensed as described in the file COPYING, which
+ *  you should have received as part of this distribution.  The terms
+ *  are also available at
+ *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#include "debuggervisitor.hxx"
+#include "debugmanager.hxx"
+#include "printvisitor.hxx"
+#include "execvisitor.hxx"
+#include "threadId.hxx"
+
+extern "C"
+{
+#include "filemanager_interface.h"
+}
+
+namespace ast
+{
+void DebuggerVisitor::visit(const SeqExp  &e)
+{
+    RunVisitor* exec = NULL;
+    std::list<Exp *>::const_iterator itExp;
+    debugger::DebuggerMagager* manager = debugger::DebuggerMagager::getInstance();
+
+    if (ConfigVariable::getEnableDebug() == false)
+    {
+        //enable debugger for next execution
+        ConfigVariable::setEnableDebug(true);
+
+        ExecVisitor exec;
+        e.accept(exec);
+        return;
+    }
+
+    for (const auto& exp : e.getExps())
+    {
+        if (e.isBreakable())
+        {
+            exp->resetBreak();
+            exp->setBreakable();
+        }
+
+        if (e.isContinuable())
+        {
+            exp->resetContinue();
+            exp->setContinuable();
+        }
+
+        if (e.isReturnable())
+        {
+            exp->setReturnable();
+        }
+
+        //debugger check !
+        if (ConfigVariable::getEnableDebug())
+        {
+            std::vector<ConfigVariable::WhereEntry> lWhereAmI = ConfigVariable::getWhere();
+            int iLine = (exp->getLocation().first_line - ConfigVariable::getMacroFirstLines()) + 1;
+
+            //manage step next
+            if (manager->isStepNext())
+            {
+                manager->resetStepNext();
+                manager->stop(exp, -1);
+            }
+            else if (manager->isStepIn())
+            {
+                manager->resetStepIn();
+                manager->stop(exp, -1);
+            }
+            else if (manager->isStepOut())
+            {
+                manager->resetStepOut();
+                manager->stop(exp, -1);
+            }
+            else
+            {
+                //set information from debugger commands
+                if (lWhereAmI.size() != 0 && manager->getBreakPointCount() != 0)
+                {
+                    debugger::Breakpoints bps = manager->getAllBreakPoint();
+                    std::wstring functionName = lWhereAmI.back().m_name;
+                    int i = -1;
+                    for (const auto& bp : bps)
+                    {
+                        ++i;
+                        if (bp->isEnable() == false)
+                        {
+                            continue;
+                        }
+
+                        if (functionName == bp->getFunctioName())
+                        {
+                            if (bp->getMacroLine() == -1)
+                            {
+                                //first pass in macro.
+                                //update first line with real value
+                                bp->setMacroLine(iLine);
+                            }
+
+                            if (bp->getMacroLine() == iLine)
+                            {
+                                //check condition
+                                if (bp->getConditionExp() != NULL)
+                                {
+                                    //do not use debuggervisitor !
+                                    symbol::Context* pCtx = symbol::Context::getInstance();
+                                    try
+                                    {
+                                        ExecVisitor execCond;
+                                        //protect current env during condition execution
+                                        pCtx->scope_begin();
+                                        bp->getConditionExp()->accept(execCond);
+                                        types::InternalType* pIT = pCtx->getCurrentLevel(symbol::Symbol(L"ans"));
+                                        if (pIT == NULL ||
+                                                pIT->isBool() == false ||
+                                                ((types::Bool*)pIT)->isScalar() == false ||
+                                                ((types::Bool*)pIT)->get(0) == 0)
+                                        {
+                                            pCtx->scope_end();
+                                            //not a boolean, not scalar or false
+                                            continue;
+                                        }
+
+                                        pCtx->scope_end();
+                                        //ok condition is valid and true
+                                    }
+                                    catch (ast::ScilabException &/*e*/)
+                                    {
+                                        pCtx->scope_end();
+                                        //not work !
+                                        //invalid breakpoint
+                                        continue;
+                                    }
+                                }
+
+                                //we have a breakpoint !
+                                //stop execution and wait signal from debugger to restart
+                                manager->stop(exp, i);
+
+                                //only one breakpoint can be "call" on same exp
+                                break;
+                            }
+                        }
+                    }
+                }
+            }
+            exec = this;
+        }
+        else
+        {
+            //change visitor to execvitor instead of debuggervisitor
+            exec = new ExecVisitor();
+        }
+
+        //copy from runvisitor::seqexp
+        try
+        {
+            //reset default values
+            setResult(NULL);
+            int iExpectedSize = getExpectedSize();
+            setExpectedSize(-1);
+            exp->accept(*exec);
+            setExpectedSize(iExpectedSize);
+            types::InternalType * pIT = getResult();
+
+            // In case of exec file, set the file name in the Macro to store where it is defined.
+            int iFileID = ConfigVariable::getExecutedFileID();
+            if (iFileID && exp->isFunctionDec())
+            {
+                types::InternalType* pITMacro = symbol::Context::getInstance()->get(exp->getAs<ast::FunctionDec>()->getSymbol());
+                if (pITMacro)
+                {
+                    types::Macro* pMacro = pITMacro->getAs<types::Macro>();
+                    const wchar_t* filename = getfile_filename(iFileID);
+                    // scilab.quit is not open with mopen
+                    // in this case filename is NULL because FileManager have not been filled.
+                    if (filename)
+                    {
+                        pMacro->setFileName(filename);
+                    }
+                }
+            }
+
+            if (pIT != NULL)
+            {
+                bool bImplicitCall = false;
+                if (pIT->isCallable()) //to manage call without ()
+                {
+                    types::Callable *pCall = pIT->getAs<types::Callable>();
+                    types::typed_list out;
+                    types::typed_list in;
+                    types::optional_list opt;
+
+                    try
+                    {
+                        //in this case of calling, we can return only one values
+                        int iSaveExpectedSize = getExpectedSize();
+                        setExpectedSize(1);
+
+                        pCall->invoke(in, opt, getExpectedSize(), out, e);
+                        setExpectedSize(iSaveExpectedSize);
+
+                        if (out.size() == 0)
+                        {
+                            setResult(NULL);
+                        }
+                        else
+                        {
+                            setResult(out[0]);
+                        }
+
+                        bImplicitCall = true;
+                    }
+                    catch (const InternalError& ie)
+                    {
+                        if (ConfigVariable::getLastErrorFunction() == L"")
+                        {
+                            ConfigVariable::setLastErrorFunction(pCall->getName());
+                            ConfigVariable::setLastErrorLine(e.getLocation().first_line);
+                        }
+
+                        throw ie;
+                    }
+                }
+
+                //don't output Simplevar and empty result
+                if (getResult() != NULL && (!exp->isSimpleVar() || bImplicitCall))
+                {
+                    //symbol::Context::getInstance()->put(symbol::Symbol(L"ans"), *execMe.getResult());
+                    types::InternalType* pITAns = getResult();
+                    symbol::Context::getInstance()->put(m_pAns, pITAns);
+                    if (exp->isVerbose() && ConfigVariable::isPromptShow())
+                    {
+                        //TODO manage multiple returns
+                        scilabWriteW(L" ans  =\n\n");
+                        std::wostringstream ostrName;
+                        ostrName << L"ans";
+                        types::VariableToString(pITAns, ostrName.str().c_str());
+                    }
+                }
+
+                pIT->killMe();
+            }
+
+            if ((&e)->isBreakable() && exp->isBreak())
+            {
+                const_cast<SeqExp *>(&e)->setBreak();
+                exp->resetBreak();
+                break;
+            }
+
+            if ((&e)->isContinuable() && exp->isContinue())
+            {
+                const_cast<SeqExp *>(&e)->setContinue();
+                exp->resetContinue();
+                break;
+            }
+
+            if ((&e)->isReturnable() && exp->isReturn())
+            {
+                const_cast<SeqExp *>(&e)->setReturn();
+                exp->resetReturn();
+                break;
+            }
+        }
+        catch (const InternalError& ie)
+        {
+            ConfigVariable::fillWhereError(ie.GetErrorLocation().first_line);
+
+            std::vector<ConfigVariable::WhereEntry> lWhereAmI = ConfigVariable::getWhere();
+
+            //where can be empty on last stepout, on first calling expression
+            if (lWhereAmI.size())
+            {
+                std::wstring& filename = lWhereAmI.back().m_file_name;
+
+                if (filename.empty())
+                {
+                    //error in a console script
+                    std::wstring functionName = lWhereAmI.back().m_name;
+                    manager->errorInScript(functionName, exp);
+                }
+                else
+                {
+                    manager->errorInFile(filename, exp);
+                }
+            }
+
+            throw ie;
+        }
+
+        // If something other than NULL is given to setResult, then that would imply
+        // to make a cleanup in visit(ForExp) for example (e.getBody().accept(*this);)
+        setResult(NULL);
+
+    }
+
+    //propagate StepNext to parent SeqExp
+    if (ConfigVariable::getEnableDebug())
+    {
+    }
+}
+}
+
diff --git a/scilab/modules/ast/src/cpp/ast/debugmanager.cpp b/scilab/modules/ast/src/cpp/ast/debugmanager.cpp
new file mode 100644 (file)
index 0000000..8b9290d
--- /dev/null
@@ -0,0 +1,324 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2015 - Scilab Enterprises - Antoine ELIAS
+ *
+ *  This file must be used under the terms of the CeCILL.
+ *  This source file is licensed as described in the file COPYING, which
+ *  you should have received as part of this distribution.  The terms
+ *  are also available at
+ *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#include "debugmanager.hxx"
+#include "configvariable.hxx"
+#include "threadmanagement.hxx"
+#include "runner.hxx"
+
+#include "threadId.hxx"
+
+extern "C"
+{
+#include "Thread_Wrapper.h"
+}
+
+namespace debugger
+{
+DebuggerMagager* DebuggerMagager::me = NULL;
+
+//singleton
+DebuggerMagager* DebuggerMagager::getInstance()
+{
+    if (me == NULL)
+    {
+        me = new DebuggerMagager();
+    }
+
+    return me;
+}
+
+void DebuggerMagager::addDebugger(AbstractDebugger* _debug)
+{
+    debuggers.push_back(_debug);
+}
+
+void DebuggerMagager::removeDebugger(int _iDebugger)
+{
+    if (_iDebugger >= 0 && _iDebugger <= debuggers.size())
+    {
+        debuggers.erase(debuggers.begin() + _iDebugger);
+    }
+}
+
+AbstractDebugger* DebuggerMagager::getDebugger(int _iDebugger)
+{
+    if (_iDebugger >= 0 && _iDebugger <= debuggers.size())
+    {
+        return debuggers[_iDebugger];
+    }
+
+    return NULL;
+}
+
+int DebuggerMagager::getDebuggerCount()
+{
+    return (int)debuggers.size();
+}
+
+Debuggers& DebuggerMagager::getAllDebugger()
+{
+    return debuggers;
+}
+
+void DebuggerMagager::sendStop(int index)
+{
+    currentBreakPoint = index;
+    for (const auto& it : debuggers)
+    {
+        it->onStop(index);
+    }
+}
+
+void DebuggerMagager::sendResume()
+{
+    currentBreakPoint = -1;
+    for (const auto& it : debuggers)
+    {
+        it->onResume();
+    }
+}
+
+void DebuggerMagager::sendAbort()
+{
+    currentBreakPoint = -1;
+    for (const auto& it : debuggers)
+    {
+        it->onAbort();
+    }
+}
+
+void DebuggerMagager::sendErrorInFile(const std::wstring& filename) const
+{
+    for (const auto& it : debuggers)
+    {
+        it->onErrorInFile(filename);
+    }
+}
+
+void DebuggerMagager::sendErrorInScript(const std::wstring& funcname) const
+{
+    for (const auto& it : debuggers)
+    {
+        it->onErrorInScript(funcname);
+    }
+}
+
+void DebuggerMagager::sendQuit()
+{
+    currentBreakPoint = -1;
+    for (const auto& it : debuggers)
+    {
+        it->onQuit();
+    }
+}
+
+void DebuggerMagager::sendUpdate() const
+{
+    for (const auto& it : debuggers)
+    {
+        it->updateBreakpoints();
+    }
+}
+
+void DebuggerMagager::addBreakPoint(Breakpoint* bp)
+{
+    breakpoints.push_back(bp);
+    sendUpdate();
+}
+
+void DebuggerMagager::removeBreakPoint(int _iBreakPoint)
+{
+    if (_iBreakPoint >= 0 && _iBreakPoint <= breakpoints.size())
+    {
+        Breakpoints::iterator it = breakpoints.begin() + _iBreakPoint;
+        delete *it;
+        breakpoints.erase(it);
+        sendUpdate();
+    }
+}
+
+void DebuggerMagager::removeAllBreakPoints()
+{
+    Breakpoints::iterator it = breakpoints.begin();
+    for (; it != breakpoints.end(); ++it)
+    {
+        delete *it;
+    }
+
+    breakpoints.clear();
+    sendUpdate();
+}
+
+void DebuggerMagager::disableBreakPoint(int _iBreakPoint)
+{
+    if (_iBreakPoint >= 0 && _iBreakPoint <= breakpoints.size())
+    {
+        breakpoints[_iBreakPoint]->setDisable();
+        sendUpdate();
+    }
+}
+
+void DebuggerMagager::disableAllBreakPoints()
+{
+    for (const auto& it : breakpoints)
+    {
+        it->setDisable();
+    }
+
+    sendUpdate();
+}
+
+void DebuggerMagager::enableBreakPoint(int _iBreakPoint)
+{
+    if (_iBreakPoint >= 0 && _iBreakPoint <= breakpoints.size())
+    {
+        breakpoints[_iBreakPoint]->setEnable();
+    }
+}
+
+void DebuggerMagager::enableAllBreakPoints()
+{
+    for (const auto& it : breakpoints)
+    {
+        it->setEnable();
+    }
+
+    sendUpdate();
+}
+
+bool DebuggerMagager::isEnableBreakPoint(int _iBreakPoint)
+{
+    if (_iBreakPoint >= 0 && _iBreakPoint <= breakpoints.size())
+    {
+        return breakpoints[_iBreakPoint]->isEnable();
+    }
+
+    return false;
+}
+
+Breakpoint* DebuggerMagager::getBreakPoint(int _iBreakPoint)
+{
+    if (_iBreakPoint >= 0 && _iBreakPoint < breakpoints.size())
+    {
+        return breakpoints[_iBreakPoint];
+    }
+
+    return NULL;
+}
+
+int DebuggerMagager::getBreakPointCount()
+{
+    return (int)breakpoints.size();
+}
+
+Breakpoints& DebuggerMagager::getAllBreakPoint()
+{
+    return breakpoints;
+}
+
+void DebuggerMagager::resume() //resume execution
+{
+    if (ConfigVariable::getPauseLevel() != 0)
+    {
+        ConfigVariable::DecreasePauseLevel();
+        //inform debuggers
+        sendResume();
+    }
+
+}
+
+void DebuggerMagager::abort() //abort execution
+{
+    if (ConfigVariable::getPauseLevel() != 0)
+    {
+        //inform debuggers
+        sendAbort();
+
+        throw ast::InternalAbort();
+    }
+}
+
+void DebuggerMagager::internal_stop()
+{
+    interrupted = true;
+
+    ConfigVariable::IncreasePauseLevel();
+
+    // unlock console thread to display prompt again
+    ThreadManagement::SendConsoleExecDoneSignal();
+
+    //return to console so change mode to 2
+    int iOldMode = ConfigVariable::getPromptMode();
+    ConfigVariable::setPromptMode(2);
+
+    int iPauseLevel = ConfigVariable::getPauseLevel();
+    while (ConfigVariable::getPauseLevel() == iPauseLevel)
+    {
+        ThreadManagement::SendAwakeRunnerSignal();
+        ThreadManagement::WaitForRunMeSignal();
+        try
+        {
+            StaticRunner_launch();
+        }
+        catch (const ast::InternalError& ie)
+        {
+            //return from console so change mode to initial
+            ConfigVariable::setPromptMode(iOldMode);
+            //clean current seqexp
+            clearExp();
+            interrupted = false;
+
+            throw ie;
+        }
+        catch (const ast::InternalAbort& ia)
+        {
+            //return from console so change mode to initial
+            ConfigVariable::setPromptMode(iOldMode);
+            //clean current seqexp
+            clearExp();
+            interrupted = false;
+
+            throw ia;
+        }
+    }
+
+    //return from console so change mode to initial
+    ConfigVariable::setPromptMode(iOldMode);
+    //clean current seqexp
+    interrupted = false;
+}
+
+void DebuggerMagager::stop(const ast::Exp* pExp, int index)
+{
+    //send stop information to all debuggers
+    setExp(pExp);
+    sendStop(index);
+    internal_stop();
+    clearExp();
+}
+void DebuggerMagager::errorInFile(const std::wstring filename, const ast::Exp* pExp)
+{
+    setExp(pExp);
+    sendErrorInFile(filename);
+    internal_stop();
+    clearExp();
+}
+void DebuggerMagager::errorInScript(const std::wstring funcname, const ast::Exp* pExp)
+{
+    setExp(pExp);
+    sendErrorInScript(funcname);
+    internal_stop();
+    clearExp();
+}
+
+}
diff --git a/scilab/modules/ast/src/cpp/ast/mutevisitor.cpp b/scilab/modules/ast/src/cpp/ast/mutevisitor.cpp
deleted file mode 100644 (file)
index 9299a73..0000000
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
-*  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-*  Copyright (C) 2008-2008 - DIGITEO - Bruno JOFRET
-*
-*  This file must be used under the terms of the CeCILL.
-*  This source file is licensed as described in the file COPYING, which
-*  you should have received as part of this distribution.  The terms
-*  are also available at
-*  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
-*
-*/
-
-#include "mutevisitor.hxx"
-
-namespace ast
-{
-
-void MuteVisitor::visit (const MatrixExp &e)
-{
-    exps_t lines = e.getLines();
-    for (exps_t::const_iterator it = lines.begin(), itEnd = lines.end(); it != itEnd ; ++it)
-    {
-        (*it)->mute();
-        (*it)->accept(*this);
-    }
-}
-
-void MuteVisitor::visit (const MatrixLineExp &e)
-{
-    exps_t columns = e.getColumns();
-    for (exps_t::const_iterator it = columns.begin(), itEnd = columns.end(); it != itEnd ; ++it)
-    {
-        (*it)->mute();
-        (*it)->accept(*this);
-    }
-}
-
-void MuteVisitor::visit (const CellExp &e)
-{
-    exps_t lines = e.getLines();
-    for (exps_t::const_iterator it = lines.begin(), itEnd = lines.end(); it != itEnd ; ++it)
-    {
-        (*it)->mute();
-        (*it)->accept(*this);
-    }
-}
-
-void MuteVisitor::visit (const StringExp &/*e*/)
-{
-}
-
-void MuteVisitor::visit (const CommentExp &/*e*/)
-{
-}
-
-void MuteVisitor::visit (const DoubleExp  &/*e*/)
-{
-}
-
-void MuteVisitor::visit (const BoolExp  &/*e*/)
-{
-}
-
-void MuteVisitor::visit (const NilExp &/*e*/)
-{
-}
-
-void MuteVisitor::visit (const SimpleVar &/*e*/)
-{
-}
-
-void MuteVisitor::visit (const ColonVar &/*e*/)
-{
-}
-
-void MuteVisitor::visit (const DollarVar &/*e*/)
-{
-}
-
-void MuteVisitor::visit (const ArrayListVar &e)
-{
-    exps_t vars = e.getVars();
-    for (exps_t::const_iterator it = vars.begin (), itEnd = vars.end(); it != itEnd; ++it)
-    {
-        (*it)->mute();
-        (*it)->accept(*this);
-    }
-}
-
-void MuteVisitor::visit (const FieldExp &e)
-{
-    const_cast<Exp*>(e.getHead())->mute();
-    const_cast<Exp*>(e.getTail())->mute();
-
-    e.getHead()->accept(*this);
-    e.getTail()->accept(*this);
-}
-
-void MuteVisitor::visit(const OpExp &e)
-{
-    const_cast<Exp&>(e.getLeft()).mute();
-    const_cast<Exp&>(e.getRight()).mute();
-
-    e.getLeft().accept(*this);
-    e.getRight().accept(*this);
-}
-
-void MuteVisitor::visit(const LogicalOpExp &e)
-{
-    const_cast<Exp&>(e.getLeft()).mute();
-    const_cast<Exp&>(e.getRight()).mute();
-
-    e.getLeft().accept(*this);
-    e.getRight().accept(*this);
-}
-
-void MuteVisitor::visit (const AssignExp  &e)
-{
-    const_cast<Exp&>(e.getLeftExp()).mute();
-    const_cast<Exp&>(e.getRightExp()).mute();
-
-    e.getLeftExp().accept(*this);
-    e.getRightExp().accept(*this);
-}
-
-void MuteVisitor::visit(const CallExp &e)
-{
-    exps_t args = e.getArgs();
-    for (auto arg : args)
-    {
-        arg->mute();
-        arg->accept(*this);
-    }
-}
-
-void MuteVisitor::visit(const CellCallExp &e)
-{
-    exps_t args = e.getArgs();
-    for (auto arg : args)
-    {
-        arg->mute();
-        arg->accept(*this);
-    }
-}
-
-void MuteVisitor::visit (const IfExp  &e)
-{
-    const_cast<Exp&>(e.getTest()).mute();
-    const_cast<Exp&>(e.getThen()).mute();
-    if (e.hasElse())
-    {
-        const_cast<Exp&>(e.getElse()).mute();
-    }
-
-    e.getTest().accept(*this);
-    e.getThen().accept(*this);
-    if (e.hasElse())
-    {
-        e.getElse().accept(*this);
-    }
-}
-
-void MuteVisitor::visit (const TryCatchExp  &e)
-{
-    const_cast<Exp&>(e.getTry()).mute();
-    const_cast<Exp&>(e.getCatch()).mute();
-
-    e.getTry().accept(*this);
-    e.getCatch().accept(*this);
-}
-
-void MuteVisitor::visit (const WhileExp  &e)
-{
-    const_cast<Exp&>(e.getTest()).mute();
-    const_cast<Exp&>(e.getBody()).mute();
-
-    e.getTest().accept(*this);
-    e.getBody().accept(*this);
-}
-
-void MuteVisitor::visit (const ForExp  &e)
-{
-    const_cast<Exp&>(e.getBody()).mute();
-    e.getBody().accept(*this);
-}
-
-void MuteVisitor::visit (const BreakExp &/*e*/)
-{
-}
-
-void MuteVisitor::visit (const ContinueExp &/*e*/)
-{
-}
-
-void MuteVisitor::visit (const ReturnExp &/*e*/)
-{
-}
-
-void MuteVisitor::visit (const SelectExp &/*e*/)
-{
-}
-
-void MuteVisitor::visit (const CaseExp &/*e*/)
-{
-}
-
-void MuteVisitor::visit (const SeqExp  &e)
-{
-    for (exps_t::const_iterator it = e.getExps().begin (), itEnd = e.getExps().end(); it != itEnd; ++it)
-    {
-        (*it)->mute();
-        (*it)->accept(*this);
-    }
-}
-
-void MuteVisitor::visit (const ArrayListExp  &e)
-{
-    for (exps_t::const_iterator it = e.getExps().begin (), itEnd = e.getExps().end(); it != itEnd; ++it)
-    {
-        (*it)->mute();
-        (*it)->accept(*this);
-    }
-}
-
-void MuteVisitor::visit (const AssignListExp  &/*e*/)
-{
-}
-
-void MuteVisitor::visit (const NotExp &/*e*/)
-{
-}
-
-void MuteVisitor::visit (const TransposeExp &/*e*/)
-{
-}
-
-void MuteVisitor::visit (const VarDec  &/*e*/)
-{
-}
-
-void MuteVisitor::visit (const FunctionDec  &e)
-{
-    const_cast<Exp&>(e.getBody()).mute();
-    e.getBody().accept(*this);
-}
-
-void MuteVisitor::visit(const ListExp &/*e*/)
-{
-}
-}
@@ -11,7 +11,7 @@
  *
  */
 
-#include "debugvisitor.hxx"
+#include "prettyprintvisitor.hxx"
 
 #ifdef _MSC_VER
 
@@ -57,7 +57,7 @@ static int level = -1;
 #ifdef _MSC_VER
 std::wostream& operator<<(std::wostream& os, const TermColor& c)
 {
-    if (DebugVisitor::colored == false)
+    if (PrettyPrintVisitor::colored == false)
     {
         return os;
     }
@@ -126,7 +126,7 @@ std::wostream& operator<<(std::wostream& os, const TermColor& c)
 #else
 std::wostream& operator<<(std::wostream& os, const TermColor& c)
 {
-    if (DebugVisitor::colored == false)
+    if (PrettyPrintVisitor::colored == false)
     {
         return os;
     }
@@ -167,21 +167,21 @@ std::wostream& operator<<(std::wostream& os, const TermColor& c)
 
 #endif
 
-bool DebugVisitor::colored = false;
+bool PrettyPrintVisitor::colored = false;
 
-void DebugVisitor::START_NODE(const ast::Ast & e)
+void PrettyPrintVisitor::START_NODE(const ast::Ast & e)
 {
     *ostr << NORMAL << L"(" << e.getNodeNumber() << L") ";
     ++level;
 }
 
-void DebugVisitor::END_NODE(void)
+void PrettyPrintVisitor::END_NODE(void)
 {
     --level;
     *ostr << RESET;
 }
 
-void DebugVisitor::print(const TermColor& c, const std::wstring & str)
+void PrettyPrintVisitor::print(const TermColor& c, const std::wstring & str)
 {
     for (int i = 0 ; i < level; ++i)
     {
@@ -194,13 +194,13 @@ void DebugVisitor::print(const TermColor& c, const std::wstring & str)
     *ostr << str << std::endl;
 }
 
-void DebugVisitor::print(const Location & loc)
+void PrettyPrintVisitor::print(const Location & loc)
 {
     *ostr << L"@(" << YELLOW << loc.first_line << L"." << BLUE << loc.first_column << NORMAL << L" -> "
           << YELLOW << loc.last_line << L"." << BLUE << loc.last_column << NORMAL << L")";
 }
 
-void DebugVisitor::print(const TermColor& cpre, const std::wstring & pre, const Location & loc, const TermColor& cpost, const std::wstring & post, const TermColor& cdeco, const std::wstring & deco)
+void PrettyPrintVisitor::print(const TermColor& cpre, const std::wstring & pre, const Location & loc, const TermColor& cpost, const std::wstring & post, const TermColor& cdeco, const std::wstring & deco)
 {
     for (int i = 0 ; i < level; ++i)
     {
@@ -225,7 +225,7 @@ void DebugVisitor::print(const TermColor& cpre, const std::wstring & pre, const
     *ostr << std::endl;
 }
 
-void DebugVisitor::print(const TermColor& c, const std::wstring & str, const Exp & e)
+void PrettyPrintVisitor::print(const TermColor& c, const std::wstring & str, const Exp & e)
 {
     std::wstring expType;
     expType = e.getTypeString();
@@ -242,12 +242,12 @@ void DebugVisitor::print(const TermColor& c, const std::wstring & str, const Exp
     }
 }
 
-void DebugVisitor::print(const Exp & e)
+void PrettyPrintVisitor::print(const Exp & e)
 {
     print(NORMAL, L"", e);
 }
 
-void DebugVisitor::visit(const MatrixExp & e)
+void PrettyPrintVisitor::visit(const MatrixExp & e)
 {
     START_NODE(e);
     print(e);
@@ -259,7 +259,7 @@ void DebugVisitor::visit(const MatrixExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const MatrixLineExp & e)
+void PrettyPrintVisitor::visit(const MatrixLineExp & e)
 {
     START_NODE(e);
     print(e);
@@ -271,7 +271,7 @@ void DebugVisitor::visit(const MatrixLineExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const CellExp & e)
+void PrettyPrintVisitor::visit(const CellExp & e)
 {
     START_NODE(e);
     print(e);
@@ -283,7 +283,7 @@ void DebugVisitor::visit(const CellExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const StringExp & e)
+void PrettyPrintVisitor::visit(const StringExp & e)
 {
     START_NODE(e);
     std::wostringstream stream;
@@ -300,14 +300,14 @@ void DebugVisitor::visit(const StringExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const CommentExp & e)
+void PrettyPrintVisitor::visit(const CommentExp & e)
 {
     START_NODE(e);
     print(GREEN, e.getComment(), e);
     END_NODE();
 }
 
-void DebugVisitor::visit(const DoubleExp & e)
+void PrettyPrintVisitor::visit(const DoubleExp & e)
 {
     START_NODE(e);
     std::wostringstream stream;
@@ -335,7 +335,7 @@ void DebugVisitor::visit(const DoubleExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const BoolExp & e)
+void PrettyPrintVisitor::visit(const BoolExp & e)
 {
     START_NODE(e);
     std::wostringstream stream;
@@ -352,14 +352,14 @@ void DebugVisitor::visit(const BoolExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const NilExp & e)
+void PrettyPrintVisitor::visit(const NilExp & e)
 {
     START_NODE(e);
     print(e);
     END_NODE();
 }
 
-void DebugVisitor::visit(const SimpleVar & e)
+void PrettyPrintVisitor::visit(const SimpleVar & e)
 {
     START_NODE(e);
     std::wstring str;
@@ -386,21 +386,21 @@ void DebugVisitor::visit(const SimpleVar & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const ColonVar & e)
+void PrettyPrintVisitor::visit(const ColonVar & e)
 {
     START_NODE(e);
     print(e);
     END_NODE();
 }
 
-void DebugVisitor::visit(const DollarVar & e)
+void PrettyPrintVisitor::visit(const DollarVar & e)
 {
     START_NODE(e);
     print(e);
     END_NODE();
 }
 
-void DebugVisitor::visit(const ArrayListVar & e)
+void PrettyPrintVisitor::visit(const ArrayListVar & e)
 {
     START_NODE(e);
     print(e);
@@ -412,7 +412,7 @@ void DebugVisitor::visit(const ArrayListVar & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const FieldExp & e)
+void PrettyPrintVisitor::visit(const FieldExp & e)
 {
     START_NODE(e);
     print(e);
@@ -421,7 +421,7 @@ void DebugVisitor::visit(const FieldExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const OpExp & e)
+void PrettyPrintVisitor::visit(const OpExp & e)
 {
     START_NODE(e);
     print(e);
@@ -430,7 +430,7 @@ void DebugVisitor::visit(const OpExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const LogicalOpExp & e)
+void PrettyPrintVisitor::visit(const LogicalOpExp & e)
 {
     START_NODE(e);
     print(e);
@@ -439,7 +439,7 @@ void DebugVisitor::visit(const LogicalOpExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const AssignExp & e)
+void PrettyPrintVisitor::visit(const AssignExp & e)
 {
     START_NODE(e);
     print(e);
@@ -448,7 +448,7 @@ void DebugVisitor::visit(const AssignExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const CellCallExp & e)
+void PrettyPrintVisitor::visit(const CellCallExp & e)
 {
     START_NODE(e);
     print(e);
@@ -463,7 +463,7 @@ void DebugVisitor::visit(const CellCallExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const CallExp & e)
+void PrettyPrintVisitor::visit(const CallExp & e)
 {
     START_NODE(e);
     print(e);
@@ -478,7 +478,7 @@ void DebugVisitor::visit(const CallExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const IfExp & e)
+void PrettyPrintVisitor::visit(const IfExp & e)
 {
     START_NODE(e);
     print(e);
@@ -491,7 +491,7 @@ void DebugVisitor::visit(const IfExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const TryCatchExp & e)
+void PrettyPrintVisitor::visit(const TryCatchExp & e)
 {
     START_NODE(e);
     print(e);
@@ -500,7 +500,7 @@ void DebugVisitor::visit(const TryCatchExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const WhileExp & e)
+void PrettyPrintVisitor::visit(const WhileExp & e)
 {
     START_NODE(e);
     print(e);
@@ -509,7 +509,7 @@ void DebugVisitor::visit(const WhileExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const ForExp & e)
+void PrettyPrintVisitor::visit(const ForExp & e)
 {
     START_NODE(e);
     print(e);
@@ -518,21 +518,21 @@ void DebugVisitor::visit(const ForExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const ContinueExp & e)
+void PrettyPrintVisitor::visit(const ContinueExp & e)
 {
     START_NODE(e);
     print(e);
     END_NODE();
 }
 
-void DebugVisitor::visit(const BreakExp & e)
+void PrettyPrintVisitor::visit(const BreakExp & e)
 {
     START_NODE(e);
     print(e);
     END_NODE();
 }
 
-void DebugVisitor::visit(const ReturnExp & e)
+void PrettyPrintVisitor::visit(const ReturnExp & e)
 {
     START_NODE(e);
     print(e);
@@ -543,7 +543,7 @@ void DebugVisitor::visit(const ReturnExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const SelectExp & e)
+void PrettyPrintVisitor::visit(const SelectExp & e)
 {
     START_NODE(e);
     print(e);
@@ -562,7 +562,7 @@ void DebugVisitor::visit(const SelectExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const CaseExp & e)
+void PrettyPrintVisitor::visit(const CaseExp & e)
 {
     START_NODE(e);
     print(e);
@@ -571,7 +571,7 @@ void DebugVisitor::visit(const CaseExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const SeqExp & e)
+void PrettyPrintVisitor::visit(const SeqExp & e)
 {
     START_NODE(e);
     print(e);
@@ -582,7 +582,7 @@ void DebugVisitor::visit(const SeqExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const ArrayListExp & e)
+void PrettyPrintVisitor::visit(const ArrayListExp & e)
 {
     START_NODE(e);
     print(e);
@@ -593,7 +593,7 @@ void DebugVisitor::visit(const ArrayListExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const AssignListExp & e)
+void PrettyPrintVisitor::visit(const AssignListExp & e)
 {
     START_NODE(e);
     print(e);
@@ -604,7 +604,7 @@ void DebugVisitor::visit(const AssignListExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const NotExp & e)
+void PrettyPrintVisitor::visit(const NotExp & e)
 {
     START_NODE(e);
     print(e);
@@ -612,7 +612,7 @@ void DebugVisitor::visit(const NotExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const TransposeExp & e)
+void PrettyPrintVisitor::visit(const TransposeExp & e)
 {
     START_NODE(e);
     print(e);
@@ -620,7 +620,7 @@ void DebugVisitor::visit(const TransposeExp & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const VarDec & e)
+void PrettyPrintVisitor::visit(const VarDec & e)
 {
     std::wstring sym, name;
     sym = L"Symbol";
@@ -635,7 +635,7 @@ void DebugVisitor::visit(const VarDec & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const FunctionDec & e)
+void PrettyPrintVisitor::visit(const FunctionDec & e)
 {
     START_NODE(e);
     print(e);
@@ -656,7 +656,7 @@ void DebugVisitor::visit(const FunctionDec & e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const ListExp &e)
+void PrettyPrintVisitor::visit(const ListExp &e)
 {
     START_NODE(e);
     print(e);
@@ -666,12 +666,12 @@ void DebugVisitor::visit(const ListExp &e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const OptimizedExp &e)
+void PrettyPrintVisitor::visit(const OptimizedExp &e)
 {
     e.getOriginal()->accept(*this);
 }
 
-void DebugVisitor::visit(const MemfillExp &e)
+void PrettyPrintVisitor::visit(const MemfillExp &e)
 {
     START_NODE(e);
     print(e);
@@ -686,7 +686,7 @@ void DebugVisitor::visit(const MemfillExp &e)
     END_NODE();
 }
 
-void DebugVisitor::visit(const DAXPYExp &e)
+void PrettyPrintVisitor::visit(const DAXPYExp &e)
 {
     START_NODE(e);
     print(e);
@@ -698,12 +698,12 @@ void DebugVisitor::visit(const DAXPYExp &e)
     //e.getOriginal()->accept(*this);
 }
 
-void DebugVisitor::visit(const IntSelectExp & e)
+void PrettyPrintVisitor::visit(const IntSelectExp & e)
 {
     e.getOriginal()->accept(*this);
 }
 
-void DebugVisitor::visit(const StringSelectExp & e)
+void PrettyPrintVisitor::visit(const StringSelectExp & e)
 {
     e.getOriginal()->accept(*this);
 }
index 4763b4e..7e6e80b 100644 (file)
@@ -644,6 +644,12 @@ void PrintVisitor::visit (const IfExp  &e)
     }
     *ostr << SCI_CLOSE_TEST << " ";
     *ostr << SCI_THEN << std::endl;
+
+    if (headerOnly)
+    {
+        return;
+    }
+
     ++indent;
     if (displayOriginal)
     {
@@ -676,6 +682,12 @@ void PrintVisitor::visit (const IfExp  &e)
 void PrintVisitor::visit (const TryCatchExp  &e)
 {
     *ostr << SCI_TRY << std::endl;
+
+    if (headerOnly)
+    {
+        return;
+    }
+
     ++indent;
     if (displayOriginal)
     {
@@ -715,6 +727,12 @@ void PrintVisitor::visit (const WhileExp  &e)
         e.getTest().accept(*this);
     }
     *ostr << SCI_CLOSE_TEST << " " << SCI_DO << std::endl;
+
+    if (headerOnly)
+    {
+        return;
+    }
+
     ++indent;
     if (displayOriginal)
     {
@@ -743,6 +761,12 @@ void PrintVisitor::visit (const ForExp  &e)
     }
     *ostr << SCI_CLOSE_TEST << " ";
     *ostr << SCI_DO << std::endl;
+
+    if (headerOnly)
+    {
+        return;
+    }
+
     ++indent;
     if (displayOriginal)
     {
index d0eedcc..996315f 100644 (file)
@@ -197,7 +197,7 @@ void RunVisitorT<T>::visitprivate(const CallExp &e)
                 }
                 else
                 {
-                    ret = pIT->invoke(in, opt, iRetCount, out, *this, e);
+                    ret = pIT->invoke(in, opt, iRetCount, out, e);
                     if(ret == false && pIT->isUserType())
                     {
                         // call overload
@@ -213,7 +213,7 @@ void RunVisitorT<T>::visitprivate(const CallExp &e)
                         if(pIT->isCallable())
                         {
                             char* strFName = wide_string_to_UTF8(pIT->getAs<types::Callable>()->getName().c_str());
-                            os_sprintf(szError,  _("%s: Wrong number of output argument(s): %d expected.\n"), strFName, out.size());
+                            os_sprintf(szError, _("%s: Wrong number of output argument(s): %d expected.\n"), strFName, out.size());
                             FREE(strFName);
                         }
                         else
index eb8d235..c2790d6 100644 (file)
@@ -417,11 +417,11 @@ types::InternalType* RunVisitorT<T>::callOverloadMatrixExp(const std::wstring& s
     {
         if (_paramR->isGenericType() && _paramR->getAs<types::GenericType>()->getDims() > 2)
         {
-            Ret = Overload::call(L"%hm_" + strType + L"_hm", in, 1, out, this, true);
+            Ret = Overload::call(L"%hm_" + strType + L"_hm", in, 1, out, true);
         }
         else
         {
-            Ret = Overload::call(L"%" + _paramL->getAs<types::List>()->getShortTypeStr() + L"_" + strType + L"_" + _paramR->getAs<types::List>()->getShortTypeStr(), in, 1, out, this, true);
+            Ret = Overload::call(L"%" + _paramL->getAs<types::List>()->getShortTypeStr() + L"_" + strType + L"_" + _paramR->getAs<types::List>()->getShortTypeStr(), in, 1, out, true);
         }
     }
     catch (const InternalError& error)
index cfdfbec..f2e64a1 100644 (file)
@@ -368,7 +368,7 @@ types::InternalType* RunVisitorT<T>::callOverloadOpExp(OpExp::Oper _oper, types:
         in.push_back(_paramR);
         try
         {
-            Overload::generateNameAndCall(Overload::getNameFromOper(_oper), in, 1, out, this, true);
+            Overload::generateNameAndCall(Overload::getNameFromOper(_oper), in, 1, out, true);
         }
         catch (const ast::InternalError& e)
         {
@@ -387,7 +387,7 @@ types::InternalType* RunVisitorT<T>::callOverloadOpExp(OpExp::Oper _oper, types:
 
     try
     {
-        Overload::generateNameAndCall(Overload::getNameFromOper(_oper), in, 1, out, this, true);
+        Overload::generateNameAndCall(Overload::getNameFromOper(_oper), in, 1, out, true);
     }
     catch (const ast::InternalError& e)
     {
index f80a304..51d46af 100644 (file)
 
 #include <string>
 
-#include "runvisitor.hxx"
 #include "execvisitor.hxx"
 #include "stepvisitor.hxx"
 #include "timedvisitor.hxx"
 #include "shortcutvisitor.hxx"
 #include "printvisitor.hxx"
-#include "mutevisitor.hxx"
 //#include "AnalysisVisitor.hxx"
+#include "debuggervisitor.hxx"
+#include "debugmanager.hxx"
 
 #include "visitor_common.hxx"
 
@@ -37,6 +37,7 @@
 
 #include "macrofile.hxx"
 #include "macro.hxx"
+#include "cell.hxx"
 #include "filemanager_interface.h"
 
 #include "runner.hxx"
@@ -609,6 +610,12 @@ void RunVisitorT<T>::visitprivate(const ReturnExp &e)
 {
     if (e.isGlobal())
     {
+        if (ConfigVariable::getEnableDebug() == true)
+        {
+            sciprint(_("%s: function is disable in debug mode.\n"), "resume");
+            return;
+        }
+
         if (ConfigVariable::getPauseLevel() != 0 && symbol::Context::getInstance()->getScopeLevel() == ConfigVariable::getActivePauseLevel())
         {
             //return or resume
@@ -964,7 +971,7 @@ void RunVisitorT<T>::visitprivate(const SeqExp  &e)
                         int iSaveExpectedSize = getExpectedSize();
                         setExpectedSize(1);
 
-                        pCall->invoke(in, opt, getExpectedSize(), out, *this, e);
+                        pCall->invoke(in, opt, getExpectedSize(), out, e);
                         setExpectedSize(iSaveExpectedSize);
 
                         if (out.size() == 0)
@@ -1334,7 +1341,7 @@ void RunVisitorT<T>::visitprivate(const ListExp &e)
             in.push_back(piStep);
             piEnd->IncreaseRef();
             in.push_back(piEnd);
-            Ret = Overload::call(L"%" + piStart->getShortTypeStr() + L"_b_" + piStep->getShortTypeStr(), in, 1, out, this, true);
+            Ret = Overload::call(L"%" + piStart->getShortTypeStr() + L"_b_" + piStep->getShortTypeStr(), in, 1, out, true);
         }
         else
         {
@@ -1343,7 +1350,7 @@ void RunVisitorT<T>::visitprivate(const ListExp &e)
             piStep->killMe();
             piEnd->IncreaseRef();
             in.push_back(piEnd);
-            Ret = Overload::call(L"%" + piStart->getShortTypeStr() + L"_b_" + piEnd->getShortTypeStr(), in, 1, out, this, true);
+            Ret = Overload::call(L"%" + piStart->getShortTypeStr() + L"_b_" + piEnd->getShortTypeStr(), in, 1, out, true);
         }
     }
     catch (const InternalError& error)
@@ -1564,3 +1571,4 @@ void RunVisitorT<T>::visitprivate(const DAXPYExp &e)
 template EXTERN_AST class ast::RunVisitorT<ast::ExecVisitor>;
 template EXTERN_AST class ast::RunVisitorT<ast::StepVisitor>;
 template EXTERN_AST class ast::RunVisitorT<ast::TimedVisitor>;
+template EXTERN_AST class ast::RunVisitorT<ast::DebuggerVisitor>;
index c999734..9d195f6 100644 (file)
@@ -1832,14 +1832,13 @@ types::InternalType* insertionCall(const ast::Exp& e, types::typed_list* _pArgs,
                     types::typed_list in;
                     types::typed_list out;
                     types::optional_list opt;
-                    ast::ExecVisitor exec;
 
                     in.push_back(pH);
                     in.push_back(pS);
                     in.push_back(_pInsert);
 
                     types::Function* pCall = (types::Function*)symbol::Context::getInstance()->get(symbol::Symbol(L"set"));
-                    types::Callable::ReturnValue ret = pCall->call(in, opt, 1, out, &exec);
+                    types::Callable::ReturnValue ret = pCall->call(in, opt, 1, out);
                     if (ret == types::Callable::OK)
                     {
                         pOut = _pVar;
@@ -2358,7 +2357,6 @@ types::InternalType* insertionCall(const ast::Exp& e, types::typed_list* _pArgs,
                 types::typed_list in;
                 types::typed_list out;
                 types::optional_list opt;
-                ast::ExecVisitor exec;
 
                 in.push_back(pH);
                 in.push_back(pS);
@@ -2367,7 +2365,7 @@ types::InternalType* insertionCall(const ast::Exp& e, types::typed_list* _pArgs,
                 types::Function* pCall = (types::Function*)symbol::Context::getInstance()->get(symbol::Symbol(L"set"));
                 if (pCall)
                 {
-                    types::Callable::ReturnValue ret = pCall->call(in, opt, 1, out, &exec);
+                    types::Callable::ReturnValue ret = pCall->call(in, opt, 1, out);
                     if (ret == types::Callable::OK)
                     {
                         pRet = _pVar;
index b3847a5..8a3993b 100644 (file)
@@ -11,6 +11,7 @@
  *
  */
 
+#include <algorithm>
 #include "types_addition.hxx"
 #include "operations.hxx"
 #include "double.hxx"
 
 extern "C"
 {
-#include <stdio.h>
-#include "core_math.h"
 #include "matrix_addition.h"
-#include "localization.h"
-#include "charEncoding.h"
-#include "os_string.h"
 #include "elem_common.h" //dset
 }
 
index c992d50..2489a47 100644 (file)
@@ -11,7 +11,7 @@
 *
 */
 
-#include <stdio.h>
+#include <algorithm>
 
 #include "types_subtraction.hxx"
 #include "types_opposite.hxx"
index 4379a91..33c64ea 100644 (file)
@@ -176,6 +176,7 @@ void ParserSingleInstance::parse(const char *command)
     if (fileLocker)
     {
         fclose(fileLocker);
+        fileLocker = nullptr;
     }
 
     errno_t err;
@@ -205,6 +206,7 @@ void ParserSingleInstance::parse(const char *command)
     if (fileLocker)
     {
         fclose(fileLocker);
+        fileLocker = nullptr;
     }
     yyin = fopen(szFile, "w");
     fwrite(command, 1, len, yyin);
@@ -281,6 +283,20 @@ void ParserSingleInstance::disableParseTrace(void)
     yydebug = 0;
 }
 
+void Parser::releaseTmpFile()
+{
+    ParserSingleInstance::releaseTmpFile();
+}
+
+void ParserSingleInstance::releaseTmpFile()
+{
+    if (fileLocker)
+    {
+        //fclose(fileLocker);
+        //fileLocker = nullptr;
+    }
+}
+
 std::wstring ParserSingleInstance::_file_name;
 std::wstring ParserSingleInstance::_prog_name;
 std::wstring ParserSingleInstance::_error_message;
index bae82ed..3d3b9ad 100644 (file)
@@ -10,6 +10,7 @@
 *
 */
 
+#include <algorithm>
 #include "libraries.hxx"
 
 namespace symbol
index d83e269..77aeade 100644 (file)
@@ -10,6 +10,7 @@
 *
 */
 
+#include <algorithm>
 #include "variables.hxx"
 
 namespace symbol
index 0da2750..6891e8b 100644 (file)
 #include "configvariable.hxx"
 #include "macrofile.hxx"
 #include "threadmanagement.hxx"
+#include "execvisitor.hxx"
+#include "threadId.hxx"
+#include "cell.hxx"
+#include "callable.hxx"
 
 extern "C"
 {
@@ -1102,8 +1106,8 @@ int ConfigVariable::getFuncprot()
 ** \{
 */
 
-std::vector<ConfigVariable::WhereEntry> ConfigVariable::m_Where;
-std::vector<ConfigVariable::WhereEntry> ConfigVariable::m_WhereError;
+ConfigVariable::WhereVector ConfigVariable::m_Where;
+ConfigVariable::WhereVector ConfigVariable::m_WhereError;
 std::vector<int> ConfigVariable::m_FirstMacroLine;
 void ConfigVariable::where_begin(int _iLineNum, int _iLineLocation, types::Callable* _pCall)
 {
@@ -1129,7 +1133,7 @@ void ConfigVariable::where_end()
     m_Where.pop_back();
 }
 
-const std::vector<ConfigVariable::WhereEntry>& ConfigVariable::getWhere()
+const ConfigVariable::WhereVector& ConfigVariable::getWhere()
 {
     return m_Where;
 }
@@ -1178,7 +1182,7 @@ void ConfigVariable::whereErrorToString(std::wostringstream &ostr)
             continue;
         }
 
-        iLenName = (std::max)((int)where.m_name.length(), iLenName);
+        iLenName = std::max((int)where.m_name.length(), iLenName);
 
         // in case of bin file, the file path and line is displayed only if the associated .sci file exists
         if (where.m_file_name != L"" && where.m_file_name.find(L".bin") != std::wstring::npos)
@@ -1203,15 +1207,15 @@ void ConfigVariable::whereErrorToString(std::wostringstream &ostr)
 
     // compute max size between "at line xxx of function" and "in builtin "
     // +1 : line number is pad to 5. length of "% 5d" + 1 == 5
-    int iMaxLen = (std::max)(wstrAtLine.length() + 1, wstrBuiltin.length());
+    int iMaxLen = std::max(wstrAtLine.length() + 1, wstrBuiltin.length());
     if (isExecstr)
     {
-        iMaxLen = (std::max)(((int)wstrExecStr.length()) + 1, iMaxLen);
+        iMaxLen = std::max(((int)wstrExecStr.length()) + 1, iMaxLen);
     }
 
     if (isExecstr)
     {
-        iMaxLen = (std::max)(((int)wstrExecFile.length()) + 1, iMaxLen);
+        iMaxLen = std::max(((int)wstrExecFile.length()) + 1, iMaxLen);
     }
 
     // print call stack
@@ -1443,3 +1447,36 @@ int ConfigVariable::isScilabCommand()
 /*
 ** \}
 */
+
+//debugger information
+bool ConfigVariable::m_bEnabledebug = false;
+ast::ConstVisitor* ConfigVariable::m_defaultvisitor = NULL;
+
+bool ConfigVariable::getEnableDebug()
+{
+    return m_bEnabledebug;
+}
+
+void ConfigVariable::setEnableDebug(bool _enable)
+{
+    m_bEnabledebug = _enable;
+}
+
+void ConfigVariable::setDefaultVisitor(ast::ConstVisitor* _default)
+{
+    if (m_defaultvisitor)
+    {
+        delete m_defaultvisitor;
+    }
+
+    m_defaultvisitor = _default;
+}
+
+ast::ConstVisitor* ConfigVariable::getDefaultVisitor()
+{
+    if (m_defaultvisitor == NULL)
+    {
+        m_defaultvisitor = new ast::ExecVisitor();
+    }
+    return m_defaultvisitor->clone();
+}
index f309d4d..dd99fb0 100644 (file)
@@ -11,6 +11,7 @@
 */
 
 #include "configvariable.hxx"
+#include "debugmanager.hxx"
 
 extern "C"
 {
@@ -148,28 +149,17 @@ const char * getScilabModeString(void)
 
 int getWarningMode(void)
 {
-    if (ConfigVariable::getWarningMode())
-    {
-        return 1;
-    }
-    return 0;
+    return ConfigVariable::getWarningMode() ? 1 : 0;
 }
 
 void setWarningMode(int _iMode)
 {
-    if (_iMode == 0)
-    {
-        ConfigVariable::setWarningMode(false);
-    }
-    else
-    {
-        ConfigVariable::setWarningMode(true);
-    }
+    ConfigVariable::setWarningMode(_iMode != 0);
 }
 
 int checkReferenceModule(const wchar_t* _module)
 {
-    return (ConfigVariable::checkReferenceModule(_module) ? 1 : 0);
+    return ConfigVariable::checkReferenceModule(_module) ? 1 : 0;
 }
 
 void addReferenceModule(const wchar_t* _module)
@@ -196,3 +186,13 @@ int getForceQuit()
 {
     return ConfigVariable::getForceQuit();
 }
+
+int isEnableDebug()
+{
+    return ConfigVariable::getEnableDebug() ? 1 : 0;
+}
+
+int isDebugInterrupted()
+{
+    return debugger::DebuggerMagager::getInstance()->isInterrupted() ? 1 : 0;
+}
index b005da4..c08a4c0 100644 (file)
@@ -1,18 +1,19 @@
 /*
- *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- *  Copyright (C) 2010 - DIGITEO - Antoine ELIAS
- *
- *  This file must be used under the terms of the CeCILL.
- *  This source file is licensed as described in the file COPYING, which
- *  you should have received as part of this distribution.  The terms
- *  are also available at
- *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
+*  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+*  Copyright (C) 2010 - DIGITEO - Antoine ELIAS
+*
+*  This file must be used under the terms of the CeCILL.
+*  This source file is licensed as described in the file COPYING, which
+*  you should have received as part of this distribution.  The terms
+*  are also available at
+*  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+*
+*/
 
 #include "configvariable.hxx"
 #include "string.hxx"
 #include "context.hxx"
+#include "parser.hxx"
 
 extern "C"
 {
@@ -147,7 +148,7 @@ char* computeTMPDIR()
         static wchar_t bufenv[PATH_MAX + 16];
         char *TmpDir = NULL;
         os_swprintf(wctmp_dir, PATH_MAX + FILENAME_MAX + 1, L"%lsSCI_TMP_%d_", wcTmpDirDefault, _getpid());
-        if ( CreateDirectoryW(wctmp_dir, NULL) == FALSE)
+        if (CreateDirectoryW(wctmp_dir, NULL) == FALSE)
         {
             DWORD attribs = GetFileAttributesW(wctmp_dir);
             if (attribs & FILE_ATTRIBUTE_DIRECTORY)
@@ -204,7 +205,7 @@ char* computeTMPDIR()
 
     /* XXXXXX will be randomized by mkdtemp */
     char *env_dir_strdup = os_strdup(env_dir); /* Copy to avoid to have the same buffer as input and output for sprintf */
-    sprintf(env_dir, "%s/SCI_TMP_%d_XXXXXX", env_dir_strdup, (int) getpid());
+    sprintf(env_dir, "%s/SCI_TMP_%d_XXXXXX", env_dir_strdup, (int)getpid());
     free(env_dir_strdup);
 
     if (mkdtemp(env_dir) == NULL)
@@ -228,6 +229,9 @@ void defineTMPDIR()
 void clearTMPDIR()
 {
     char * tmpdir = getTMPDIR();
+    Parser parser;
+    parser.releaseTmpFile();
     removedir(tmpdir);
     FREE(tmpdir);
 }
+
index 74a5ba5..26c8956 100644 (file)
@@ -1617,7 +1617,7 @@ bool ArrayOf<T>::neg(InternalType *& out)
 }
 
 template<typename T>
-bool ArrayOf<T>::invoke(typed_list & in, optional_list & /*opt*/, int /*_iRetCount*/, typed_list & out, ast::ConstVisitor & /*execFunc*/, const ast::Exp & e)
+bool ArrayOf<T>::invoke(typed_list & in, optional_list & /*opt*/, int /*_iRetCount*/, typed_list & out, const ast::Exp & e)
 {
     if (in.size() == 0)
     {
index 7c6fe95..6905f82 100644 (file)
 #include "callable.hxx"
 #include "configvariable.hxx"
 #include "exp.hxx"
+#include "scilabexception.hxx"
 
 namespace types
 {
 
-bool Callable::invoke(typed_list & in, optional_list & opt, int _iRetCount, typed_list & out, ast::ConstVisitor & execFunc, const ast::Exp & e)
+bool Callable::invoke(typed_list & in, optional_list & opt, int _iRetCount, typed_list & out, const ast::Exp & e)
 {
     //reset previous error before call function
     ConfigVariable::resetError();
@@ -32,7 +33,7 @@ bool Callable::invoke(typed_list & in, optional_list & opt, int _iRetCount, type
 
     try
     {
-        Ret = call(in, opt, _iRetCount, out, &execFunc);
+        Ret = call(in, opt, _iRetCount, out);
         ConfigVariable::where_end();
     }
     catch (ast::InternalError & ie)
index 472c308..96cb9a2 100644 (file)
@@ -11,6 +11,7 @@
 *
 */
 
+#include <algorithm>
 #include <sstream>
 #include <math.h>
 #include "symbol.hxx"
index 4e13f50..705fa35 100644 (file)
@@ -11,6 +11,7 @@
  *
  */
 
+#include <algorithm>
 #include <sstream>
 #include <vector>
 #include "function.hxx"
@@ -98,7 +99,7 @@ Function::~Function()
 }
 
 
-Function::ReturnValue Function::call(typed_list &in, optional_list &/*opt*/, int _iRetCount, typed_list &out, ast::ConstVisitor* /*execFunc*/)
+Function::ReturnValue Function::call(typed_list &in, optional_list &/*opt*/, int _iRetCount, typed_list &out)
 {
     int ret = 1;
     if (m_pLoadDeps != NULL)
@@ -152,7 +153,7 @@ InternalType* OptFunction::clone()
     return new OptFunction(this);
 }
 
-Function::ReturnValue OptFunction::call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* /*execFunc*/)
+Function::ReturnValue OptFunction::call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out)
 {
     int ret = 1;
     if (m_pLoadDeps != NULL)
@@ -189,7 +190,7 @@ InternalType* WrapFunction::clone()
     return new WrapFunction(this);
 }
 
-Function::ReturnValue WrapFunction::call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc)
+Function::ReturnValue WrapFunction::call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out)
 {
     int ret = 1;
     if (m_pLoadDeps != NULL)
@@ -232,7 +233,6 @@ Function::ReturnValue WrapFunction::call(typed_list &in, optional_list &opt, int
     gStr.m_pOut = tmpOut;
     gStr.m_piRetCount = &_iRetCount;
     gStr.m_pstName = wide_string_to_UTF8(m_wstName.c_str());
-    gStr.m_pVisitor = execFunc;
     // we should use a stack array of the max size to avoid dynamic alloc.
     std::vector<int> outOrder(_iRetCount < 1 ? 1 : _iRetCount, -1);
     gStr.m_pOutOrder = &outOrder[0];
@@ -347,7 +347,7 @@ InternalType* WrapMexFunction::clone()
     return new WrapMexFunction(this);
 }
 
-Function::ReturnValue WrapMexFunction::call(typed_list &in, optional_list &/*opt*/, int _iRetCount, typed_list &out, ast::ConstVisitor* /*execFunc*/)
+Function::ReturnValue WrapMexFunction::call(typed_list &in, optional_list &/*opt*/, int _iRetCount, typed_list &out)
 {
     int ret = 1;
     if (m_pLoadDeps != NULL)
@@ -438,7 +438,7 @@ DynamicFunction::DynamicFunction(const std::wstring& _wstName, const std::wstrin
     m_pFunction             = NULL;
 }
 
-Function::ReturnValue DynamicFunction::call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc)
+Function::ReturnValue DynamicFunction::call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out)
 {
     if (m_pFunction == NULL)
     {
@@ -449,7 +449,7 @@ Function::ReturnValue DynamicFunction::call(typed_list &in, optional_list &opt,
     }
 
     /*call function*/
-    if (m_pFunction->call(in, opt, _iRetCount, out, execFunc) != OK)
+    if (m_pFunction->call(in, opt, _iRetCount, out) != OK)
     {
         return Error;
     }
index 2f6203d..5bdaa5b 100644 (file)
@@ -139,9 +139,8 @@ bool GraphicHandle::subMatrixToString(std::wostringstream& /*ostr*/, int* /*_piD
     //InternalType* pIT = (InternalType*)context_get(L"%h_p");
     //if(pIT->isFunction())
     //{
-    //    ast::ExecVisitor execCall;
     //    Function* pCall = (Function*)pIT;
-    //    pCall->call(in, 1, out, &execCall);
+    //    pCall->call(in, 1, out);
     //}
 
     return true;
@@ -178,7 +177,7 @@ long long* GraphicHandle::allocData(int _iSize)
     return new long long[_iSize];
 }
 
-bool GraphicHandle::invoke(typed_list & in, optional_list & opt, int _iRetCount, typed_list & out, ast::ConstVisitor & execFunc, const ast::Exp & e)
+bool GraphicHandle::invoke(typed_list & in, optional_list & opt, int _iRetCount, typed_list & out, const ast::Exp & e)
 {
     if (in.size() == 0)
     {
@@ -189,11 +188,11 @@ bool GraphicHandle::invoke(typed_list & in, optional_list & opt, int _iRetCount,
         this->IncreaseRef();
         in.push_back(this);
 
-        Overload::call(L"%h_e", in, 1, out, &execFunc);
+        Overload::call(L"%h_e", in, 1, out);
     }
     else
     {
-        return ArrayOf<long long>::invoke(in, opt, _iRetCount, out, execFunc, e);
+        return ArrayOf<long long>::invoke(in, opt, _iRetCount, out, e);
     }
 
     return true;
index 87220f3..8a8b6ce 100644 (file)
@@ -603,7 +603,7 @@ bool ImplicitList::neg(InternalType *& out)
     return false;
 }
 
-bool ImplicitList::invoke(typed_list & in, optional_list & /*opt*/, int /*_iRetCount*/, typed_list & out, ast::ConstVisitor & /*execFunc*/, const ast::Exp & e)
+bool ImplicitList::invoke(typed_list & in, optional_list & /*opt*/, int /*_iRetCount*/, typed_list & out, const ast::Exp & e)
 {
     if (in.size() == 0)
     {
index 2ef88b7..3f08b35 100644 (file)
@@ -68,7 +68,7 @@ bool InternalType::isFieldExtractionOverloadable() const
     return false;
 }
 
-bool InternalType::invoke(typed_list & /*in*/, optional_list & /*opt*/, int /*_iRetCount*/, typed_list & /*out*/, ast::ConstVisitor & /*execFunc*/, const ast::Exp & /*e*/)
+bool InternalType::invoke(typed_list & /*in*/, optional_list & /*opt*/, int /*_iRetCount*/, typed_list & /*out*/, const ast::Exp & /*e*/)
 {
     return false;
 }
index 95be0d8..0dcedcf 100644 (file)
@@ -19,7 +19,6 @@
 #include "symbol.hxx"
 #include "scilabWrite.hxx"
 #include "configvariable.hxx"
-#include "mutevisitor.hxx"
 #include "serializervisitor.hxx"
 
 extern "C"
@@ -166,7 +165,7 @@ bool Macro::toString(std::wostringstream& ostr)
     return true;
 }
 
-Callable::ReturnValue Macro::call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc)
+Callable::ReturnValue Macro::call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out)
 {
     bool bVarargout = false;
     ReturnValue RetVal = Callable::OK;
@@ -310,12 +309,8 @@ Callable::ReturnValue Macro::call(typed_list &in, optional_list &opt, int _iRetC
     int oldVal = ConfigVariable::getPromptMode();
     try
     {
-        //m_body->mute();
-        //MuteVisitor mute;
-        //m_body->accept(mute);
-
         ConfigVariable::setPromptMode(-1);
-        m_body->accept(*execFunc);
+        m_body->accept(*ConfigVariable::getDefaultVisitor());
         //restore previous prompt mode
         ConfigVariable::setPromptMode(oldVal);
     }
index 591360d..15cb8f5 100644 (file)
@@ -61,12 +61,12 @@ bool MacroFile::toString(std::wostringstream& ostr)
     return true;
 }
 
-Callable::ReturnValue MacroFile::call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc)
+Callable::ReturnValue MacroFile::call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out)
 {
     parse();
     if (m_pMacro)
     {
-        return m_pMacro->call(in, opt, _iRetCount, out, execFunc);
+        return m_pMacro->call(in, opt, _iRetCount, out);
     }
     else
     {
index ca37c5f..71a0444 100644 (file)
@@ -23,7 +23,7 @@
 
 namespace types
 {
-bool MList::invoke(typed_list & in, optional_list & /*opt*/, int /*_iRetCount*/, typed_list & out, ast::ConstVisitor & execFunc, const ast::Exp & e)
+bool MList::invoke(typed_list & in, optional_list & /*opt*/, int /*_iRetCount*/, typed_list & out, const ast::Exp & e)
 {
     if (in.size() == 0)
     {
@@ -68,11 +68,11 @@ bool MList::invoke(typed_list & in, optional_list & /*opt*/, int /*_iRetCount*/,
 
     try
     {
-        ret = Overload::call(L"%" + getShortTypeStr() + L"_e", in, 1, out, &execFunc);
+        ret = Overload::call(L"%" + getShortTypeStr() + L"_e", in, 1, out);
     }
     catch (ast::InternalError & /*se*/)
     {
-        ret = Overload::call(L"%l_e", in, 1, out, &execFunc);
+        ret = Overload::call(L"%l_e", in, 1, out);
     }
 
     // Remove this from "in" for keep "in" unchanged.
index 0be9a11..b716224 100644 (file)
@@ -50,19 +50,19 @@ std::wstring Overload::buildOverloadName(const std::wstring& _stFunctionName, ty
     return _stFunctionName;
 }
 
-types::Function::ReturnValue Overload::generateNameAndCall(const std::wstring& _stFunctionName, types::typed_list &in, int _iRetCount, types::typed_list &out, ast::ConstVisitor *_execMe, bool _isOperator)
+types::Function::ReturnValue Overload::generateNameAndCall(const std::wstring& _stFunctionName, types::typed_list &in, int _iRetCount, types::typed_list &out, bool _isOperator)
 {
     std::wstring stFunc = buildOverloadName(_stFunctionName, in, _iRetCount, _isOperator);
     if (symbol::Context::getInstance()->get(symbol::Symbol(stFunc)))
     {
-        return call(stFunc, in, _iRetCount, out, _execMe, _isOperator);
+        return call(stFunc, in, _iRetCount, out, _isOperator);
     }
 
     // if overload doesn't existe try with short name
     std::wstring stFunc2 = buildOverloadName(_stFunctionName, in, _iRetCount, _isOperator, true);
     if (symbol::Context::getInstance()->get(symbol::Symbol(stFunc)))
     {
-        types::Function::ReturnValue ret = call(stFunc, in, _iRetCount, out, _execMe, _isOperator);
+        types::Function::ReturnValue ret = call(stFunc, in, _iRetCount, out, _isOperator);
         if (ret == types::Function::OK && ConfigVariable::getWarningMode())
         {
             char* pstFunc2 = wide_string_to_UTF8(stFunc2.c_str());
@@ -75,10 +75,10 @@ types::Function::ReturnValue Overload::generateNameAndCall(const std::wstring& _
     }
 
     // get exeception with overloading error
-    return call(stFunc, in, _iRetCount, out, _execMe, _isOperator);
+    return call(stFunc, in, _iRetCount, out, _isOperator);
 }
 
-types::Function::ReturnValue Overload::call(const std::wstring& _stOverloadingFunctionName, types::typed_list &in, int _iRetCount, types::typed_list &out, ast::ConstVisitor *_execMe, bool _isOperator)
+types::Function::ReturnValue Overload::call(const std::wstring& _stOverloadingFunctionName, types::typed_list &in, int _iRetCount, types::typed_list &out, bool _isOperator)
 {
     types::InternalType *pIT = symbol::Context::getInstance()->get(symbol::Symbol(_stOverloadingFunctionName));
     types::Callable *pCall = NULL;
@@ -115,15 +115,7 @@ types::Function::ReturnValue Overload::call(const std::wstring& _stOverloadingFu
         ConfigVariable::where_begin(0, 0, pCall);
 
         types::Function::ReturnValue ret;
-        if (_execMe)
-        {
-            ret = pCall->call(in, opt, _iRetCount, out, _execMe);
-        }
-        else
-        {
-            ast::ExecVisitor exec;
-            ret = pCall->call(in, opt, _iRetCount, out, &exec);
-        }
+        ret = pCall->call(in, opt, _iRetCount, out);
 
         // remove function name in where
         ConfigVariable::where_end();
index 3e81923..722be00 100644 (file)
@@ -11,6 +11,7 @@
 */
 
 #include <sstream>
+#include <algorithm>
 #include "core_math.h"
 #include "tostring_common.hxx"
 #include "singlepoly.hxx"
index 2a8feae..35c8045 100644 (file)
@@ -1793,7 +1793,7 @@ Sparse* Sparse::extract(int nbCoords, int SPARSE_CONST* coords, int SPARSE_CONST
     return pSp;
 }
 
-bool Sparse::invoke(typed_list & in, optional_list & /*opt*/, int /*_iRetCount*/, typed_list & out, ast::ConstVisitor & /*execFunc*/, const ast::Exp & e)
+bool Sparse::invoke(typed_list & in, optional_list & /*opt*/, int /*_iRetCount*/, typed_list & out, const ast::Exp & e)
 {
     if (in.size() == 0)
     {
@@ -3719,7 +3719,7 @@ InternalType* SparseBool::extract(typed_list* _pArgs)
     return pOut;
 }
 
-bool SparseBool::invoke(typed_list & in, optional_list &/*opt*/, int /*_iRetCount*/, typed_list & out, ast::ConstVisitor & /*execFunc*/, const ast::Exp & e)
+bool SparseBool::invoke(typed_list & in, optional_list &/*opt*/, int /*_iRetCount*/, typed_list & out, const ast::Exp & e)
 {
     if (in.size() == 0)
     {
index 3a68f3f..35b46ce 100644 (file)
@@ -150,7 +150,7 @@ bool Struct::extract(const std::wstring & name, InternalType *& out)
     return true;
 }
 
-bool Struct::invoke(typed_list & in, optional_list & opt, int _iRetCount, typed_list & out, ast::ConstVisitor & execFunc, const ast::Exp & e)
+bool Struct::invoke(typed_list & in, optional_list & opt, int _iRetCount, typed_list & out, const ast::Exp & e)
 {
     if (in.size() == 0)
     {
@@ -196,7 +196,7 @@ bool Struct::invoke(typed_list & in, optional_list & opt, int _iRetCount, typed_
         }
     }
 
-    return ArrayOf<SingleStruct*>::invoke(in, opt, _iRetCount, out, execFunc, e);
+    return ArrayOf<SingleStruct*>::invoke(in, opt, _iRetCount, out, e);
 }
 
 bool Struct::set(int _iRows, int _iCols, SingleStruct* _pIT)
index a3ef701..808bff3 100644 (file)
 
 #include <cstring>
 #include <sstream>
+#include "exp.hxx"
 #include "string.hxx"
 #include "list.hxx"
 #include "tlist.hxx"
 #include "listundefined.hxx"
 #include "callable.hxx"
+#include "polynom.hxx"
 #include "overload.hxx"
-#include "execvisitor.hxx"
+#include "configvariable.hxx"
 
 #ifndef NDEBUG
 #include "inspector.hxx"
@@ -77,7 +79,7 @@ bool TList::exists(const std::wstring& _sKey)
     return false;
 }
 
-bool TList::invoke(typed_list & in, optional_list & /*opt*/, int _iRetCount, typed_list & out, ast::ConstVisitor & execFunc, const ast::Exp & e)
+bool TList::invoke(typed_list & in, optional_list & /*opt*/, int _iRetCount, typed_list & out, const ast::Exp & e)
 {
     if (in.size() == 0)
     {
@@ -162,7 +164,7 @@ bool TList::invoke(typed_list & in, optional_list & /*opt*/, int _iRetCount, typ
     std::wstring stType = getShortTypeStr();
     try
     {
-        ret = Overload::call(L"%" + stType + L"_e", in, _iRetCount, out, &execFunc);
+        ret = Overload::call(L"%" + stType + L"_e", in, _iRetCount, out);
     }
     catch (const ast::InternalError &ie)
     {
@@ -173,7 +175,7 @@ bool TList::invoke(typed_list & in, optional_list & /*opt*/, int _iRetCount, typ
             if (stType.size() > 8)
             {
                 std::wcout << (L"%" + stType.substr(0, 8) + L"_e") << std::endl;
-                ret = Overload::call(L"%" + stType.substr(0, 8) + L"_e", in, 1, out, &execFunc);
+                ret = Overload::call(L"%" + stType.substr(0, 8) + L"_e", in, 1, out);
             }
             else
             {
@@ -182,7 +184,7 @@ bool TList::invoke(typed_list & in, optional_list & /*opt*/, int _iRetCount, typ
         }
         catch (ast::InternalError & /*se*/)
         {
-            ret = Overload::call(L"%l_e", in, 1, out, &execFunc);
+            ret = Overload::call(L"%l_e", in, 1, out);
         }
     }
 
@@ -299,14 +301,13 @@ bool TList::toString(std::wostringstream& ostr)
     //call overload %type_p if exists
     types::typed_list in;
     types::typed_list out;
-    ast::ExecVisitor exec;
 
     IncreaseRef();
     in.push_back(this);
 
     try
     {
-        if (Overload::generateNameAndCall(L"p", in, 1, out, &exec) == Function::Error)
+        if (Overload::generateNameAndCall(L"p", in, 1, out) == Function::Error)
         {
             ConfigVariable::setError();
         }
index 665b8f8..687a98a 100644 (file)
@@ -340,14 +340,14 @@ types::Function::ReturnValue sci_arl2_ius(types::typed_list &in, int _iRetCount,
     else
     {
         // look for a solution
-        int iSizeNum = (std::max)(iN, iRankDen);
+        int iSizeNum = std::max(iN, iRankDen);
         double* pdblNum = new double[iSizeNum];
         int iWorkSize = 32 + 32 * iN + 7 * iNg + iN * iNg + iN * iN * (iNg + 2);
         double* pdblWork = new double[iWorkSize];
         iWorkSize = 29 + iN * iN + 4 * iN;
         int* piWork = new int[iWorkSize];
 
-        int iSizeTemp = (std::max)(iRankDen, iN) + 1;
+        int iSizeTemp = std::max(iRankDen, iN) + 1;
         double* pDblDenTemp = new double[iSizeTemp];
         memset(pDblDenTemp, 0x00, iSizeTemp * sizeof(double));
         C2F(dcopy)(&iSize, pdblDen, &iOne, pDblDenTemp, &iOne);
index 82b2f85..2f842d7 100644 (file)
@@ -120,8 +120,8 @@ types::Function::ReturnValue sci_ppol(types::typed_list &in, int _iRetCount, typ
 
     double* pdblG   = pDblOut->get();
     double* pdblZ   = new double[iSizeP * iSizeP];
-    int iSizeWork   = (std::max)(iSizeP * iColB + 3 * iColB,
-                                 iColB * iColB + iColB * (std::max)(2, iColB) + 3 * iColB + 2 * iSizeP);
+    int iSizeWork   = std::max(iSizeP * iColB + 3 * iColB,
+                               iColB * iColB + iColB * std::max(2, iColB) + 3 * iColB + 2 * iSizeP);
     double* pdblW   = new double[iSizeWork];
     int* piW        = new int[iSizeP];
 
@@ -161,7 +161,7 @@ types::Function::ReturnValue sci_ppol(types::typed_list &in, int _iRetCount, typ
     }
 
     double* pdblW1 = pdblW  + iColB + iColB * iColB;
-    double* pdblW2 = pdblW1 + iColB * (std::max)(2, iColB);
+    double* pdblW2 = pdblW1 + iColB * std::max(2, iColB);
     double* pdblW3 = pdblW2 + iSizeP;
     double* pdblW4 = pdblW3 + iSizeP;
     double* pdblW5 = pdblW4 + iColB;
index 0fbc0ef..e5ad5a6 100644 (file)
@@ -86,8 +86,8 @@ types::Function::ReturnValue sci_tzer(types::typed_list &in, int _iRetCount, typ
     // input
     int iSize1  = iCols[0] + iRows[2];
     int iSize2  = iCols[0] + iCols[1];
-    int iNwrk1  = (std::max)(iCols[1], iRows[2]);
-    int iNwrk2  = (std::max)(iNwrk1, iCols[0] + 1);
+    int iNwrk1  = std::max(iCols[1], iRows[2]);
+    int iNwrk2  = std::max(iNwrk1, iCols[0] + 1);
 
     // output
     int iNu     = 0;
@@ -143,14 +143,14 @@ types::Function::ReturnValue sci_tzer(types::typed_list &in, int _iRetCount, typ
     }
 
     /*** retrun output arguments ***/
-    types::Double* pDblOut1 = new types::Double(iNu, (std::min)(iNu, 1), true);
+    types::Double* pDblOut1 = new types::Double(iNu, std::min(iNu, 1), true);
     double* pdblReal = pDblOut1->get();
     double* pdblImg  = pDblOut1->getImg();
     C2F(dcopy)(&iNu, pdblR, &iOne, pdblReal, &iOne);
     C2F(dcopy)(&iNu, pdblI, &iOne, pdblImg, &iOne);
     out.push_back(pDblOut1);
 
-    types::Double* pDblOut2 = new types::Double(iNu, (std::min)(iNu, 1));
+    types::Double* pDblOut2 = new types::Double(iNu, std::min(iNu, 1));
     pdblReal = pDblOut2->get();
     C2F(dcopy)(&iNu, pdblWork2, &iOne, pdblReal, &iOne);
     out.push_back(pDblOut2);
index d158efc..e0bb857 100644 (file)
@@ -21,6 +21,8 @@
 #undef SCIPROMPT
 #endif
 #define SCIPROMPT "--> "
+#define SCIPROMPTDEBUG "debug> "
+#define SCIPROMPTBREAK "break> "
 
 #ifdef SCIPROMPT_PAUSE
 #undef SCIPROMPT_PAUSE
index 267a63e..c900b45 100644 (file)
@@ -28,7 +28,19 @@ static char *temporaryPrompt = NULL;
 /*------------------------------------------------------------------------*/
 void C2F(setprlev)( int *pause)
 {
-    if ( *pause == 0 )
+    //debugger prompt first !
+    if (isEnableDebug())
+    {
+        if (isDebugInterrupted())
+        {
+            sprintf(Sci_Prompt, SCIPROMPTBREAK);
+        }
+        else
+        {
+            sprintf(Sci_Prompt, SCIPROMPTDEBUG);
+        }
+    }
+    else if ( *pause == 0 )
     {
         if (temporaryPrompt != NULL)
         {
index f493dac..86c71b3 100644 (file)
@@ -10,6 +10,7 @@
  *
  */
 
+#include <algorithm>
 #include "configvariable.hxx"
 #include "threadmanagement.hxx"
 
@@ -36,7 +37,7 @@ void setScilabInputMethod(SCILAB_INPUT_METHOD reader)
 void C2F(scilabread)(char* strRead, int len)
 {
     char* str = scilabRead();
-    int size = Min(static_cast<int>(strlen(str)), len - 1);
+    int size = std::min(static_cast<int>(strlen(str)), len - 1);
     strncpy(strRead, str, size);
     strRead[size] = '\0';
     FREE(str);
index 85e4c68..35428cf 100644 (file)
@@ -109,7 +109,8 @@ GATEWAY_CPP_SOURCES = \
        sci_gateway/cpp/sci_intppty.cpp \
        sci_gateway/cpp/sci_analyzeroptions.cpp \
        sci_gateway/cpp/sci_macr2tree.cpp \
-       sci_gateway/cpp/sci_predef.cpp
+       sci_gateway/cpp/sci_predef.cpp \
+       sci_gateway/cpp/sci_debug.cpp
 
 libscicore_la_CPPFLAGS = \
     -I$(srcdir)/includes/ \
index c5c5f1f..4efa48c 100644 (file)
@@ -284,7 +284,8 @@ am__objects_5 = sci_gateway/cpp/libscicore_la-core_gw.lo \
        sci_gateway/cpp/libscicore_la-sci_intppty.lo \
        sci_gateway/cpp/libscicore_la-sci_analyzeroptions.lo \
        sci_gateway/cpp/libscicore_la-sci_macr2tree.lo \
-       sci_gateway/cpp/libscicore_la-sci_predef.lo
+       sci_gateway/cpp/libscicore_la-sci_predef.lo \
+       sci_gateway/cpp/libscicore_la-sci_debug.lo
 am_libscicore_la_OBJECTS = $(am__objects_4) $(am__objects_5)
 libscicore_la_OBJECTS = $(am_libscicore_la_OBJECTS)
 libscicore_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
@@ -780,7 +781,8 @@ GATEWAY_CPP_SOURCES = \
        sci_gateway/cpp/sci_intppty.cpp \
        sci_gateway/cpp/sci_analyzeroptions.cpp \
        sci_gateway/cpp/sci_macr2tree.cpp \
-       sci_gateway/cpp/sci_predef.cpp
+       sci_gateway/cpp/sci_predef.cpp \
+       sci_gateway/cpp/sci_debug.cpp
 
 libscicore_la_CPPFLAGS = -I$(srcdir)/includes/ -I$(srcdir)/src/c/ \
        -I$(srcdir)/src/cpp/ -I$(top_srcdir)/modules/ast/includes/ast/ \
@@ -1298,6 +1300,9 @@ sci_gateway/cpp/libscicore_la-sci_macr2tree.lo:  \
 sci_gateway/cpp/libscicore_la-sci_predef.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libscicore_la-sci_debug.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
 
 libscicore.la: $(libscicore_la_OBJECTS) $(libscicore_la_DEPENDENCIES) $(EXTRA_libscicore_la_DEPENDENCIES) 
        $(AM_V_CXXLD)$(libscicore_la_LINK) $(am_libscicore_la_rpath) $(libscicore_la_OBJECTS) $(libscicore_la_LIBADD) $(LIBS)
@@ -1330,6 +1335,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_clear.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_clearfun.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_clearglobal.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_debug.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_errclear.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_error.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_exists.Plo@am__quote@
@@ -2041,6 +2047,13 @@ sci_gateway/cpp/libscicore_la-sci_predef.lo: sci_gateway/cpp/sci_predef.cpp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libscicore_la-sci_predef.lo `test -f 'sci_gateway/cpp/sci_predef.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_predef.cpp
 
+sci_gateway/cpp/libscicore_la-sci_debug.lo: sci_gateway/cpp/sci_debug.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libscicore_la-sci_debug.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_debug.Tpo -c -o sci_gateway/cpp/libscicore_la-sci_debug.lo `test -f 'sci_gateway/cpp/sci_debug.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_debug.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_debug.Tpo sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_debug.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/sci_debug.cpp' object='sci_gateway/cpp/libscicore_la-sci_debug.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libscicore_la-sci_debug.lo `test -f 'sci_gateway/cpp/sci_debug.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_debug.cpp
+
 .f.o:
        $(AM_V_F77)$(F77COMPILE) -c -o $@ $<
 
index a530910..853b40b 100644 (file)
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="debug">
     <refnamediv>
         <refname>debug</refname>
-        <refpurpose>Debugging level of Scilab internals</refpurpose>
+        <refpurpose>Debugging environment in Scilab</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Calling Sequence</title>
-        <synopsis>debug(level_int)
-            level_int = debug()
+        <synopsis>
+            debug()
         </synopsis>
     </refsynopsisdiv>
     <refsection>
-        <title>Arguments</title>
-        <variablelist>
-            <varlistentry>
-                <term>level_int</term>
-                <listitem>
-                    <para>integer (-1 to 4)</para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
-    </refsection>
-    <refsection>
         <title>Description</title>
         <para>
-            For the values 0,1,2,3,4 of <varname>level_int</varname>, <code>debug</code>
-            defines various levels of debugging. This is targeted to the parser, not
-            to Scilab scripts, and is for Scilab experts only.
-        </para>
-        <para>
-            <note>
-                The output of this function will change with Scilab 6.0.0.
-            </note>
+        Use to debug Scilab script.
+        After call of <literal>debug()</literal>, you enter in debug mode.
+        This mode allows you to manage <literal>breakpoints</literal>,
+        launch execution with stop en error, execute script step by step, ...
+
+        When debug mode is active, prompt change to <literal>debug> </literal>.
         </para>
+        <term>Commands: </term>
+        <listitem>
+            <variablelist>
+                <varlistentry>
+                    <term>(h)elp: </term>
+                    <para>Show help on console</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>(q)uit: </term>
+                    <para>Leave debug mode to return to normal mode of Scilab.</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>(w)here or bt: </term>
+                    <para>Display callstack.</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>(e)xec: </term>
+                    <term>(r)un: </term>
+                    <para>Execute command.</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>(c)ontinue: </term>
+                    <para>Continue execution.</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>(a)bort: </term>
+                    <para>Abort execution.</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>step(n)ext or (n)ext: </term>
+                    <para>Continue execution to next expression.</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>step(i)n or (i)n: </term>
+                    <para>Continue execution to next expression in sub function.</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>step(o)ut or (o)ut: </term>
+                    <para>Continue execution to next expression in previous function.</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>(b)reakpoint or (b)reak: </term>
+                    <synopsis>breakpoint function [line [condition]]</synopsis>
+                    <para>Add a breakpoint in a function at line <literal>line</literal></para>
+                    <para>If a condition is specified, a breakpoint become enable only if condition is <literal>%t</literal></para>
+                </varlistentry>
+                <varlistentry>
+                    <term>(del)ete: </term>
+                    <synopsis>delete [n]</synopsis>
+                    <para>Remove all breakpoints.</para>
+                    <para>If n is specified, remove breakpoint #n</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>enable: </term>
+                    <synopsis>enable [n]</synopsis>
+                    <para>Enable all breakpoints.</para>
+                    <para>If n is specified, enable breakpoint #n</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>disable: </term>
+                    <synopsis>disable [n]</synopsis>
+                    <para>Disable all breakpoints.</para>
+                    <para>If n is specified, disable breakpoint #n</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>(s)how: </term>
+                    <synopsis>show [n]</synopsis>
+                    <para>Show all breakpoints information.</para>
+                    <para>If n is specified, show breakpoint #n</para>
+                </varlistentry>
+            </variablelist>
+        </listitem>
     </refsection>
     <refsection>
         <title>Examples</title>
-        <programlisting role="example"><![CDATA[ 
-debug(3);
-2+2
-//  0.200E+01
-//+
-//  0.200E+01
-// eol
+        <programlisting role="example"><![CDATA[
+//function to overload cosinus on string
+function v = %c_cos(val)
+    printf("val : %s\n", val);
+    v = cos(evstr(val));
+endfunction
+
+//caller
+function a = test_debug()
+    b = cos("%pi");
+    a = b * 3;
+endfunction
+
+debug
+break test_debug
+exec test_debug
+where
+stepin
+disp val
+continue
+quit
+ ]]></programlisting>
+        <programlisting role="example"><![CDATA[
+function v = compute(val)
+    v = 1;
+    for i=1:val
+        v = v * i;
+    end
+endfunction
+
+debug
+break compute 4 "i == 5"
+exec compute(10)
+disp val
+disp i
+disp v
+continue
+quit
  ]]></programlisting>
     </refsection>
     
@@ -50,8 +140,8 @@ debug(3);
         <title>History</title>
         <revhistory>
             <revision>
-                <revnumber>5.4.0</revnumber>
-                <revremark>Previous value is returned as output argument when setting a new value.</revremark>
+                <revnumber>6.0.0</revnumber>
+                <revremark>New version: console interface to Scilab 6 debugger.</revremark>
             </revision>
         </revhistory>
     </refsection>
diff --git a/scilab/modules/core/help/en_US/debugging/delbpt.xml b/scilab/modules/core/help/en_US/debugging/delbpt.xml
deleted file mode 100644 (file)
index fcc4266..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="delbpt" xml:lang="en">
-    <refnamediv>
-        <refname>delbpt</refname>
-        <refpurpose>delete breakpoints</refpurpose>
-    </refnamediv>
-    <refsynopsisdiv>
-        <title>Calling Sequence</title>
-        <synopsis>delbpt([macroname [,linenumb]])</synopsis>
-    </refsynopsisdiv>
-    <refsection>
-        <title>Arguments</title>
-        <variablelist>
-            <varlistentry>
-                <term>macroname</term>
-                <listitem>
-                    <para>string</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>linenumb</term>
-                <listitem>
-                    <para>scalar integer or vector of integers</para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
-    </refsection>
-    <refsection>
-        <title>Description</title>
-        <para>
-            Deletes the breakpoint at line <literal>linenumb</literal> in the
-            function <literal>macroname</literal>.
-        </para>
-        <para>
-            <literal>linenumb</literal> can be a row or column vector of line
-            numbers, or a single scalar line number.
-        </para>
-        <para>
-            Line numbers in <literal>linenumb</literal> are
-            <emphasis>physical</emphasis> line numbers in function
-            <literal>macroname</literal>.
-        </para>
-        <para>
-            <note>
-                Note that Scilab versions before 5.0 used
-                <emphasis>logical</emphasis> line numbers. The difference between physical
-                and logical line numbers is the number of <emphasis>continued lines</emphasis>
-                (see <link linkend="dot">dot</link>).
-            </note>
-        </para>
-        <para>
-            If <literal>linenumb</literal> is omitted, all the breakpoints in
-            function <literal>macroname</literal> are deleted.
-        </para>
-        <para>
-            If both <literal>macroname</literal> and <literal>linenumb</literal>
-            are omitted, all breakpoints in all functions are deleted.
-        </para>
-    </refsection>
-    <refsection>
-        <title>Examples</title>
-        <programlisting role="example"><![CDATA[ 
-setbpt('foo',1),setbpt('foo',10),delbpt('foo',10),dispbpt()
-delbpt('foo',1),dispbpt()
-
-setbpt('foo1',4),setbpt('foo1',9),setbpt('foo2',6),setbpt('foo3',8),dispbpt()
-delbpt('foo2'),dispbpt()
-delbpt(),dispbpt()
-
-delbpt('foo',[1,2,5,6]),dispbpt()
- ]]></programlisting>
-    </refsection>
-    <refsection role="see also">
-        <title>See Also</title>
-        <simplelist type="inline">
-            <member>
-                <link linkend="setbpt">setbpt</link>
-            </member>
-            <member>
-                <link linkend="dispbpt">dispbpt</link>
-            </member>
-            <member>
-                <link linkend="pause">pause</link>
-            </member>
-            <member>
-                <link linkend="resume">resume</link>
-            </member>
-            <member>
-                <link linkend="abort">abort</link>
-            </member>
-        </simplelist>
-    </refsection>
-</refentry>
diff --git a/scilab/modules/core/help/en_US/debugging/dispbpt.xml b/scilab/modules/core/help/en_US/debugging/dispbpt.xml
deleted file mode 100644 (file)
index 510042e..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="dispbpt" xml:lang="en">
-    <refnamediv>
-        <refname>dispbpt</refname>
-        <refpurpose>display breakpoints</refpurpose>
-    </refnamediv>
-    <refsynopsisdiv>
-        <title>Calling Sequence</title>
-        <synopsis>dispbpt()</synopsis>
-    </refsynopsisdiv>
-    <refsection>
-        <title>Description</title>
-        <para>
-            <code>dispbpt()</code> displays all active breakpoints
-            currently inserted in functions.
-        </para>
-        <para>
-            The line numbers displayed by <code>dispbpt()</code> are
-            <emphasis>physical</emphasis> line numbers in the mentioned functions.
-        </para>
-        <para>
-            <note>
-                Note that Scilab versions before 5.0 showed <emphasis>logical</emphasis>
-                line numbers. The difference between physical and logical line numbers is
-                the number of <emphasis>continued</emphasis> lines (see <link linkend="dot">dot</link>).
-            </note>
-        </para>
-    </refsection>
-    <refsection>
-        <title>Examples</title>
-        <programlisting role="example"><![CDATA[ 
-setbpt('foo')
-setbpt('foo',10)
-dispbpt()
-delbpt()
-setbpt('foo',[1,2,5,6])
-dispbpt()
- ]]></programlisting>
-    </refsection>
-    <refsection role="see also">
-        <title>See Also</title>
-        <simplelist type="inline">
-            <member>
-                <link linkend="setbpt">setbpt</link>
-            </member>
-            <member>
-                <link linkend="delbpt">delbpt</link>
-            </member>
-            <member>
-                <link linkend="pause">pause</link>
-            </member>
-            <member>
-                <link linkend="resume">resume</link>
-            </member>
-            <member>
-                <link linkend="abort">abort</link>
-            </member>
-        </simplelist>
-    </refsection>
-</refentry>
diff --git a/scilab/modules/core/help/en_US/debugging/setbpt.xml b/scilab/modules/core/help/en_US/debugging/setbpt.xml
deleted file mode 100644 (file)
index 0142cc5..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="setbpt" xml:lang="en">
-    <refnamediv>
-        <refname>setbpt</refname>
-        <refpurpose>set breakpoints</refpurpose>
-    </refnamediv>
-    <refsynopsisdiv>
-        <title>Calling Sequence</title>
-        <synopsis>setbpt(macroname [,linenumb])</synopsis>
-    </refsynopsisdiv>
-    <refsection>
-        <title>Arguments</title>
-        <variablelist>
-            <varlistentry>
-                <term>macroname</term>
-                <listitem>
-                    <para>a string</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>linenumb</term>
-                <listitem>
-                    <para>a scalar integer or a vector of integers</para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
-    </refsection>
-    <refsection>
-        <title>Description</title>
-        <para>
-            <function>setbpt</function> interactively inserts a breakpoint in the
-            line number <varname>linenumb</varname> (default value is 1) of the
-            function <varname>macroname</varname>.
-        </para>
-        <para>
-            <varname>linenumb</varname> can be a row or column vector of line
-            numbers, or a single scalar line number.
-        </para>
-        <para>
-            Line numbers in <varname>linenumb</varname> are
-            <emphasis>physical</emphasis> line numbers in function
-            <varname>macroname</varname>.
-        </para>
-        <para>
-            <note>
-                Note that Scilab versions before 5.0 used
-                <emphasis>logical</emphasis> line numbers. The difference between physical
-                and logical line numbers is the number of <emphasis>continued lines</emphasis>
-                (see <link linkend="dot">dot</link>).
-            </note>
-        </para>
-        <para>When reaching a breakpoint, Scilab evaluates the specified physical
-            line and stops the execution flow. Then Scilab goes into a <link linkend="pause">pause</link>
-            mode in which the user can check current values. The <link linkend="pause">pause</link>
-            is exited with <link linkend="resume">resume</link> or <link linkend="abort">abort</link>.
-        </para>
-        <para>Redefining the function does not clear the breakpoints, the user
-            must explicitly delete breakpoints using <link linkend="delbpt">delbpt</link>. The maximum number of functions with
-            breakpoints enabled must be less than 100 and the overall maximum number
-            of breakpoints is set to 1000.
-        </para>
-    </refsection>
-    <refsection>
-        <title>Examples</title>
-        <programlisting role="example"><![CDATA[
-setbpt('foo')
-setbpt('foo',10)
-dispbpt()
-delbpt()
-setbpt('foo',[1,2,5,6])
-dispbpt()
- ]]></programlisting>
-    </refsection>
-    <refsection role="see also">
-        <title>See Also</title>
-        <simplelist type="inline">
-            <member>
-                <link linkend="delbpt">delbpt</link>
-            </member>
-            <member>
-                <link linkend="dispbpt">dispbpt</link>
-            </member>
-            <member>
-                <link linkend="pause">pause</link>
-            </member>
-            <member>
-                <link linkend="resume">resume</link>
-            </member>
-            <member>
-                <link linkend="abort">abort</link>
-            </member>
-            <member>
-                <link linkend="quit">quit</link>
-            </member>
-        </simplelist>
-    </refsection>
-</refentry>
index dc8677d..27eabec 100644 (file)
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="fr" xml:id="debug">
     <refnamediv>
         <refname>debug</refname>
-        <refpurpose>niveau de débogage</refpurpose>
+        <refpurpose>Environnement de déboggage dans Scilab</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Séquence d'appel</title>
-        <synopsis>debug(level_int)
-            level_int=debug()
-            previous_level_int = debug(level_int)
+        <synopsis>
+            debug()
         </synopsis>
     </refsynopsisdiv>
     <refsection>
-        <title>Paramètres</title>
-        <variablelist>
-            <varlistentry>
-                <term>level_int</term>
-                <listitem>
-                    <para>valeur entiere (entre -1 et 4)</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>previous_level_int</term>
-                <listitem>
-                    <para>précédente valeur</para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
-    </refsection>
-    <refsection>
         <title>Description</title>
         <para>
-            Pour les valeurs 0,1,2,3,4 de <literal>level-int</literal> ,
-            <literal>debug</literal> définit différents niveaux de débogage. Ces niveaux
-            sont ciblés sur le débogage de l'interpréteur et non des scripts Scilab,
-            et sont dédiés aux experts de Scilab.
+        Cet environnement sert a débogger un cript Scilab.
+        Après l'appel a <literal>debug()</literal>, vous entrez en mode debug.
+        Ce mode vous permet de manipuler des points d'arrêts,
+        de lancer des exécutions avec arrêt sur erreur,
+        d'exécuter des scripts en mode pas à pas ...
+
+        Une fois que ce mode est actif, l'invite devient <literal>debug> </literal>.
         </para>
+        <term>Commandes: </term>
+        <listitem>
+            <variablelist>
+                <varlistentry>
+                    <term>(h)elp: </term>
+                    <para>Affiche l'aide dans la console</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>(q)uit: </term>
+                    <para>Quitte l'environnement de déboggage et revient au mode normal de Scilab.</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>(w)here or bt: </term>
+                    <para>Affiche la pile d'appel.</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>(e)xec: </term>
+                    <term>(r)un: </term>
+                    <para>Exécute une commande.</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>(c)ontinue: </term>
+                    <para>Poursuit l'éxécution.</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>(a)bort: </term>
+                    <para>Annule l'éxécution.</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>step(n)ext or (n)ext: </term>
+                    <para>Poursuit l'éxécution jusqu'a l'expression suivante.</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>step(i)n or (i)n: </term>
+                    <para>Poursuit l'éxécution dans la sous fonction.</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>step(o)ut or (o)ut: </term>
+                    <para>Poursuit l'éxécution jusqu'a revenir dans la fonction appelante.</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>(b)reakpoint or (b)reak: </term>
+                    <synopsis>breakpoint function [line [condition]]</synopsis>
+                    <para>Ajoute un point d'arrêt dans une fonction a une ligne <literal>line</literal></para>
+                    <para>Si une condition est spécifiée, le point d'arrêt ne devient active que si la condition est <literal>%t</literal></para>
+                </varlistentry>
+                <varlistentry>
+                    <term>(del)ete: </term>
+                    <synopsis>delete [n]</synopsis>
+                    <para>Supprime tous les points d'arrêt.</para>
+                    <para>Si n est spécifié, supprime le point d'arrêt #n</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>enable: </term>
+                    <synopsis>enable [n]</synopsis>
+                    <para>Active tous les points d'arrêt.</para>
+                    <para>Si n est spécifié, active le point d'arrêt #n</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>disable: </term>
+                    <synopsis>disable [n]</synopsis>
+                    <para>Désactive tous les points d'arrêt.</para>
+                    <para>Si n est spécifié, désavtive le point d'arrêt #n</para>
+                </varlistentry>
+                <varlistentry>
+                    <term>(s)how: </term>
+                    <synopsis>show [n]</synopsis>
+                    <para>Affiche tous les information sur les points d'arrêt.</para>
+                    <para>Si n est spécifié, affiche les information du point d'arrêt #n</para>
+                </varlistentry>
+            </variablelist>
+        </listitem>
     </refsection>
-    <refsection role="see also">
-        <title>Voir aussi</title>
-        <simplelist type="inline">
-            <member>
-                <link linkend="ScilabEval">ScilabEval</link>
-            </member>
-            <member>
-                <link linkend="editor">editor</link>
-            </member>
-        </simplelist>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+//fonction de surcharge de la fonction cosinus pour les chaînes de caractères
+function v = %c_cos(val)
+    printf("val : %s\n", val);
+    v = cos(evstr(val));
+endfunction
+
+//appelant
+function a = test_debug()
+    b = cos("%pi");
+    a = b * 3;
+endfunction
+
+debug
+break test_debug
+exec test_debug
+where
+stepin
+disp val
+continue
+quit
+ ]]></programlisting>
+        <programlisting role="example"><![CDATA[
+function v = compute(val)
+    v = 1;
+    for i=1:val
+        v = v * i;
+    end
+endfunction
+
+debug
+break compute 4 "i == 5"
+exec compute(10)
+disp val
+disp i
+disp v
+continue
+quit
+ ]]></programlisting>
     </refsection>
+    
     <refsection>
-        <title>Historique</title>
+        <title>History</title>
         <revhistory>
             <revision>
-                <revnumber>5.4.0</revnumber>
-                <revremark>La valeur précédente est retournée comme argument de sortie lorsque vous définissez une nouvelle valeur.</revremark>
+                <revnumber>6.0.0</revnumber>
+                <revremark>Nouvelle version: Interface console avec le debugger de Scilab 6.</revremark>
             </revision>
         </revhistory>
     </refsection>
diff --git a/scilab/modules/core/help/ja_JP/debugging/delbpt.xml b/scilab/modules/core/help/ja_JP/debugging/delbpt.xml
deleted file mode 100644 (file)
index 2f5fbc4..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="delbpt" xml:lang="ja">
-    <refnamediv>
-        <refname>delbpt</refname>
-        <refpurpose>ブレークポイントを削除する</refpurpose>
-    </refnamediv>
-    <refsynopsisdiv>
-        <title>呼出し手順</title>
-        <synopsis>delbpt([macroname [,linenumb]])</synopsis>
-    </refsynopsisdiv>
-    <refsection>
-        <title>引数</title>
-        <variablelist>
-            <varlistentry>
-                <term>macroname</term>
-                <listitem>
-                    <para>string</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>linenumb</term>
-                <listitem>
-                    <para>スカラー整数または整数ベクトル</para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
-    </refsection>
-    <refsection>
-        <title>説明</title>
-        <para>
-          関数 <literal>macroname</literal>の<literal>linenumb</literal> 行目の
-          ブレークポイントを削除します.
-        </para>
-        <para>
-          <literal>linenumb</literal> には行または行番号の
-          列ベクトルまたはスカラーの行番号を指定することができます.
-        </para>
-        <para>
-          <literal>linenumb</literal> の行番号は
-          関数<literal>macroname</literal>における物理的な行番号です.
-        </para>
-        <para>
-         <note>
-            5.0より前のバージョンのScilabでは,
-            論理的な行番号が使用されていたことに注意してください.
-            物理的行番号と論理的行番号の差は,
-            継続行の数です(<link linkend="dot">dot</link>参照).
-          </note>
-        </para>
-        <para>
-          <literal>linenumb</literal> を省略した場合,<literal>macroname</literal>関数内
-          の全てのブレークポイントが削除されます.
-        </para>
-        <para>
-          <literal>macroname</literal>と <literal>linenumb</literal>の
-          両方が省略された場合, 全ての関数の全てのブレークポイントが削除されます.
-        </para>
-    </refsection>
-    <refsection>
-        <title>例</title>
-        <programlisting role="example"><![CDATA[ 
-setbpt('foo',1),setbpt('foo',10),delbpt('foo',10),dispbpt()
-delbpt('foo',1),dispbpt()
-
-setbpt('foo1',4),setbpt('foo1',9),setbpt('foo2',6),setbpt('foo3',8),dispbpt()
-delbpt('foo2'),dispbpt()
-delbpt(),dispbpt()
-
-delbpt('foo',[1,2,5,6]),dispbpt()
- ]]></programlisting>
-    </refsection>
-    <refsection role="see also">
-        <title>参照</title>
-        <simplelist type="inline">
-            <member>
-                <link linkend="setbpt">setbpt</link>
-            </member>
-            <member>
-                <link linkend="dispbpt">dispbpt</link>
-            </member>
-            <member>
-                <link linkend="pause">pause</link>
-            </member>
-            <member>
-                <link linkend="resume">resume</link>
-            </member>
-            <member>
-                <link linkend="abort">abort</link>
-            </member>
-        </simplelist>
-    </refsection>
-</refentry>
diff --git a/scilab/modules/core/help/ja_JP/debugging/dispbpt.xml b/scilab/modules/core/help/ja_JP/debugging/dispbpt.xml
deleted file mode 100644 (file)
index e33968c..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="dispbpt" xml:lang="ja">
-    <refnamediv>
-        <refname>dispbpt</refname>
-        <refpurpose>ブレークポイントを表示</refpurpose>
-    </refnamediv>
-    <refsynopsisdiv>
-        <title>呼び出し手順</title>
-        <synopsis>dispbpt()</synopsis>
-    </refsynopsisdiv>
-    <refsection>
-        <title>説明</title>
-        <para>
-          <code>dispbpt()</code> は,関数に現在挿入されている
-          アクティブなブレークポイントを全て表示します.
-        </para>
-        <para>
-          <code>dispbpt()</code> により表示される行番号は,
-          対象とする関数内での<emphasis>物理的な</emphasis>行番号です.
-        </para>
-        <para>
-          <note>
-            5.0より前のバージョンのScilabでは<emphasis>論理的な</emphasis>
-            行番号が表示されることに注意してください.
-            物理的な行番号と論理的な行番号の差は,
-            <emphasis>継続行</emphasis>(<link linkend="dot">dot</link>参照)の数です.
-         </note>
-        </para>
-    </refsection>
-    <refsection>
-        <title>例</title>
-        <programlisting role="example"><![CDATA[ 
-setbpt('foo')
-setbpt('foo',10)
-dispbpt()
-delbpt()
-setbpt('foo',[1,2,5,6])
-dispbpt()
- ]]></programlisting>
-    </refsection>
-    <refsection role="see also">
-        <title>参照</title>
-        <simplelist type="inline">
-            <member>
-                <link linkend="setbpt">setbpt</link>
-            </member>
-            <member>
-                <link linkend="delbpt">delbpt</link>
-            </member>
-            <member>
-                <link linkend="pause">pause</link>
-            </member>
-            <member>
-                <link linkend="resume">resume</link>
-            </member>
-            <member>
-                <link linkend="abort">abort</link>
-            </member>
-        </simplelist>
-    </refsection>
-</refentry>
diff --git a/scilab/modules/core/help/ja_JP/debugging/setbpt.xml b/scilab/modules/core/help/ja_JP/debugging/setbpt.xml
deleted file mode 100644 (file)
index 09a620f..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="setbpt" xml:lang="ja">
-    <refnamediv>
-        <refname>setbpt</refname>
-        <refpurpose>ブレークポイントを設定する</refpurpose>
-    </refnamediv>
-    <refsynopsisdiv>
-        <title>呼び出し手順</title>
-        <synopsis>setbpt(macroname [,linenumb])</synopsis>
-    </refsynopsisdiv>
-    <refsection>
-        <title>引数</title>
-        <variablelist>
-            <varlistentry>
-                <term>macroname</term>
-                <listitem>
-                    <para>文字列</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>linenumb</term>
-                <listitem>
-                    <para>スカラー整数または整数ベクトル</para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
-    </refsection>
-    <refsection>
-        <title>説明</title>
-        <para>
-            <function>setbpt</function>は,対話的にブレークポイントを
-            関数<varname>macroname</varname>の
-            行番号<varname>linenumb</varname>(デフォルト値: 1)に挿入します.
-        </para>
-        <para>
-            <varname>linenumb</varname> は,行または行番号の列ベクトル,または
-            行番号のスカラー値とすることができます.
-        </para>
-        <para>
-            <varname>linenumb</varname>の行番号は,
-            関数<varname>macroname</varname>内の
-            物理的な行番号となります.
-        </para>
-        <para>
-            <note>
-                5.0より前のバージョンのScilabでは,
-                論理的な行番号が使用されていたことに注意してください.
-                物理的行番号と論理的行番号の差は,
-                継続行の数です(<link linkend="dot">dot</link>参照).
-            </note>
-        </para>
-        <para>
-            ブレークポイントに達した時, Scilabは指定された
-            物理行を評価し, 実行フローを停止します.
-            Scilabは<link linkend="pause">一時停止</link>モードに入り,
-            ユーザがカレントの値を確認できるようになります.
-            この<link linkend="pause">一次停止</link> は<link linkend="resume">resume</link> または
-            <link linkend="abort">abort</link>により解除できます.
-        </para>
-        <para>
-            関数を再定義してもブレークポイントは消去されません.
-            ユーザーは<link linkend="delbpt">delbpt</link>により明示的にブレークポイントを
-            削除する必要があります.
-            ブレークポイントを指定する関数の数は 100以下,
-            ブレークポイントの合計数は 1000 以下とする必要があります.
-        </para>
-    </refsection>
-    <refsection>
-        <title>例</title>
-        <programlisting role="example"><![CDATA[
-setbpt('foo')
-setbpt('foo',10)
-dispbpt()
-delbpt()
-setbpt('foo',[1,2,5,6])
-dispbpt()
- ]]></programlisting>
-    </refsection>
-    <refsection role="see also">
-        <title>参照</title>
-        <simplelist type="inline">
-            <member>
-                <link linkend="delbpt">delbpt</link>
-            </member>
-            <member>
-                <link linkend="dispbpt">dispbpt</link>
-            </member>
-            <member>
-                <link linkend="pause">pause</link>
-            </member>
-            <member>
-                <link linkend="resume">resume</link>
-            </member>
-            <member>
-                <link linkend="abort">abort</link>
-            </member>
-            <member>
-                <link linkend="quit">quit</link>
-            </member>
-        </simplelist>
-    </refsection>
-</refentry>
diff --git a/scilab/modules/core/help/pt_BR/debugging/delbpt.xml b/scilab/modules/core/help/pt_BR/debugging/delbpt.xml
deleted file mode 100644 (file)
index b59a0b7..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="delbpt" xml:lang="en">
-    <refnamediv>
-        <refname>delbpt</refname>
-        <refpurpose>deleta pontos de parada ("breakpoints")</refpurpose>
-    </refnamediv>
-    <refsynopsisdiv>
-        <title>Seqüência de Chamamento</title>
-        <synopsis>delbpt([macroname [,linenumb]])</synopsis>
-    </refsynopsisdiv>
-    <refsection>
-        <title>Parâmetros</title>
-        <variablelist>
-            <varlistentry>
-                <term>macroname</term>
-                <listitem>
-                    <para>string</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>linenumb</term>
-                <listitem>
-                    <para>escalar inteiro ou vetor de inteiros</para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
-    </refsection>
-    <refsection>
-        <title>Descrição</title>
-        <para>
-            Deleta o ponto de parada na linha <literal>linenumb</literal> na
-            função <literal>macroname</literal>.
-        </para>
-        <para>
-            <literal>linenumb</literal> pode ser um vetor linha ou coluna de
-            inteiros, ou um único escalar.
-        </para>
-        <para>
-            Se <literal>linenumb</literal> for omitido, todos os pontos de
-            parada da função <literal>macroname</literal> são deletados.
-        </para>
-        <para>
-            Se ambos <literal>macroname</literal> e <literal>linenumb</literal>
-            são omitidos, todos os pontos de parada em todas as funções são
-            deletados.
-        </para>
-    </refsection>
-    <refsection>
-        <title>Exemplos</title>
-        <programlisting role="example"><![CDATA[ 
-setbpt('foo',1),setbpt('foo',10),delbpt('foo',10),dispbpt()
-delbpt('foo',1),dispbpt()
-
-setbpt('foo1',4),setbpt('foo1',9),setbpt('foo2',6),setbpt('foo3',8),dispbpt()
-delbpt('foo2'),dispbpt()
-delbpt(),dispbpt()
-
-delbpt('foo',[1,2,5,6]),dispbpt()
- ]]></programlisting>
-    </refsection>
-    <refsection role="see also">
-        <title>Ver Também</title>
-        <simplelist type="inline">
-            <member>
-                <link linkend="setbpt">setbpt</link>
-            </member>
-            <member>
-                <link linkend="dispbpt">dispbpt</link>
-            </member>
-            <member>
-                <link linkend="pause">pause</link>
-            </member>
-            <member>
-                <link linkend="resume">resume</link>
-            </member>
-        </simplelist>
-    </refsection>
-</refentry>
diff --git a/scilab/modules/core/help/pt_BR/debugging/dispbpt.xml b/scilab/modules/core/help/pt_BR/debugging/dispbpt.xml
deleted file mode 100644 (file)
index 1b4f984..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="dispbpt" xml:lang="en">
-    <refnamediv>
-        <refname>dispbpt</refname>
-        <refpurpose>exibe breakpoints (pontos de parada)</refpurpose>
-    </refnamediv>
-    <refsynopsisdiv>
-        <title>Seqüência de Chamamento</title>
-        <synopsis>dispbpt()</synopsis>
-    </refsynopsisdiv>
-    <refsection>
-        <title>Descrição</title>
-        <para>
-            <literal>dispbpt()</literal> exibe todos os breakpoints ativos
-            inseridos nas funções.
-        </para>
-    </refsection>
-    <refsection role="see also">
-        <title>Ver Também</title>
-        <simplelist type="inline">
-            <member>
-                <link linkend="setbpt">setbpt</link>
-            </member>
-            <member>
-                <link linkend="delbpt">delbpt</link>
-            </member>
-            <member>
-                <link linkend="pause">pause</link>
-            </member>
-            <member>
-                <link linkend="resume">resume</link>
-            </member>
-        </simplelist>
-    </refsection>
-</refentry>
diff --git a/scilab/modules/core/help/pt_BR/debugging/setbpt.xml b/scilab/modules/core/help/pt_BR/debugging/setbpt.xml
deleted file mode 100644 (file)
index c952429..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="setbpt" xml:lang="en">
-    <refnamediv>
-        <refname>setbpt</refname>
-        <refpurpose>ajusta pontos de parada</refpurpose>
-    </refnamediv>
-    <refsynopsisdiv>
-        <title>Seqüência de Chamamento</title>
-        <synopsis>setbpt(macroname [,linenumb])</synopsis>
-    </refsynopsisdiv>
-    <refsection>
-        <title>Parâmetros</title>
-        <variablelist>
-            <varlistentry>
-                <term>macroname</term>
-                <listitem>
-                    <para>string</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>linenumb</term>
-                <listitem>
-                    <para>escalar inteiro ou vetor de escalares</para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
-    </refsection>
-    <refsection>
-        <title>Descrição</title>
-        <para>
-            <literal>setbpt</literal> insere interativamente um ponto de parada
-            na linha de número <literal>linenumb</literal> (valor padrão é 1) da
-            função <literal>macroname</literal>
-        </para>
-        <para>
-            <literal>linenumb</literal> pode ser um vetor linha ou coluna dos
-            números das linhas, ou um único número de linha escalar.
-        </para>
-        <para>Quando alcança o ponto de parada, o Scilab avalia a linha
-            especificada, imprime o número da linha e da função.
-            Então, o Scilab entra em modo <literal>pause</literal> no qual o usuário
-            pode verificar os valores correntes. O <literal>pause</literal> é
-            cancelado com <literal>resume</literal> ou <literal>abort</literal>.
-            Redefinir a função não limpa pontos de parada, o usuário deve deletar os
-            pontos de parada explicitamente usando <literal>delbpt</literal>. O número
-            máximo de funções com pontos de parada habilitados deve ser menor que 100
-            e o número máximo de pontos de parada é 1000.
-        </para>
-    </refsection>
-    <refsection>
-        <title>Exemplos</title>
-        <programlisting role="example"><![CDATA[
-setbpt('foo'),setbpt('foo',10),dispbpt()
-delbpt()
-
-setbpt('foo',[1,2,5,6]),dispbpt()
- ]]></programlisting>
-    </refsection>
-    <refsection role="see also">
-        <title>Ver Também</title>
-        <simplelist type="inline">
-            <member>
-                <link linkend="delbpt">delbpt</link>
-            </member>
-            <member>
-                <link linkend="dispbpt">dispbpt</link>
-            </member>
-            <member>
-                <link linkend="pause">pause</link>
-            </member>
-            <member>
-                <link linkend="resume">resume</link>
-            </member>
-        </simplelist>
-    </refsection>
-</refentry>
diff --git a/scilab/modules/core/help/ru_RU/debugging/delbpt.xml b/scilab/modules/core/help/ru_RU/debugging/delbpt.xml
deleted file mode 100644 (file)
index 04cdf9e..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="delbpt" xml:lang="ru">
-    <refnamediv>
-        <refname>delbpt</refname>
-        <refpurpose>удаление точек останова</refpurpose>
-    </refnamediv>
-    <refsynopsisdiv>
-        <title>Последовательность вызова</title>
-        <synopsis>delbpt([macroname [,linenumb]])</synopsis>
-    </refsynopsisdiv>
-    <refsection>
-        <title>Аргументы</title>
-        <variablelist>
-            <varlistentry>
-                <term>macroname</term>
-                <listitem>
-                    <para>строковая переменная, имя функции</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>linenumb</term>
-                <listitem>
-                    <para>целочисленный скаляр или вектор, номера строк</para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
-    </refsection>
-    <refsection>
-        <title>Описание</title>
-        <para>
-            Удаляет точки останова на строке <literal>linenumb</literal> в функции 
-            <literal>macroname</literal>.
-        </para>
-        <para>
-            <literal>linenumb</literal> может быть вектором-строкой или вектором-столбцом номеров строк или скаляром, единственным номером строки.
-        </para>
-        <para>
-            Номера строк в <literal>linenumb</literal> являются <emphasis>физическими</emphasis> номерами строк в функции <literal>macroname</literal>. Заметьте, что версии Scilab до 5.0 использовали 
-            <emphasis>логические</emphasis> номера строк. Разность между физическими и логическими номерами строк равна числу  <emphasis>строк продолжения</emphasis> 
-            (см. <link linkend="dot">dot</link>).
-        </para>
-        <para>
-            Если <literal>linenumb</literal> пропущено, то удаляются все точки останова в функции <literal>macroname</literal>.
-        </para>
-        <para>
-            Если пропустить как <literal>macroname</literal> так и <literal>linenumb</literal>, то удаляются все точки останова во всех функциях.
-        </para>
-    </refsection>
-    <refsection>
-        <title>Примеры</title>
-        <programlisting role="example"><![CDATA[ 
-setbpt('foo',1),setbpt('foo',10),delbpt('foo',10),dispbpt()
-delbpt('foo',1),dispbpt()
-setbpt('foo1',4),setbpt('foo1',9),setbpt('foo2',6),setbpt('foo3',8),dispbpt()
-delbpt('foo2'),dispbpt()
-delbpt(),dispbpt()
-delbpt('foo',[1,2,5,6]),dispbpt()
- ]]></programlisting>
-    </refsection>
-    <refsection role="see also">
-        <title>Смотрите также</title>
-        <simplelist type="inline">
-            <member>
-                <link linkend="setbpt">setbpt</link>
-            </member>
-            <member>
-                <link linkend="dispbpt">dispbpt</link>
-            </member>
-            <member>
-                <link linkend="pause">pause</link>
-            </member>
-            <member>
-                <link linkend="resume">resume</link>
-            </member>
-            <member>
-                <link linkend="abort">abort</link>
-            </member>
-        </simplelist>
-    </refsection>
-</refentry>
diff --git a/scilab/modules/core/help/ru_RU/debugging/dispbpt.xml b/scilab/modules/core/help/ru_RU/debugging/dispbpt.xml
deleted file mode 100644 (file)
index f97d8d8..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="dispbpt" xml:lang="ru">
-    <refnamediv>
-        <refname>dispbpt</refname>
-        <refpurpose>выводит на экран точки останова</refpurpose>
-    </refnamediv>
-    <refsynopsisdiv>
-        <title>Последовательность вызова</title>
-        <synopsis>dispbpt()</synopsis>
-    </refsynopsisdiv>
-    <refsection>
-        <title>Описание</title>
-        <para>
-            <code>dispbpt()</code> выводит на экран все активные точки останова, введённые на
-            данный момент в функции.
-        </para>
-        <para>
-            Номера строк, выводимые <code>dispbpt()</code>, являются
-            номерами <emphasis>физических</emphasis> строк в упомянутых функциях. 
-            Заметьте, что версии Scilab до 5.0 показывали номера <emphasis>логических</emphasis> 
-            строк. Разность между количеством физических и логических строк равна количеству <emphasis>продолженных</emphasis> строк (см. <link linkend="dot">точка</link>).
-        </para>
-    </refsection>
-    <refsection>
-        <title>Примеры</title>
-        <programlisting role="example"><![CDATA[
-setbpt('foo')
-setbpt('foo',10)
-dispbpt()
-delbpt()
-setbpt('foo',[1,2,5,6])
-dispbpt()
- ]]></programlisting>
-    </refsection>
-    <refsection role="see also">
-        <title>Смотрите также</title>
-        <simplelist type="inline">
-            <member>
-                <link linkend="setbpt">setbpt</link>
-            </member>
-            <member>
-                <link linkend="delbpt">delbpt</link>
-            </member>
-            <member>
-                <link linkend="pause">pause</link>
-            </member>
-            <member>
-                <link linkend="resume">resume</link>
-            </member>
-            <member>
-                <link linkend="abort">abort</link>
-            </member>
-        </simplelist>
-    </refsection>
-</refentry>
diff --git a/scilab/modules/core/help/ru_RU/debugging/setbpt.xml b/scilab/modules/core/help/ru_RU/debugging/setbpt.xml
deleted file mode 100644 (file)
index 39ee51c..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="setbpt" xml:lang="ru">
-    <refnamediv>
-        <refname>setbpt</refname>
-        <refpurpose>установка точек останова</refpurpose>
-    </refnamediv>
-    <refsynopsisdiv>
-        <title>Последовательность вызова</title>
-        <synopsis>setbpt(macroname [,linenumb])</synopsis>
-    </refsynopsisdiv>
-    <refsection>
-        <title>Аргументы</title>
-        <variablelist>
-            <varlistentry>
-                <term>macroname</term>
-                <listitem>
-                    <para>string</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>linenumb</term>
-                <listitem>
-                    <para>
-                        целочисленный скаляр или вектор целых чисел
-                    </para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
-    </refsection>
-    <refsection>
-        <title>Описание</title>
-        <para>
-            <function>setbpt</function> интерактивно вставляет точку останова в строку с номером
-            <varname>linenumb</varname> (по умолчанию номер 1) функции с именем
-            <varname>macroname</varname>.
-        </para>
-        <para>
-            <varname>linenumb</varname> может быть вектор-строкой или вектор-столбцом или скаляром, указывающим номер строки.
-        </para>
-        <para>
-            Номера строк в <varname>linenumb</varname> являются номерами
-            <emphasis>физических</emphasis> строк в функции с именем <varname>macroname</varname>.
-            Заметьте, что Scilab до версии 5.0 использовал номера <emphasis>логических</emphasis> строк. Разница между номерами физических и логических строк равна количеству  <emphasis>продолженных
-                строк
-            </emphasis>
-            (см. <link linkend="dot">dot</link>).
-        </para>
-        <para>
-            Когда достигается точка останова, Scilab выполняет определённую физическую строку и
-            останавливает ход выполнения. Затем Scilab переходит в
-            режим <link linkend="pause">pause</link>, в котором пользователь может проверить текущие
-            значения. Из режима  <link linkend="pause">pause</link> можно выйти с помощью <link linkend="resume">resume</link> или <link linkend="abort">abort</link>.
-        </para>
-        <para>
-            Переопределение функции не очищает точки останова. Пользователь должен явно удалить точки
-            останова с помощью <link linkend="delbpt">delbpt</link>. Максимальное число функций с
-            включёнными точками останова не должно превышать 100, а общее число точек останова равно
-            1000.
-        </para>
-    </refsection>
-    <refsection>
-        <title>Примеры</title>
-        <programlisting role="example"><![CDATA[
-setbpt('foo')
-setbpt('foo',10)
-dispbpt()
-delbpt()
-setbpt('foo',[1,2,5,6])
-dispbpt()
- ]]></programlisting>
-    </refsection>
-    <refsection role="see also">
-        <title>Смотрите также</title>
-        <simplelist type="inline">
-            <member>
-                <link linkend="delbpt">delbpt</link>
-            </member>
-            <member>
-                <link linkend="dispbpt">dispbpt</link>
-            </member>
-            <member>
-                <link linkend="pause">pause</link>
-            </member>
-            <member>
-                <link linkend="resume">resume</link>
-            </member>
-            <member>
-                <link linkend="abort">abort</link>
-            </member>
-            <member>
-                <link linkend="quit">quit</link>
-            </member>
-        </simplelist>
-    </refsection>
-</refentry>
index 6be5485..0e72cff 100644 (file)
@@ -68,5 +68,6 @@ CPP_GATEWAY_PROTOTYPE(sci_funptr);
 CPP_GATEWAY_PROTOTYPE(sci_analyzeroptions);
 CPP_GATEWAY_PROTOTYPE(sci_macr2tree);
 CPP_GATEWAY_PROTOTYPE(sci_predef);
+CPP_GATEWAY_PROTOTYPE(sci_debug);
 
 #endif /* __CORE_GW_HXX__ */
index 1e30902..8be409b 100644 (file)
@@ -30,9 +30,6 @@ C_GATEWAY_PROTOTYPE(C2F(sci_predef));
 int C2F(sci_clearfun)(char *fname, unsigned long fname_len);
 int C2F(sci_funptr)(char *fname, unsigned long fname_len);
 //int C2F(sci_macr2lst)(char *fname, unsigned long fname_len);
-int C2F(sci_setbpt)(char *fname, unsigned long fname_len);
-int C2F(sci_delbpt)(char *fname, unsigned long fname_len);
-int C2F(sci_dispbpt)(char *fname, unsigned long fname_len);
 int C2F(sci_whereis)(char *fname, unsigned long fname_len);
 int C2F(sci_where)(char *fname, void* pvApiCtx);
 int C2F(sci_havewindow)(char *fname, unsigned long fname_len);
index 7ed90b3..5b2b646 100644 (file)
@@ -17,7 +17,7 @@
 #include <atomic>
 
 #include "exp.hxx"
-#include "execvisitor.hxx"
+#include "runvisitor.hxx"
 
 extern "C"
 {
@@ -27,7 +27,7 @@ extern "C"
 class CORE_IMPEXP Runner
 {
 public :
-    Runner(ast::Exp* _theProgram, ast::ExecVisitor *_visitor)
+    Runner(ast::Exp* _theProgram, ast::RunVisitor *_visitor)
     {
         m_theProgram = _theProgram;
         m_visitor = _visitor;
@@ -35,7 +35,7 @@ public :
         m_isInterruptible = true;
     }
 
-    Runner(ast::Exp* _theProgram, ast::ExecVisitor *_visitor, bool _isConsoleCommand, bool _isInterruptible)
+    Runner(ast::Exp* _theProgram, ast::RunVisitor *_visitor, bool _isConsoleCommand, bool _isInterruptible)
     {
         m_theProgram = _theProgram;
         m_visitor = _visitor;
@@ -49,7 +49,7 @@ public :
         delete m_visitor;
     }
 
-    ast::ExecVisitor *getVisitor()
+    ast::RunVisitor *getVisitor()
     {
         return m_visitor;
     }
@@ -71,7 +71,7 @@ public :
 
 private :
     ast::Exp* m_theProgram;
-    ast::ExecVisitor* m_visitor;
+    ast::RunVisitor* m_visitor;
     bool m_isConsoleCommand;
     bool m_isInterruptible;
 
@@ -87,9 +87,9 @@ public:
     static bool isRunnerAvailable(void);
     static bool isInterruptibleCommand(void);
     static void setInterruptibleCommand(bool _isInterruptible);
-    static void execAndWait(ast::Exp* _theProgram, ast::ExecVisitor *_visitor,
+    static void execAndWait(ast::Exp* _theProgram, ast::RunVisitor *_visitor,
                             bool _isInterruptible, bool _isPrioritary, bool _isConsoleCommand);
-    static void exec(ast::Exp* _theProgram, ast::ExecVisitor *_visitor);
+    static void exec(ast::Exp* _theProgram, ast::RunVisitor *_visitor);
 
 private:
     static std::atomic<Runner*> m_RunMe;
index 519a5ba..1d3f61b 100644 (file)
@@ -49,7 +49,7 @@ void printAstTask(ast::Exp *tree, bool timed);
 ** Execute the stored AST.
 */
 void execAstTask(ast::Exp *tree, bool serialize, bool timed, bool ASTtimed, bool execVerbose,
-                 bool _isInterruptibleThread, bool _isPrioritaryThread, bool _isConsoleCommand);
+    bool _isInterruptibleThread, bool _isPrioritaryThread, bool _isConsoleCommand);
 
 /*
 ** Exec Tree with original visitor ( without template )
@@ -71,4 +71,13 @@ void dumpStackTask(bool timed);
 */
 void execScilabStartTask(bool _bSerialize);
 void execScilabQuitTask(bool _bSerialize);
+
+#ifdef __cplusplus
+extern "C"
+{
+    ast::Exp* parseCommand(std::wstring _command);
+}
+#endif
+
+
 #endif /* !__TASKS_HXX__ */
index 28fa47c..4cf2a52 100644 (file)
@@ -61,5 +61,6 @@ int CoreModule::Load()
     symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"analyzerOptions", &sci_analyzeroptions, MODULE_NAME));
     symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"macr2tree", &sci_macr2tree, MODULE_NAME));
     symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"predef", &sci_predef, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"debug", &sci_debug, MODULE_NAME));
     return 1;
 }
index 8212f93..9647fa4 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -80,7 +80,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../../libs/intl;../../../functions_manager/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../console/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../jvm/src/c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../../libs/intl;../../../functions_manager/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../console/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../ast/includes/parse;../../../jvm/src/c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;CORE_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../../libs/intl;../../../functions_manager/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../console/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../jvm/src/c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../../libs/intl;../../../functions_manager/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../console/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../ast/includes/parse;../../../jvm/src/c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;CORE_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../../libs/intl;../../../functions_manager/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../console/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../jvm/src/c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../../libs/intl;../../../functions_manager/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../console/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../ast/includes/parse;../../../jvm/src/c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CORE_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../../libs/intl;../../../functions_manager/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../console/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../jvm/src/c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../../libs/intl;../../../functions_manager/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../console/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../ast/includes/parse;../../../jvm/src/c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CORE_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
     <ClCompile Include="sci_lasterror.cpp" />
     <ClCompile Include="sci_pause.cpp" />
     <ClCompile Include="sci_quit.cpp" />
+    <ClCompile Include="sci_debug.cpp" />
     <ClCompile Include="sci_typename.cpp" />
     <ClCompile Include="sci_warning.cpp" />
     <ClCompile Include="sci_where.cpp" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
+</Project>
\ No newline at end of file
index 29d87ca..d3bac59 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
     <Filter Include="Source Files">
     <ClCompile Include="sci_predef.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="sci_debug.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\includes\banner.hxx">
     <Library Include="..\..\..\..\bin\libintl.lib" />
     <Library Include="..\..\..\..\bin\libxml2.lib" />
   </ItemGroup>
-</Project>
+</Project>
\ No newline at end of file
index 3b4817d..0e933ef 100644 (file)
@@ -14,6 +14,7 @@
 #include "core_gw.hxx"
 #include "function.hxx"
 #include "configvariable.hxx"
+#include "scilabexception.hxx"
 
 extern "C"
 {
diff --git a/scilab/modules/core/sci_gateway/cpp/sci_debug.cpp b/scilab/modules/core/sci_gateway/cpp/sci_debug.cpp
new file mode 100644 (file)
index 0000000..e487d3f
--- /dev/null
@@ -0,0 +1,661 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2015 - Scilab Enterprises - Antoine ELIAS
+ *
+ *  This file must be used under the terms of the CeCILL.
+ *  This source file is licensed as described in the file COPYING, which
+ *  you should have received as part of this distribution.  The terms
+ *  are also available at
+ *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#include "core_gw.hxx"
+#include "function.hxx"
+#include "string.hxx"
+#include "printvisitor.hxx"
+#include "execvisitor.hxx"
+#include "debuggervisitor.hxx"
+#include "configvariable.hxx"
+#include "debugmanager.hxx"
+#include "threadId.hxx"
+
+extern "C"
+{
+#include "Scierror.h"
+#include "sciprint.h"
+#include "Thread_Wrapper.h"
+}
+
+typedef enum EnumCommand
+{
+    AbortCommand,
+    BreakCommand,
+    ContinueCommand,
+    DisableCommand,
+    DeleteCommand,
+    EnableCommand,
+    HelpCommand,
+    ListCommand,
+    NextCommand,
+    QuitCommand,
+    ShowCommand,
+    StepInCommand,
+    StepOutCommand,
+    UnknowCommand,
+    WhereCommand
+};
+
+const char fname[] = "debug";
+
+void print_help();
+EnumCommand getCommand(const std::wstring& command);
+
+types::Function::ReturnValue sci_debug(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    if (in.size() == 0)
+    {
+        //debugger already active
+        if (ConfigVariable::getEnableDebug())
+        {
+            return types::Function::OK;
+        }
+
+        //debugger can be lauch only on console scope level
+        if (symbol::Context::getInstance()->getScopeLevel() != SCOPE_CONSOLE)
+        {
+            Scierror(999, _("%s: Debugger can be activated only at console scope level\n"), fname);
+            return types::Function::Error;
+        }
+
+        ConfigVariable::setEnableDebug(true);
+        ConfigVariable::setDefaultVisitor(new ast::DebuggerVisitor());
+        return types::Function::OK;
+    }
+
+    if (ConfigVariable::getEnableDebug() == false)
+    {
+        Scierror(999, _("%s: Debugger is not running. Call \"%s\" without parameter first.\n"), fname, fname);
+        return types::Function::Error;
+    }
+
+    int iRhs = (int)in.size();
+    for (int i = 0; i < iRhs; i++)
+    {
+        if (in[i]->isString() == false || ((types::String*)in[i])->isScalar() == false)
+        {
+            Scierror(999, _("%s: Wrong type for input argument #%d: A string expected.\n"), fname, i + 1);
+            return types::Function::Error;
+        }
+    }
+
+    debugger::DebuggerMagager* manager = debugger::DebuggerMagager::getInstance();
+
+    std::wstring command(((types::String*)in[0])->get(0));
+    switch (getCommand(command))
+    {
+        case AbortCommand:
+        {
+            if (iRhs > 1)
+            {
+                Scierror(999, _("%s: Wrong number of input arguments: %d expected.\n"), "abort", 0);
+                return types::Function::Error;
+            }
+
+            //abort
+            if (manager->isInterrupted())
+            {
+                manager->abort();
+            }
+            else
+            {
+                sciprint("debugger is not paused\n");
+            }
+
+            return types::Function::OK;
+        }
+        case BreakCommand:
+        {
+            if (iRhs < 2 || iRhs > 4)
+            {
+                Scierror(999, _("%s: Wrong number of input arguments: %d to %d expected.\n"), "breakpoint", 1, 3);
+                return types::Function::Error;
+            }
+
+            //breakpoint
+            wchar_t* pwstFunctionName = NULL;
+            int iLine = -1;
+            wchar_t* pwstCondition = NULL;
+            debugger::Breakpoint* bp = NULL;
+            //function name
+            if (iRhs > 1)
+            {
+                //do not check name
+                //we can set breakpoint before function declaration
+                //for embedded function for example
+                pwstFunctionName = ((types::String*)in[1])->get(0);
+            }
+
+            if (iRhs > 2)
+            {
+                wchar_t* pwstLineNumber = ((types::String*)in[2])->get(0);
+                wchar_t* pwstEnd = NULL;
+                iLine = wcstol(pwstLineNumber, &pwstEnd, 10);
+                if (pwstEnd == NULL || *pwstEnd != 0)
+                {
+                    Scierror(999, _("%s: Wrong value for input argument #%d: Scalar positive integer expected.\n"), "breakpoint", 2);
+                    return types::Function::Error;
+                }
+            }
+
+            if (iRhs > 3)
+            {
+                pwstCondition = ((types::String*)in[3])->get(0);
+                bp = new debugger::Breakpoint(pwstFunctionName, iLine, pwstCondition);
+            }
+            else
+            {
+                bp = new debugger::Breakpoint(pwstFunctionName, iLine);
+            }
+
+            manager->addBreakPoint(bp);
+            return types::Function::OK;
+        }
+        case ContinueCommand:
+        {
+            if (iRhs > 1)
+            {
+                Scierror(999, _("%s: Wrong number of input arguments: %d expected.\n"), "continue", 0);
+                return types::Function::Error;
+            }
+
+            //continue
+            if (manager->isInterrupted())
+            {
+                manager->resume();
+            }
+            else
+            {
+                sciprint("debugger is not paused\n");
+            }
+
+            return types::Function::OK;
+        }
+        case DisableCommand:
+        {
+            if (iRhs > 2)
+            {
+                Scierror(999, _("%s: Wrong number of input arguments: %d to %d expected.\n"), "disable", 0, 1);
+                return types::Function::Error;
+            }
+
+            //disable
+            if (iRhs == 2)
+            {
+                wchar_t* pEnd = NULL;
+                int iBp = (int)wcstol(((types::String*)in[1])->get(0), &pEnd, 10);
+                if (pEnd == NULL || *pEnd != 0)
+                {
+                    Scierror(999, _("%s: Wrong value for input argument #%d: Scalar positive integer expected.\n"), "disable", 1);
+                    return types::Function::Error;
+                }
+
+                if (manager->getBreakPoint(iBp) == NULL)
+                {
+                    Scierror(999, _("%s: Unable to retrieve information about breakpoint %d.\n"), "disable", iBp);
+                    return types::Function::Error;
+                }
+
+                manager->disableBreakPoint(iBp);
+            }
+            else
+            {
+                manager->disableAllBreakPoints();
+            }
+
+            return types::Function::OK;
+        }
+        case DeleteCommand :
+        {
+            if (iRhs > 2)
+            {
+                Scierror(999, _("%s: Wrong number of input arguments: %d to %d expected.\n"), "delete", 0, 1);
+                return types::Function::Error;
+            }
+
+            //delete
+            if (iRhs == 2)
+            {
+                wchar_t* pEnd = NULL;
+                int iBp = (int)wcstol(((types::String*)in[1])->get(0), &pEnd, 10);
+                if (pEnd == NULL || *pEnd != 0)
+                {
+                    Scierror(999, _("%s: Wrong value for input argument #%d: Scalar positive integer expected.\n"), "disable", 1);
+                    return types::Function::Error;
+                }
+
+                if (manager->getBreakPoint(iBp) == NULL)
+                {
+                    Scierror(999, _("%s: Unable to retrieve information about breakpoint %d.\n"), "delete", iBp);
+                    return types::Function::Error;
+                }
+
+                manager->removeBreakPoint(iBp);
+            }
+            else
+            {
+                manager->removeAllBreakPoints();
+            }
+
+            return types::Function::OK;
+        }
+        case EnableCommand:
+        {
+            if (iRhs > 2)
+            {
+                Scierror(999, _("%s: Wrong number of input arguments: %d to %d expected.\n"), "enable", 0, 1);
+                return types::Function::Error;
+            }
+
+            //enable
+            if (iRhs == 2)
+            {
+                wchar_t* pEnd = NULL;
+                int iBp = (int)wcstol(((types::String*)in[1])->get(0), &pEnd, 10);
+                if (pEnd == NULL || *pEnd != 0)
+                {
+                    Scierror(999, _("%s: Wrong value for input argument #%d: Scalar positive integer expected.\n"), "enable", 1);
+                    return types::Function::Error;
+                }
+
+                if (manager->getBreakPoint(iBp) == NULL)
+                {
+                    Scierror(999, _("%s: Unable to retrieve information about breakpoint %d.\n"), "enable", iBp);
+                    return types::Function::Error;
+                }
+
+                manager->enableBreakPoint(iBp);
+            }
+            else
+            {
+                manager->enableAllBreakPoints();
+            }
+
+            return types::Function::OK;
+        }
+        case HelpCommand:
+        {
+            if (iRhs > 1)
+            {
+                Scierror(999, _("%s: Wrong number of input arguments: %d expected.\n"), "help", 0);
+                return types::Function::Error;
+            }
+
+            //help
+            print_help();
+            return types::Function::OK;
+        }
+        case ListCommand:
+        {
+            if (iRhs > 1)
+            {
+                Scierror(999, _("%s: Wrong number of input arguments: %d expected.\n"), "list", 0);
+                return types::Function::Error;
+            }
+
+            if (manager->isInterrupted())
+            {
+                std::wostringstream ostr;
+                ast::PrintVisitor pp(ostr, true, true, true);
+                manager->getExp()->accept(pp);
+                sciprint(_("%ls"), ostr.str().data());
+            }
+            else
+            {
+                sciprint("debugger is not paused\n");
+            }
+            return types::Function::OK;
+        }
+        case StepInCommand:
+        {
+            if (iRhs > 1)
+            {
+                Scierror(999, _("%s: Wrong number of input arguments: %d expected.\n"), "stepin", 0);
+                return types::Function::Error;
+            }
+
+            if (manager->isInterrupted())
+            {
+                manager->setStepIn();
+                manager->resume();
+            }
+            return types::Function::OK;
+        }
+        case NextCommand:
+        {
+            if (iRhs > 1)
+            {
+                Scierror(999, _("%s: Wrong number of input arguments: %d expected.\n"), "next", 0);
+                return types::Function::Error;
+            }
+
+            if (manager->isInterrupted())
+            {
+                manager->setStepNext();
+                manager->resume();
+            }
+            else
+            {
+                sciprint("debugger is not paused\n");
+            }
+            return types::Function::OK;
+        }
+        case StepOutCommand:
+        {
+            if (iRhs > 1)
+            {
+                Scierror(999, _("%s: Wrong number of input arguments: %d expected.\n"), "stepout", 0);
+                return types::Function::Error;
+            }
+
+            //need to level to go stepout
+            if (manager->isInterrupted())
+            {
+                manager->setStepOut();
+                manager->resume();
+            }
+            else
+            {
+                sciprint("debugger is not paused\n");
+            }
+            return types::Function::OK;
+        }
+        case QuitCommand:
+        {
+            if (iRhs > 1)
+            {
+                Scierror(999, _("%s: Wrong number of input arguments: %d expected.\n"), "quit", 0);
+                return types::Function::Error;
+            }
+
+            //quit : disable debugger + abort + quit
+            ConfigVariable::setEnableDebug(false);
+            ConfigVariable::setDefaultVisitor(new ast::ExecVisitor());
+            manager->abort();
+            manager->sendQuit();
+            return types::Function::OK;
+        }
+        case ShowCommand:
+        {
+            if (iRhs > 2)
+            {
+                Scierror(999, _("%s: Wrong number of input arguments: %d to %d expected.\n"), "show", 0, 1);
+                return types::Function::Error;
+            }
+
+            sciprint("% 3ls % 7ls %24ls % 5ls %ls\n\n", L"num", L"enable", L"function name", L"line", L"condition");
+
+            if (iRhs > 1)
+            {
+                wchar_t* pEnd = NULL;
+                int iBp = (int)wcstol(((types::String*)in[1])->get(0), &pEnd, 10);
+                if (pEnd == NULL || *pEnd != 0)
+                {
+                    Scierror(999, _("%s: Wrong value for input argument #%d: Scalar positive integer expected.\n"), "disable", 1);
+                    return types::Function::Error;
+                }
+
+                debugger::Breakpoint* bp = manager->getBreakPoint(iBp);
+                if (bp == NULL)
+                {
+                    Scierror(999, _("%s: Unable to retrieve information about breakpoint %d.\n"), "showbreakpoint", iBp);
+                    return types::Function::Error;
+                }
+
+                if (bp->isMacro())
+                {
+                    std::wstring condition = bp->getCondition();
+                    sciprint("% 3d % 7s %24ls % 5d %ls\n", iBp, bp->isEnable() ? "true" : "false", bp->getFunctioName().c_str(), bp->getMacroLine(),
+                             condition.size() < 30 ? condition.c_str() :
+                             (std::wstring(condition.begin(), condition.begin() + 27) + L"...").c_str());
+                }
+            }
+            else
+            {
+                debugger::Breakpoints bps = manager->getAllBreakPoint();
+                debugger::Breakpoints::iterator it = bps.begin();
+                for (int i = 0; it != bps.end(); ++it, ++i)
+                {
+                    debugger::Breakpoint* bp = *it;
+                    if (bp->isMacro())
+                    {
+                        std::wstring condition = bp->getCondition();
+                        sciprint("% 3d % 7s %24ls % 5d %ls\n", i, bp->isEnable() ? "true" : "false", bp->getFunctioName().c_str(), bp->getMacroLine(),
+                                 condition.size() < 30 ? condition.c_str() :
+                                 (std::wstring(condition.begin(), condition.begin() + 27) + L"...").c_str());
+                    }
+                }
+            }
+
+            return types::Function::OK;
+        }
+        case WhereCommand:
+        {
+            if (iRhs > 1)
+            {
+                Scierror(999, _("%s: Wrong number of input arguments: %d expected.\n"), "where", 0);
+                return types::Function::Error;
+            }
+
+            if (manager->isInterrupted() == false)
+            {
+                sciprint("debugger is not paused\n");
+                return types::Function::OK;
+            }
+
+            int curLine = (manager->getExp()->getLocation().first_line - ConfigVariable::getMacroFirstLines()) + 1;
+
+            //where
+            int i = 0;
+            sciprint("%s\n", _("callstack:"));
+
+            std::wostringstream ostr;
+            ast::PrintVisitor pp(ostr, true, true, true);
+            manager->getExp()->accept(pp);
+#define BT_PRINT "#%-5d%ls (line %d)\n"
+            sciprint("#%-5d%ls\n", 0, ostr.str().data());
+
+            ConfigVariable::WhereVector where = ConfigVariable::getWhere();
+            auto it1 = where.rbegin();
+            auto it2 = ++where.rbegin();
+
+            sciprint(_(BT_PRINT), 1, it2->m_name.data(), curLine);
+            ++it1;
+            ++it2;
+            for (int j = 2; it2 != where.rend(); it1++, it2++, j++)
+            {
+                sciprint(_(BT_PRINT), j, it2->m_name.data(), it1->m_line);
+            }
+
+            return types::Function::OK;
+        }
+
+        case UnknowCommand:
+        default :
+            break;
+    }
+
+    sciprint("Unknow command \"%ls\".\n\n", command.c_str());
+    sciprint("use 'h' for more information\n\n");
+    return types::Function::OK;
+}
+
+void print_help()
+{
+    //a,b,c,d,h,i,n,o,q,s,w
+
+    sciprint(_("debug commands : \n"));
+    sciprint("  help (h)          : %s.\n", _("show this help"));
+    sciprint("\n");
+    sciprint("  quit (q)          : %s.\n", _("stop debugging"));
+    sciprint("  where (w, bt)     : %s.\n", _("show callstack"));
+    sciprint("\n");
+    sciprint("  exec (e) cmd      : %s.\n", _("execute cmd"));
+    sciprint("  run (r) cmd       : %s.\n", _("execute cmd"));
+    sciprint("\n");
+    sciprint("  continue (c)      : %s.\n", _("continue execution"));
+    sciprint("  abort (a)         : %s.\n", _("abort execution"));
+    sciprint("  next (n)          : %s.\n", _("continue to next statement"));
+    sciprint("  stepin (i, in)    : %s.\n", _("step into function"));
+    sciprint("  stepout (o, out)  : %s.\n", _("step outside function"));
+    sciprint("\n");
+    sciprint("  breakpoint (break, b)\n     func [l [cond]]: %s.\n", _("set a breakpoint"));
+    sciprint("  delete (del)      : %s.\n", _("delete all breakpoints"));
+    sciprint("  delete (del) n    : %s.\n", _("delete a specific breakpoint"));
+    sciprint("  enable            : %s.\n", _("enable all breakpoints"));
+    sciprint("  enable n          : %s.\n", _("enable a specific breakpoint"));
+    sciprint("  disable           : %s.\n", _("disable all breakpoints"));
+    sciprint("  disable n         : %s.\n", _("disable a specific breakpoint"));
+    sciprint("  show (s)          : %s.\n", _("show all breakpoints"));
+    sciprint("  show (s) n        : %s.\n", _("show a specific breakpoint"));
+    sciprint("\n");
+    sciprint(_("  for more details, help debug.\n"));
+
+}
+
+EnumCommand getCommand(const std::wstring& command)
+{
+    wchar_t c = command[0];
+
+    switch (c)
+    {
+        case L'a':
+        {
+            if (command.size() == 1 || command == L"abort")
+            {
+                return AbortCommand;
+            }
+            break;
+        }
+        case 'b':
+        {
+            if (command.size() == 1 || command == L"break" || command == L"breakpoint")
+            {
+                return BreakCommand;
+            }
+
+            if (command == L"bt")
+            {
+                return WhereCommand;
+            }
+            break;
+        }
+        case L'c':
+        {
+            if (command.size() == 1 || command == L"continue")
+            {
+                return ContinueCommand;
+            }
+            break;
+        }
+        case L'd':
+        {
+            if (command == L"disable")
+            {
+                return DisableCommand;
+            }
+
+            if (command == L"del" || command == L"delete")
+            {
+                return DeleteCommand;
+            }
+            break;
+        }
+        case L'e':
+        {
+            if (command == L"enable")
+            {
+                return EnableCommand;
+            }
+            break;
+        }
+        case L'h':
+        {
+            if (command.size() == 1 || command == L"help")
+            {
+                return HelpCommand;
+            }
+            break;
+        }
+        case L'l':
+        {
+            if (command.size() == 1 || command == L"list")
+            {
+                return ListCommand;
+            }
+            break;
+        }
+        case L'i':
+        {
+            if (command.size() == 1 || command == L"in")
+            {
+                return StepInCommand;
+            }
+            break;
+        }
+        case L'n':
+        {
+            if (command.size() == 1 || command == L"next")
+            {
+                return NextCommand;
+            }
+            break;
+        }
+        case L'o':
+        {
+            if (command.size() == 1 || command == L"out")
+            {
+                return StepOutCommand;
+            }