Debugging a preprocessing script
Describes the successive debugging steps.
This section covers the successive debugging steps:
Adding a breakpoint to a preprocessing script
You are going to add a breakpoint to set the debugging mode, then execute the script again, using this time the Debug button.
To add a breakpoint:
Examining the preprocessing call stack
The call stack, showing nested function calls, is displayed in the Debug view. The content of a selected call frame is displayed in the Variables view.
In this example, the call stack contains one call frame, [transp4.mod:67].
transp4.mod
[transp4.mod:67] (transp4.mod)
For a large tuple set, the values may not all be visible within the window. In this case, an ellipsis appears at the end of the cell. Pass the cursor over the column to display all the values in a tooltip.
or Step Into button
repeatedly to watch the value of the variables change in the call stack. The variables are highlighted when their values change.

Stepping out of an execute function
If you are stepping in an execute statement and the current instruction is within a loop (for, forall, while, or repeat), you can make the IDE execute the loop without stopping at instructions by stepping out of the execute function using the Step Return
button. The IDE executes the entire loop, then stops at the first instruction after the loop.
The Step Return button allows you to step out of a function in a script, to the statement following the function call. For example, if you were to click the Step Return button at this statement:
writeln("Routes":);
the current instruction becomes:
for (var r in Routes) {
execute function (transp4.mod)
Stepping into a function
The Step Into button
allows you to step into a function. Use it to step to:
the first statement, or
to the instruction after the current one if there is no function called.
printRoute(r) function, click the Step Into button.
The IDE executes the current instruction and the blue arrow in the margin moves to the first line in the function:
write(" ",r.p,":");
(transp4.mod)
Stepping out of a lower-level function
to execute the write and writeln statements, and step out of the printRoute(r) function.
The current instruction becomes:
for (var r in Routes) {
because the loop iteration is completed and so the next instruction is the loop statement.
(transp4.mod)
Monitoring a function in a loop
printRoute(r) function, click the Step Into button
repeatedly. The routes appear one at a time in the Scripting log.
Note that the Step Into button can continue iterating through the loop as well as stepping into the function. When the loop is completed, the statement is also complete and so the model is solved.
At any point you can continue execution to the end of the script without stopping by clicking the Resume button
in the Debug view.

to execute the instruction.