Try OpenEdge Now
skip to main content
Debugging and Troubleshooting
OpenEdge Debugger : Debugger Window and Files : Debugger dialog boxes : New Breakpoint dialog box : Setting a watchpoint
 
Setting a watchpoint
You can set a watchpoint to interrupt program execution when the value of a variable, buffer field, or attribute reference changes.
To add a watchpoint:
1. In the New Breakpoint dialog box, choose the Watchpoint tab.
2. Type the name of a variable, buffer field, object attribute, or object reference in the Expression field. You can optionally add a condition in the Condition field.
Note: A watchpoint requires a watchpoint expression. If you do not enter an expression and click OK, an error message appears in an alert box.
3. Click OK to create the watchpoint.
Watchpoints appear in the Breakpoints dialog box as "When expression changes [and condition]". The third and fourth items in the following figure are watchpoints.
Figure 28. Watchpoint example
Entering a watchpoint automatically creates a watch for the watchpoint expression. If you leave the Add Watch toggle checked, the Debugger displays the watch in the Watches pane of the Debugger's main window. You can uncheck the Add Watch toggle box to override this behavior (Add Watch is checked by default). The Debugger shows the current value of all watches each time the Debugger gains control of the application.
Note: The watch and watchpoint are not connected to each other. Deleting the watchpoint does not delete the watch. Deleting the watch does not delete the watchpoint.
If the watchpoint expression or condition is invalid, the Debugger creates the watchpoint and displays an error message. In this case, edit the watchpoint and correct the mistake. If you do not fix the watchpoint before continuing program execution, the AVM generates an error when it gains control (via Step Into, Step Over, Continue, etc.) and disables the watchpoint.