是否可以向我没有源代码的类添加断点?

发布于 2024-08-03 03:58:02 字数 115 浏览 5 评论 0原文

我想在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

忘东忘西忘不掉你 2024-08-10 03:58:02

如果打开大纲视图,您可以选择一个方法,右键单击并选择切换方法断点,只要命中该方法就会中断。

您可以从 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

孤独难免 2024-08-10 03:58:02

正如 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.

仅一夜美梦 2024-08-10 03:58:02

下载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.

感情废物 2024-08-10 03:58:02

我认为,这取决于该类是否使用调试信息进行编译。如果是这样,那么类文件包含元数据,例如调试器需要充分利用它的行号和参数名称。如果不是,那么调试器可以继续处理的信息就会减少。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文