Setting a value in a field in debug mode.

Hi

While debuging code in Intellij, I want to set a value(primitive data type) in a field and I want to continue debugging with the new value set in the field.

Also let me know when this value has be set. i.e., before/after we reach the specific field.

1 comment
Comment actions Permalink

While debuging code in Intellij, I want to set a
value(primitive data type) in a field and I want to
continue debugging with the new value set in the
field.


Set a breakpoint at a location where your field is visible. When stopped at that breakpoint, right click on the field in the Variables view and select 'Set Value...' from the context menu.

Also let me know when this value has be set. i.e.,
before/after we reach the specific field.


Right click on the field and select 'Toggle Field Watchpoint' from the context menu. In the Breakpoints dialog you can choose to watch field access and/or field modification.

0

Please sign in to leave a comment.