使用Eclipse跟蹤JDK代碼執行流程

使用Eclipse跟蹤JDK代碼執行流程


English Title:Use Eclipse dogs JDK code carries out flow
現在Eclipse的調試功能相當的強大,Breakpoint,Step Over & Step Into相結合就可以很方便地跟蹤代碼的執行流程,但有時候要跟蹤JDK提供的類的時,卻會遇到兩個問題: ??? 1、JDK自帶的src.zip裏源代碼並不完整,不能查看相關類的源文件(當然,喜歡的話可以反編譯)。譬如,以sun.開頭的包就不包含在src.zip這個壓縮包中。 ??? 解決辦法:下載完整的源文件包,調試時附加給Debugger 即可。 ???? 2、默認的 rt.jar沒有行號信息,雖然有源代碼,但是不能設置斷點。 ?? 解決辦法:下載Debug版的JDK,安裝以後將其設置爲Eclipse的默認JVM即可。 ?? JDK源文件很多,類之間關係相當複雜,跟蹤過程中往往會迷失在源碼的汪洋大海中,這時,設計模式的知識會派上用場,另外,跟蹤Java執行的五種方式 也是一份很好的參考。
==========English==========
Now of Eclipse those who debug a function to comparative is powerful, breakpoint, step Over&Union of Step Into photograph is OK very dog conveniently the executive flow of code, but want what JDK offers to dog occasionally kind when, can encounter two problems however: ? ? ? 1, the source code in the Src.zip that JDK takes oneself is not whole, cannot examine relevant kind source file (of course, if liking, can compile instead) . For example, with Sun. The bag of begin is not included in Src.zip this compresses a bag in. ? ? ? Settle way: Download whole source file package, when debugging, add Debugger can. ? ? ? ? 2, acquiescent Rt.jar does not have firm information, although have source code, but cannot install breakpoint. ? ? Settle way: Download the JDK of Debug edition, the acquiescent JVM that its the setting is Eclipse after installation can. ? ? JDK source file is very much, kind between the relation is quite complex, dog in the boundless ocean that often can be lost in the source in the process, at this moment, the knowledge that designs pattern is met the use on the clique, additional, dog 5 kinds of means that Java carries out also are a very good reference.
==========回覆|reply==========

==========English==========

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章