Feature Showcase: Using Conditional Breakpoints


Conditional breakpoints are used to pause the debugger when specific events occur, such as when a variable equals a certain value, an exception occurs, or a function completes execution. This showcase uses a variable in the Perl sample program; on the Projects menu, select Sample Project, then double-click perl_sample.pl in the Project Manager.

Invoke the Breakpoint Properties dialog box (Debug|Add\Edit Breakpoint).




On the Conditional tab, configure a breakpoint as shown. The break will occur on line 50 when the $sum variable is equal to $11.75.




The breakpoint is displayed on the margin of the program file, and on the Breakpoints tab.




Run the debugger. Execution pauses on line 50, when the $sum variable is equal to $11.75.