Breakpoints can be set on source code by opening the source file and clicking on the breakpoint margin to the left of a line of source code. Right-clicking on the breakpoint margin will display a context menu with additional breakpoint operations and options. In Wing Pro, the Breakpoints tool in the Tools menu can be used to view, modify, or remove defined breakpoints.
Alternatively, the Debug menu or the toolbar's breakpoint icons can be used to set or clear breakpoints at the current line of source (where the insertion cursor or selection is located).
In Wing Pro, the following types of breakpoints are available:
- Regular -- A regular breakpoint will always cause the debugger to stop on a given line of code, whenever that code is reached.
- Conditional -- A conditional breakpoint contains an expression that is evaluated each time the breakpoint is reached. The debugger will stop only if the conditional evaluates to True (any non-zero, non-empty, non-None value, as defined by Python). You may edit the condition of any existing breakpoint with the Edit Breakpoint Condition... item in the Breakpoint Options group of the Debug menu, by right clicking on the breakpoint, or in the Breakpoints tool.
- Temporary -- A temporary breakpoint will be removed automatically after the first time it is encountered. No record of the breakpoint is retained for future debug runs.
Once breakpoints have been defined, you can operate on them in a number of ways to alter their behavior. These operations are available as menu items in the Debug menu, in the breakpoint margin's context menu, and from the Breakpoints tool:
- Ignore Count -- It is possible to set an ignore count for a breakpoint. In this case, the breakpoint will be ignored the given number of times, and the debugger will only stop at the breakpoint if it is encountered more than the set number of times. The ignore count is reset to its original value with each new debug run. Use the Breakpoint tool to monitor the remaining number of times a breakpoint will be ignored.
- Disable/Enable -- Breakpoints can be temporarily disabled and subsequently re-enabled. Any disabled breakpoint will be ignored until re-enabled.
The Breakpoints tool, available in the Tools menu displays a list of all currently defined breakpoints. The following columns of data are provided:
- Enabled -- Checked if the breakpoint is enabled. The checkbox can be used to alter the breakpoint's state.
- Location -- The file and line number where the breakpoint is located
- Condition -- The conditional that must be true for the breakpoint to cause the debug process to stop (or blank if the breakpoint is not conditional). This value can be changed by clicking on it and editing it directly on the list.
- Temporary -- Checked if the breakpoint is a temporary (one-time) breakpoint. The checkbox can be used to alter the breakpoint's type.
- Ignores -- The number of times the breakpoint should be ignored before it causes the debugger to stop. This value can be changed by clicking on it and editing it directly on the list.
- Ignores Left -- The number of ignores left for a breakpoint, if a debug process exists.
- Hits -- The number of times the breakpoint has been reached in the current debug run (if any).
To visit the file and line number where a breakpoint is located, double click on it in the list or select Show Breakpoint from the context menu obtained by right-clicking on the surface of the Breakpoints tool. Additional options are also available from this context menu.
Keyboard Modifiers for Breakpoint Margin
Clicking on the breakpoint margin will toggle to insert a regular breakpoint or remove an existing breakpoint. You can also shift-click to insert a conditional breakpoint, and control-click to insert a breakpoint and set an ignore count for it.
When a breakpoint is already found on the line, shift-click will disable or enable it, control-click will set its ignore count, and shift-control-click will set or edit the breakpoint conditional.