Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.1 - English

Change language to:
Français - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Scilab Help >> Scilab > Debugging > debug

debug

Debugging environment in Scilab

Syntax

debug()

Description

Use to debug Scilab script. After call of debug(), you enter in debug mode. This mode allows you to manage breakpoints, launch execution with stop on error, execute script step by step, ... In debugging mode, the prompt is debug>.

Commands:
h:

Show always the debuger help in the console, whatever is the Scilab running mode.

help:

In Scilab standard running mode (with GUIs), displays the debug() help page in the help browser. Otherwise, displays the help in the console (as with "h").

(q)uit:

Leave debug mode to return to normal mode of Scilab.

(w)here or bt:

Display callstack.

(e)xec or (r)un:

Execute command.

(d)isp var, or (p)rint var:

Display variable var.

(c)ontinue:

Continue execution.

(a)bort:

Abort execution.

step(n)ext or next:

Continue execution to next expression.

step(i)n or in:

Continue execution to next expression in sub function.

step(o)ut or out:

Continue execution to next expression in previous function.

(b)reakpoint or break:
breakpoint function [line [condition]]

Add a breakpoint in a function at line line

If a condition is specified, the breakpoint is enabled only if the condition is %t

(del)ete [n]:

Remove all breakpoints.

If n is specified, remove breakpoint #n

enable [n]:

Enable all breakpoints.

If n is specified, enable breakpoint #n

disable [n]:

Disable all breakpoints.

If n is specified, disable breakpoint #n

(s)how [n]:

Show all breakpoints information.

If n is specified, show breakpoint #n

Examples

//function to overload cosine 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
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

History

VersionDescription
6.0.0 New version: console interface to Scilab 6 debugger.
Report an issue
<< Debugging Debugging where >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Feb 12 19:26:46 CET 2018