To control the execution of your application, you set breakpoints, which are places where the code should pause and call the debugger. You can set a breakpoint at design time or at run time. Remember that in general not all processes reach the breakpoint – some of them may stop at communication points or just pass the line containing breakpoint.
NOTE: You can set a breakpoint at run time only when all processes are stopped.
To set a breakpoint
In the Text Editor window, move the insertion point to the line of code where you want to set a breakpoint and right-click in the selection margin.
From the context menu choose:
Add breakpoint. The Breakpoint dialog appears.
In the dialog:
Select or enter a filename you want to set a breakpoint in.
Enter number of the line where you want to set a breakpoint. By default there will be number of the current line.
Enter conditional expression. Each time when your program reaches a breakpoint the expression is evaluated, and your program stops only if the condition is TRUE. (See also Changing breakpoint condition). By default the field is empty. In this context an empty condition expression is always TRUE.
Enter "ignore count" of a breakpoint. "ignore count" is number of times to skip a breakpoint before stopping. For example, if the ignore count value is N, the breakpoint does not stop the next N times your program reaches it. By default the ignore count value is 0. (See also Setting "ignore count" of a breakpoint)
- or –
Debug Object manager. The Debug Object manager dialog appears. In the Breakpoints tab click Add. The Breakpoint dialog appears. Follow the instruction from the previous item. Another way to display the Debug Object manager dialog is to click Edit -> Breakpoints.
When you set a breakpoint, a dot is displayed in the selection margin of the Text Editor window next to the line containing the breakpoint. The dot is red if the breakpoint is enabled and gray if disabled.