是否可以向我没有源代码的类添加断点?
我想在 Eclipse 中的类中添加断点,但我没有它的源代码。是否可以在其中添加断点?就我而言,我实际上只需要知道何时调用方法。
(附带说明:有人有 j2ee_api_1_3.jar 的源代码吗?)
I want to add a breakpoint in a class in Eclipse, but I don't have the source code for it. Is it possible to add a breakpoint in it anyway? In my case I really only need to know when a method is called.
(As a side note: does anyone have the source code for j2ee_api_1_3.jar?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果打开大纲视图,您可以选择一个方法,右键单击并选择切换方法断点,只要命中该方法就会中断。
您可以从 Sun 的存档下载页面获取源代码
If you open the outline view, you can select a method, right-click and select Toggle Method Breakpoint, this will then break whenever the method is hit.
You may be able to get the sources from Sun's archive download page
正如 Rich 所提到的, 大纲视图(即使没有源也可用):
替代文本 http://help.eclipse.org/ganymede/topic/org.eclipse.platform.doc.user/images/ref-8.png
允许您设置 方法断点,即设置javac 编译了那些带有调试信息的类,包括“源代码信息”(就是这种情况 使用 J2EE1.4,不确定 J2EE1.3)
J2EE 1.3 应该可用 并包含在 下载中心 j2sdkee-1_3_1-win.exe 文件。
As mentioned by Rich, the outline view (available even without sources):
alt text http://help.eclipse.org/ganymede/topic/org.eclipse.platform.doc.user/images/ref-8.png
allows you to set method breakpoint, that is, provided javac compiled those classes with debug informations, including "Source Code information" (that is the case with J2EE1.4, not sure about J2EE1.3)
The source code of J2EE 1.3 should be available and be included with the download center j2sdkee-1_3_1-win.exe file.
下载jad反编译器/通过windows->preferences在eclipse中配置它的路径并打开需要下断点的类的源码-然后debug就可以正常运行并且可以看到变量中所有的变量信息看法。
Download jad decompiler /configure its path in eclipse through windows->preferences and open the source of the class where you need to place the breakpoint - and then debug can run as it does normally and you can see all the variable information in the variable view.
我认为,这取决于该类是否使用调试信息进行编译。如果是这样,那么类文件包含元数据,例如调试器需要充分利用它的行号和参数名称。如果不是,那么调试器可以继续处理的信息就会减少。
JavaEE 库因未将调试元数据编译到其中而臭名昭著。这可能非常令人沮丧。
It depends, I think, on whether the class was compiled with debug information. If so, then the class file contains meta-data such as line numbers and parameter names which the debugger needs to make a decent fist of it. If not, then the debugger has less information to go on.
JavaEE libraries are notorious for not having debug meta-data compiled into them. It can be quite frustrating.