Setting and Modifying Source Breakpoints
From Delphi for PHP Documentation Wiki
Summary: Explains how to set and modify breakpoints.
Breakpoints pause program execution at a certain location or when a particular condition occurs. You can set breakpoints in the "Code Editor" before or during a debugging session. During a debugging session, any line of code that is eligible for a breakpoint is marked with a blue dot
in the left gutter of the "Code Editor".
To set a breakpoint
- Click the left gutter of the "Code Editor" next to the line of code where you want to pause execution.
- Choose Run
Add Breakpoint
Source Breakpoint to display the "Add Source Breakpoint" dialog box.
| Tip: |
To widen the "Code Editor" gutter, choose Tools |
- Fill in the appropriate values and click "OK".
The breakpoint icon
is used in the "Code Editor" gutter to represent breakpoints.
Breakpoints are displayed in the "Breakpoint List" window. To modify a breakpoint
- Right-click the breakpoint icon and choose
Breakpoint Properties.
- Set the options in the "Source Breakpoint Properties" dialog box to modify the breakpoint. For example, you can set a condition, create a breakpoint group, or determine what action occurs when execution reaches the breakpoint.
- Click "Help" for more information about the options on the dialog box.
- Click "OK".
To create a conditional breakpoint
- Choose Run
Add Breakpoint
Source Breakpoint to display the "Add Source Breakpoint" dialog box.
- In the "Line number" field, enter the line in the "Code Editor" where you want set the breakpoint.
| Tip: |
To pre-fill the "Line number" field, click a line in the "Code Editor" prior to opening the "Add Source Breakpoint" dialog box. |
- In the "Condition" field, enter a conditional expression to be evaluated each time this breakpoint is encountered during program execution.
- Click "OK".
Conditional breakpoints are useful when you want to see how your program behaves when a variable falls into a certain range or what happens when a particular flag is set.
If the conditional expression evaluates to true (or not zero), the debugger pauses the program at the breakpoint location. If the expression evaluates to false (or zero), the debugger does not stop at the breakpoint location.
To change the color of the text at the execution point and breakpoints
- Choose Tools
Options
Editor Options
Color.
- In the code sample window, select the appropriate language tab. For example, to change the breakpoint color for Delphi for PHP code, select the Delphi for PHP tab.
- Scroll the code sample window to display the execution and breakpoint icons in the left gutter of the window.
- Click anywhere on the execution point or breakpoint line that you want to change.
- Use the "Foreground Color "and "Background Color" drop-down lists to change the colors associated with the selected execution point or breakpoint.
- Click "OK

