It's not possible with the debugger to not execute parts of the code.
It is however possible to execute extra code and change values on variables so if you need to exclude one row from execution during debug you will have to alter your code to prepare for that kind of debugging.
public void someMethod() {
int a = 3;
int b = 2;
boolean shouldRun = true;
if (shouldRun) {
a = b + 2;
}
System.out.prinln(a);
}
You would then set a break point that changes the value of shouldRun without stopping execution. It can be done like this.
Note that
- Suspend isn't checked
- Log evaluated expression is used to alter a variable when the break point is hit
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…