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++)
(*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++)
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 \
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 \
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 \
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 \
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 \
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
-runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
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 \
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 \
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 \
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) \
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)
@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@
@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
@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
@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
<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" />
<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" />
<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
StaticRunner_isInterruptibleCommand
StaticRunner_setInterruptibleCommand
StoreConsoleCommand
+parseCommand
\ No newline at end of file
#include <vector>
#include "visitor.hxx"
-#include "debugvisitor.hxx"
+#include "prettyprintvisitor.hxx"
#include "execvisitor.hxx"
#include "printvisitor.hxx"
#include "allexp.hxx"
PolymorphicMacroCache pmc;
ConstraintManager cm;
ConstantVisitor cv;
- ast::DebugVisitor dv;
+ ast::PrettyPrintVisitor dv;
ast::PrintVisitor pv;
std::vector<Result> multipleLHS;
logging::Logger logger;
//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());
return pv;
}
- inline ast::DebugVisitor & getDV()
+ inline ast::PrettyPrintVisitor & getDV()
{
return dv;
}
{
}
+
+ virtual ConstantVisitor* clone()
+ {
+ if (parent)
+ {
+ return new ConstantVisitor(parent);
+ }
+ else
+ {
+ return new ConstantVisitor(evalSymbols);
+ }
+ }
+
inline void print_info()
{
stop_chrono();
virtual ~GlobalsCollector() { }
+ virtual GlobalsCollector* clone()
+ {
+ return new GlobalsCollector(macrodef);
+ }
+
static void collect(MacroDef & macrodef);
const tools::SymbolOrdSet & getGlobals() const;
void print_info();
{
}
+ virtual LoopAnalyzer* clone()
+ {
+ return new LoopAnalyzer(seq->clone());
+ }
+
+
inline bool isAssigned(ast::Exp * e, const symbol::Symbol & sym) const
{
if (e)
{
}
+ virtual TestGVNVisitor* clone()
+ {
+ return new TestGVNVisitor();
+ }
+
inline void print_info()
{
//stop_chrono();
{
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;
}
--- /dev/null
+/*
+ * 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__ */
--- /dev/null
+/*
+ * 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__ */
--- /dev/null
+/*
+ * 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__ */
--- /dev/null
+/*
+ * 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
--- /dev/null
+/*
+ * 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__ */
protected:
DummyVisitor() {}
+ DummyVisitor* clone()
+ {
+ return new DummyVisitor();
+ }
+
virtual void visit(const MatrixExp &e)
{
exps_t lines = e.getLines();
{
class EXTERN_AST ExecVisitor : public RunVisitorT<ExecVisitor>
{
- void visit (const SeqExp &e)
+ ExecVisitor* clone()
+ {
+ return new ExecVisitor();
+ }
+
+ void visit(const SeqExp &e)
{
visitprivate(e);
}
}
~MacrovarVisitor() {}
+ MacrovarVisitor* clone()
+ {
+ return new MacrovarVisitor();
+ }
+
void visit (const MatrixLineExp &e);
void visit (const SimpleVar &e);
void visit(const OpExp &e);
+++ /dev/null
-/*
- * 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
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 :
{
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 :
int indent;
bool force_parenthesis;
const bool displayOriginal;
+ const bool headerOnly;
bool is_last_matrix_line;
bool is_last_column_comment;
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;
#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)
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();
}
/** \} */
+ //force devrived class to implement clone method
+ virtual GenVisitor* clone() = 0;
+
+
/** \name Visit Variable related nodes.
** \{ */
public:
}
}
+ inline bool isControlExp() const
+ {
+ return true;
+ }
+
};
} // namespace ast
#endif /* !AST_CONTROLEXP_HXX */
/** \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)
return false;
}
+ inline virtual bool isControlExp() const
+ {
+ return false;
+ }
+
inline virtual bool isIfExp() const
{
return false;
return _exps;
}
+
private:
bool _verbose;
bool _bBreak;
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;
}
}
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;
}
}
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());
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();
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
private:
- int64_t min, max;
+ int64_t _min, _max;
std::vector<Exp *> table;
std::vector<int64_t> keys;
{
_stop_on_first_error = false;
}
+
+ void releaseTmpFile();
/** \} */
+
private :
const std::wstring _file_name;
const std::wstring _prog_name;
_error_message.clear();
}
+ static void releaseTmpFile();
/*
** \brief This funnction returns the parsed code written
** at the given line.
#include <list>
#include <map>
#include <string>
-#include "callable.hxx"
-#include "threadId.hxx"
-#include "cell.hxx"
+#include "visitor.hxx"
extern "C"
{
#define ICONSOLELINES_MIN 0
#define ICONSOLEWIDTH_MIN 10
+namespace types
+{
+class Cell;
+class ThreadId;
+class Callable;
+}
+
class EXTERN_AST ConfigVariable
{
//module list
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();
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;
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__ */
typedef void(*dynlib_ptr)();
EXTERN_AST dynlib_ptr getEntryPointFromPosition(int position);
+EXTERN_AST int isEnableDebug();
+EXTERN_AST int isDebugInterrupted();
#endif /* !__CONFIGVARIABLE_INTERFACE_H__ */
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();
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
{
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()
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()
return m_pFunc;
}
-private :
+private:
GW_FUNC_OPT m_pFunc;
};
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()
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()
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();
int* m_piRetCount;
char* m_pstName;
int* m_pOutOrder;
- ast::ConstVisitor* m_pVisitor;
GatewayStruct() {};
~GatewayStruct() {};
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)
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, ... )*/
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();
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)
{
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);
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);
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) {}
/**
*/
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);
*/
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();
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();
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()
{
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
{
// 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)
*
*/
-#include "debugvisitor.hxx"
+#include "prettyprintvisitor.hxx"
#include "printvisitor.hxx"
#include "data/DataManager.hxx"
}
}
- //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;
--- /dev/null
+/*
+ * 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());
+}
+}
--- /dev/null
+/*
+ * 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())
+ {
+ }
+}
+}
+
--- /dev/null
+/*
+ * 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();
+}
+
+}
+++ /dev/null
-/*
-* 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*/)
-{
-}
-}
*
*/
-#include "debugvisitor.hxx"
+#include "prettyprintvisitor.hxx"
#ifdef _MSC_VER
#ifdef _MSC_VER
std::wostream& operator<<(std::wostream& os, const TermColor& c)
{
- if (DebugVisitor::colored == false)
+ if (PrettyPrintVisitor::colored == false)
{
return os;
}
#else
std::wostream& operator<<(std::wostream& os, const TermColor& c)
{
- if (DebugVisitor::colored == false)
+ if (PrettyPrintVisitor::colored == false)
{
return os;
}
#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)
{
*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)
{
*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();
}
}
-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);
END_NODE();
}
-void DebugVisitor::visit(const MatrixLineExp & e)
+void PrettyPrintVisitor::visit(const MatrixLineExp & e)
{
START_NODE(e);
print(e);
END_NODE();
}
-void DebugVisitor::visit(const CellExp & e)
+void PrettyPrintVisitor::visit(const CellExp & e)
{
START_NODE(e);
print(e);
END_NODE();
}
-void DebugVisitor::visit(const StringExp & e)
+void PrettyPrintVisitor::visit(const StringExp & e)
{
START_NODE(e);
std::wostringstream stream;
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;
END_NODE();
}
-void DebugVisitor::visit(const BoolExp & e)
+void PrettyPrintVisitor::visit(const BoolExp & e)
{
START_NODE(e);
std::wostringstream stream;
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;
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);
END_NODE();
}
-void DebugVisitor::visit(const FieldExp & e)
+void PrettyPrintVisitor::visit(const FieldExp & e)
{
START_NODE(e);
print(e);
END_NODE();
}
-void DebugVisitor::visit(const OpExp & e)
+void PrettyPrintVisitor::visit(const OpExp & e)
{
START_NODE(e);
print(e);
END_NODE();
}
-void DebugVisitor::visit(const LogicalOpExp & e)
+void PrettyPrintVisitor::visit(const LogicalOpExp & e)
{
START_NODE(e);
print(e);
END_NODE();
}
-void DebugVisitor::visit(const AssignExp & e)
+void PrettyPrintVisitor::visit(const AssignExp & e)
{
START_NODE(e);
print(e);
END_NODE();
}
-void DebugVisitor::visit(const CellCallExp & e)
+void PrettyPrintVisitor::visit(const CellCallExp & e)
{
START_NODE(e);
print(e);
END_NODE();
}
-void DebugVisitor::visit(const CallExp & e)
+void PrettyPrintVisitor::visit(const CallExp & e)
{
START_NODE(e);
print(e);
END_NODE();
}
-void DebugVisitor::visit(const IfExp & e)
+void PrettyPrintVisitor::visit(const IfExp & e)
{
START_NODE(e);
print(e);
END_NODE();
}
-void DebugVisitor::visit(const TryCatchExp & e)
+void PrettyPrintVisitor::visit(const TryCatchExp & e)
{
START_NODE(e);
print(e);
END_NODE();
}
-void DebugVisitor::visit(const WhileExp & e)
+void PrettyPrintVisitor::visit(const WhileExp & e)
{
START_NODE(e);
print(e);
END_NODE();
}
-void DebugVisitor::visit(const ForExp & e)
+void PrettyPrintVisitor::visit(const ForExp & e)
{
START_NODE(e);
print(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);
END_NODE();
}
-void DebugVisitor::visit(const SelectExp & e)
+void PrettyPrintVisitor::visit(const SelectExp & e)
{
START_NODE(e);
print(e);
END_NODE();
}
-void DebugVisitor::visit(const CaseExp & e)
+void PrettyPrintVisitor::visit(const CaseExp & e)
{
START_NODE(e);
print(e);
END_NODE();
}
-void DebugVisitor::visit(const SeqExp & e)
+void PrettyPrintVisitor::visit(const SeqExp & e)
{
START_NODE(e);
print(e);
END_NODE();
}
-void DebugVisitor::visit(const ArrayListExp & e)
+void PrettyPrintVisitor::visit(const ArrayListExp & e)
{
START_NODE(e);
print(e);
END_NODE();
}
-void DebugVisitor::visit(const AssignListExp & e)
+void PrettyPrintVisitor::visit(const AssignListExp & e)
{
START_NODE(e);
print(e);
END_NODE();
}
-void DebugVisitor::visit(const NotExp & e)
+void PrettyPrintVisitor::visit(const NotExp & e)
{
START_NODE(e);
print(e);
END_NODE();
}
-void DebugVisitor::visit(const TransposeExp & e)
+void PrettyPrintVisitor::visit(const TransposeExp & e)
{
START_NODE(e);
print(e);
END_NODE();
}
-void DebugVisitor::visit(const VarDec & e)
+void PrettyPrintVisitor::visit(const VarDec & e)
{
std::wstring sym, name;
sym = L"Symbol";
END_NODE();
}
-void DebugVisitor::visit(const FunctionDec & e)
+void PrettyPrintVisitor::visit(const FunctionDec & e)
{
START_NODE(e);
print(e);
END_NODE();
}
-void DebugVisitor::visit(const ListExp &e)
+void PrettyPrintVisitor::visit(const ListExp &e)
{
START_NODE(e);
print(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);
END_NODE();
}
-void DebugVisitor::visit(const DAXPYExp &e)
+void PrettyPrintVisitor::visit(const DAXPYExp &e)
{
START_NODE(e);
print(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);
}
}
*ostr << SCI_CLOSE_TEST << " ";
*ostr << SCI_THEN << std::endl;
+
+ if (headerOnly)
+ {
+ return;
+ }
+
++indent;
if (displayOriginal)
{
void PrintVisitor::visit (const TryCatchExp &e)
{
*ostr << SCI_TRY << std::endl;
+
+ if (headerOnly)
+ {
+ return;
+ }
+
++indent;
if (displayOriginal)
{
e.getTest().accept(*this);
}
*ostr << SCI_CLOSE_TEST << " " << SCI_DO << std::endl;
+
+ if (headerOnly)
+ {
+ return;
+ }
+
++indent;
if (displayOriginal)
{
}
*ostr << SCI_CLOSE_TEST << " ";
*ostr << SCI_DO << std::endl;
+
+ if (headerOnly)
+ {
+ return;
+ }
+
++indent;
if (displayOriginal)
{
}
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
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
{
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)
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)
{
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)
{
#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"
#include "macrofile.hxx"
#include "macro.hxx"
+#include "cell.hxx"
#include "filemanager_interface.h"
#include "runner.hxx"
{
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
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)
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
{
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)
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>;
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;
types::typed_list in;
types::typed_list out;
types::optional_list opt;
- ast::ExecVisitor exec;
in.push_back(pH);
in.push_back(pS);
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;
*
*/
+#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
}
*
*/
-#include <stdio.h>
+#include <algorithm>
#include "types_subtraction.hxx"
#include "types_opposite.hxx"
if (fileLocker)
{
fclose(fileLocker);
+ fileLocker = nullptr;
}
errno_t err;
if (fileLocker)
{
fclose(fileLocker);
+ fileLocker = nullptr;
}
yyin = fopen(szFile, "w");
fwrite(command, 1, len, yyin);
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;
*
*/
+#include <algorithm>
#include "libraries.hxx"
namespace symbol
*
*/
+#include <algorithm>
#include "variables.hxx"
namespace symbol
#include "configvariable.hxx"
#include "macrofile.hxx"
#include "threadmanagement.hxx"
+#include "execvisitor.hxx"
+#include "threadId.hxx"
+#include "cell.hxx"
+#include "callable.hxx"
extern "C"
{
** \{
*/
-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)
{
m_Where.pop_back();
}
-const std::vector<ConfigVariable::WhereEntry>& ConfigVariable::getWhere()
+const ConfigVariable::WhereVector& ConfigVariable::getWhere()
{
return m_Where;
}
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)
// 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
/*
** \}
*/
+
+//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();
+}
*/
#include "configvariable.hxx"
+#include "debugmanager.hxx"
extern "C"
{
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)
{
return ConfigVariable::getForceQuit();
}
+
+int isEnableDebug()
+{
+ return ConfigVariable::getEnableDebug() ? 1 : 0;
+}
+
+int isDebugInterrupted()
+{
+ return debugger::DebuggerMagager::getInstance()->isInterrupted() ? 1 : 0;
+}
/*
- * 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"
{
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)
/* 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)
void clearTMPDIR()
{
char * tmpdir = getTMPDIR();
+ Parser parser;
+ parser.releaseTmpFile();
removedir(tmpdir);
FREE(tmpdir);
}
+
}
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)
{
#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();
try
{
- Ret = call(in, opt, _iRetCount, out, &execFunc);
+ Ret = call(in, opt, _iRetCount, out);
ConfigVariable::where_end();
}
catch (ast::InternalError & ie)
*
*/
+#include <algorithm>
#include <sstream>
#include <math.h>
#include "symbol.hxx"
*
*/
+#include <algorithm>
#include <sstream>
#include <vector>
#include "function.hxx"
}
-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)
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)
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)
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];
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)
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)
{
}
/*call function*/
- if (m_pFunction->call(in, opt, _iRetCount, out, execFunc) != OK)
+ if (m_pFunction->call(in, opt, _iRetCount, out) != OK)
{
return Error;
}
//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;
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)
{
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;
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)
{
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;
}
#include "symbol.hxx"
#include "scilabWrite.hxx"
#include "configvariable.hxx"
-#include "mutevisitor.hxx"
#include "serializervisitor.hxx"
extern "C"
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;
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);
}
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
{
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)
{
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.
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());
}
// 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;
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();
*/
#include <sstream>
+#include <algorithm>
#include "core_math.h"
#include "tostring_common.hxx"
#include "singlepoly.hxx"
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)
{
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)
{
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)
{
}
}
- 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)
#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"
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)
{
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)
{
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
{
}
catch (ast::InternalError & /*se*/)
{
- ret = Overload::call(L"%l_e", in, 1, out, &execFunc);
+ ret = Overload::call(L"%l_e", in, 1, out);
}
}
//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();
}
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);
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];
}
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;
// 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;
}
/*** 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);
#undef SCIPROMPT
#endif
#define SCIPROMPT "--> "
+#define SCIPROMPTDEBUG "debug> "
+#define SCIPROMPTBREAK "break> "
#ifdef SCIPROMPT_PAUSE
#undef SCIPROMPT_PAUSE
/*------------------------------------------------------------------------*/
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)
{
*
*/
+#include <algorithm>
#include "configvariable.hxx"
#include "threadmanagement.hxx"
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);
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/ \
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 \
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/ \
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)
@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@
@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 $@ $<
<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>
<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>
+++ /dev/null
-<?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>
+++ /dev/null
-<?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>
+++ /dev/null
-<?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>
<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>
+++ /dev/null
-<?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>
+++ /dev/null
-<?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>
+++ /dev/null
-<?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>
+++ /dev/null
-<?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>
+++ /dev/null
-<?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>
+++ /dev/null
-<?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>
+++ /dev/null
-<?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>
+++ /dev/null
-<?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>
+++ /dev/null
-<?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>
CPP_GATEWAY_PROTOTYPE(sci_analyzeroptions);
CPP_GATEWAY_PROTOTYPE(sci_macr2tree);
CPP_GATEWAY_PROTOTYPE(sci_predef);
+CPP_GATEWAY_PROTOTYPE(sci_debug);
#endif /* __CORE_GW_HXX__ */
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);
#include <atomic>
#include "exp.hxx"
-#include "execvisitor.hxx"
+#include "runvisitor.hxx"
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;
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;
delete m_visitor;
}
- ast::ExecVisitor *getVisitor()
+ ast::RunVisitor *getVisitor()
{
return m_visitor;
}
private :
ast::Exp* m_theProgram;
- ast::ExecVisitor* m_visitor;
+ ast::RunVisitor* m_visitor;
bool m_isConsoleCommand;
bool m_isInterruptible;
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;
** 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 )
*/
void execScilabStartTask(bool _bSerialize);
void execScilabQuitTask(bool _bSerialize);
+
+#ifdef __cplusplus
+extern "C"
+{
+ ast::Exp* parseCommand(std::wstring _command);
+}
+#endif
+
+
#endif /* !__TASKS_HXX__ */
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;
}
-<?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">
<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
-<?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
#include "core_gw.hxx"
#include "function.hxx"
#include "configvariable.hxx"
+#include "scilabexception.hxx"
extern "C"
{
--- /dev/null
+/*
+ * 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;
+ }