Page 748 - ExtendSim User Guide
P. 748

Debugging Tools
Debugging equations
over, into, or out of functions, and to stop the run. (These buttons are explained fully in the Developer Reference.)
• TheCallChainpaneattheupperlefttellswherecontrolisinthechainofcommand.Itisnot used for debugging equations unless there are blocks in the model that have debugging code.
The “if” statement has not yet executed. To watch the statement execute:
Repeatedly click the Step Over button at the top of the Debugger window; the button is shown on the right. Alternatively, use the right arrow to step over the function.
The green arrow in the Source pane indicates the flow of the code; the Variables pane shows the change in value for the variables.
☞ Hovering the cursor over a variable in the Source pane will also show its current value.
Getting to the overflow calculation
The next step is to set a breakpoint to find out when the overflow value first gets calculated.
In the Debugger window:
Remove the first breakpoint by clicking its red circle
Add a new breakpoint at the “overflow = con- tents...” line
Click the Continue button at the top of the Debugger window. or use Shift+right arrow.
Although the breakpoint is set at the overflow calculation line, the green arrow indicates that the calculation has not yet been performed. Thus the overflow value will not be current.
In order to see the current overflow value:
Click the Step Over button to execute that line of code. The calculated overflow value is shown in the Variables pane.
Setting a conditional breakpoint
Conditional breakpoints cause a calculation to break only when the overflow value is calculated and within a specified range or specific value. The Breakpoints window is for setting breakpoint condi- tions. It allows you to:
• See which breakpoints have been set and where they have been set
• Add conditions to a breakpoint
• Clickabreakpoint’sredcircletodisableorenableanybreakpoint,withoutdeletingit.(In place of the red circle, disabled breakpoints have an open circle.)
• Delete a breakpoint by selecting it’s name and clicking the Delete or Backspace key
Debugger window breaking at first overflow
Breakpoint window
How To

   746   747   748   749   750