views:

300

answers:

1

How can I easily detect when a variable changes value? I would like the execution of the program to break on the debugger whenever a specified variable changes value. Right now I'm using Eclipse's debugger.

+5  A: 

For a class or instance variable, right-click on the variable in the outline view and select "Toggle Watchpoint". Then, in the breapkoints view, you can right-click on the resulting entry, select "breakpoint properties" and deselect "Field Access".

Michael Borgwardt