1.基本快捷键:
(1) F5:单步跳入。进入本行代码中执行。
(2) F6:单步跳过。执行本行代码,跳到下一行。
(3) F7:单步返回。跳出方法。
(4) F8:继续。执行到下一个断点,如果没有断点了,就执行到结束。
(5) Ctrl+R:执行到光标所在的这一行。
2.调试步骤:
(1)eclipse中,单击Window->Open Perspective->Debug
打开调试视图。
(2)设置断点,在要设置断点的位置前面,双击标有行数前面的部分,可快捷设置断点。
(3)调试的快捷键是F11,单步调试,进入函数快捷键为F5,不进入函数快捷键F6,一般调试都不进入函数,当函数出现问题时,再进入函数。
(4)在指定位置进行调试,使用快捷键为F8的Resume功能。
(5)通过将鼠标移到变量处,可以查看此时变量的值。
3.条件断点
条件断点,一般用于循环语句中,debug调试技巧。
设置断点->在断点上右击:Beakpoint Properties ->conditional√->输入条件:1==6(从i=6开始调试)->OK->step into F5