Eclipse调试技巧

工欲善其事必先利其器,掌握好 eclipse的调试技巧非常重要:

第一篇推荐文章:http://www.cnblogs.com/xitang/p/4238923.html

第二篇推荐文章:http://www.cnblogs.com/lingiu/p/3802391.html

尤其是其中的

0 条件断点。。 有时候有一堆循环,可能只关注其中某一次的调试结果,那就可以使用条件断点,设置conditional、

2和3. 可以 计算表达式的值 

Inspect

inspect用来查看某个表达式的之,对于变量值debug很容查看,但是对于一个表达式的值就不容易查看,还是这句:

this.getTradeDetail(uid, itemStr.subString(0,5))

想看getTradeDetail的值,就没法想看变量值一样(虽然这个很有可能是赋值给一个变量...),要看这种表达式值,就需要inspect,具体做法是选中这行表达式,然后右击->inspect,或者更方便的快捷键组合:ctrl+shift+i

7.Drop to Frame  这个功能可以使所有的调试回到方法的起点,不用重新界面设置一次条件,是非常好的功能。 不过它也是有使用条件的: Note this command is only available if the current VM supports drop to frame and the selected stackframe is not the top frame or a frame in a native method. 

猜你喜欢

转载自luckytyy.iteye.com/blog/2242092