Amoranemix
Amoranemix

Reputation: 11

How to debug Scilab scripts?

Is there a way in Scilab to debug a script that is in an sce file, like DrawCircle.sce ? Adding pauze commands inside a script more or less works, but the program is behaving so strangely, that I would like to be able to follow it step by step.

There is a debug mode, as explained in https://www.scilab.org/debugging-scilab-6, but the page fails to explain how to run the code in debug mode. The exec command only produces a complaint about a missing variable (the file or function name, e.g. DrawCircle) and the run command causes either the same or the program to freeze.

Is there a way to go through a script step by step from a breakpoint and if so, how ?

EDIT 8/5/21 :

Serge Steef explained how to run a program under the debugger. (Why isn't that explained in the help?)

How can I step through the program one line at a time ? If I set a breakpoint and then run the program under the debugger, Scilab freezes. There is a blue spinning circle for a mouse pointer, but no prompt. Then what ?

EDIT 22/5/21 :

Apparently that behaviour is a bug reported in march 2020 : https://bugzilla.scilab.org/show_bug.cgi?id=16363 I wonder what 'Status: RESOLVED FIXED' means. It seems to take a long time to fix that bug, or maybe it was fixed and then reintroduced.

Upvotes: 1

Views: 720

Answers (1)

Serge Steer
Serge Steer

Reputation: 446

You have first to tranform your script into a function without argument et load it into Scilab with "exec DrawCircle.sci"

then enter in the debug mode entering "debug" at the prompt then enter "break DrawCircle" to set a break point at the beginning enter "stepin" to enter into the function

Upvotes: 1

Related Questions