Thursday, April 7, 2011

How to detect when a variable changes value

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.

From stackoverflow
  • 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".

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.