Breakpoints in JRE System Library in Eclipse

戏子无情 提交于 2019-12-19 19:52:50

问题


I tried to make breakpoint in the class from JRE System Library, but when I started debug I recieved message: "Unable to install breakpoint at ... due to missing line number attributes. Modify compiler options to generate line number attributes." So what should I do: recompile JRE System Library from sources with debug information and use it? Or there is some more simple way?


回答1:


So, the most simple way - to use JDK instead of JRE. In this case we can use breakpoints in system library. BUT we cant monitor values of local variables. For this purpose we should recompile rt.jar (without sun.* packets, because they are proprietary). Process of recompilation described there. It's in russian, but at the and of article situated the link to the result rt-dbg.jar.




回答2:


You just have to enable some compiler options. Right click your project and select Properties. Go to Java Compiler and enable the checkboxes Add line number to generated class files (used by the debugger) and the other ones.




回答3:


The simplest thing to do is get the equivalent JDK and target that instead.



来源:https://stackoverflow.com/questions/7107930/breakpoints-in-jre-system-library-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!