views:

24

answers:

1

Is there a setting to let the debugger in eclipse automatically pause when a variable or object changes?

+2  A: 

You can put a breakpoint on a field and set to break only when the field is changed.

alt text

nanda
Well, sort of. First, he'll want to uncheck "access", so only modifications are affected. Also, a field breakpoint (called a "watchpoint" in Eclipse parlance) will only catch modifications to the value of the field, not the object it points to. If you have a watchpoint on a field that holds an object, the debugger will stop when you assign an object that field. But if you call a method on that object which changes its state, the debugger won't catch that.
Ladlestein
I've bolded the statement for you :) The picture is for illustration only. And yes, internal changes are not covered with the solution. But given that the answer has been accepted, don't you think that's what OP want? :)
nanda