调试
断点类型:
There are four types of breakpoints:
-
Line breakpoints: suspend the program upon reaching the line of code where the breakpoint was set. This type of breakpoints can be set on any executable line of code.
-
Method breakpoints: suspend the program upon entering or exiting the specified method or one of its implementations, allowing you to check the method's entry/exit conditions.
-
Field watchpoints: suspend the program when the specified field is read or written to. This allows you to react to interactions with specific instance variables. For example, if at the end of a complicated process you are ending up with an obviously wrong value on one of your fields, setting a field watchpoint may help determine the origin of the fault.
-
Exception breakpoints: suspend the program when
Throwable
or its subclasses are thrown. They apply globally to the exception condition and do not require a particular source code reference.
监视变量变动
将插入光标放置到变量定义所在的行,Ctrl+F8,选择"Java Field Watchpoint",行首就会出现一个眼睛状的断点。