Tuesday, April 12, 2011

Eclipse tip: Conditional breakpoints

Eclipse provides a very nice debugging environment. One of the features I use often is conditional breakpoints. It is essentially breakpoints which suspend code execution only when a specified condition is satisfied. For example you want to set a breakpoint inside a loop but only are interested when a certain variable is null. To specify a condition select ‘Breakpoint Properties…‘ in the context menu of the breakpoint.
Enable conditional breakpoint
Then check the ‘Enable Condition‘ and type away the condition in the text area below. The text area also provides code assistance.There is an option to suspend when the expression evaluates to true or when the value changes.
Conditional breakpoint

No comments:

Post a Comment