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.
请先登录再写评论。
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.
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.