为什么我的Eclipse项目有幻影调试器断点? [英] Why does my Eclipse project have phantom debugger breakpoints?

查看:138
本文介绍了为什么我的Eclipse项目有幻影调试器断点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小项目,当在Eclipse调试器中运行时,似乎总是在FileInputStream.class行106中停止打开文件。没有设置断点,但是Eclipse的行为就好像我在这里有一个断点。如果我清除所有断点,它仍然会发生。



我在同一个Eclipse工作空间中有一个更大的项目,不会遇到这个问题。

我刚刚将较小的项目从我的旧Linux机器上移除,我在欧司川Eclipse中开发了这个项目,并将这个问题出现在我的新Windows机器上,我继续看到这个问题Ganymede Eclipse。这个问题仍然存在于操作系统和Eclipse版本之间,但显然不是跨项目。我不明白我通过这个项目的目录中的每个文件,找不到任何可能是文件的文件,指导Eclipse停止在FileInputStream中。



更多信息:明显的断点实际上不是FileInputStream的第106行;它似乎是FileNotFoundException的异常断点,从FileInputStream中的该行调用的本机代码抛出。但是再一次,我根本看不出有任何断点。是否将异常断点定义在其他位置?

解决方案

您是否尝试取消选择

 窗口>首选项> Java>调试:暂停执行未捕获的异常

? (如已被剥离


为了设置断点,使用旧的API,客户端需要Java模型对象 - 例如 IType IField 等。

使用新的API,调试模型所需的所有内容都是类型名称,字段名称等。



当Java模型对象不可用时,这允许客户端设置断点。

客户端现在指定将断点与(在我们限制到相关的Java模型资源之前)。



断点现在也可以是隐藏。也就是说,它们不需要在断点管理器中注册。

还可以选择性地保留断点(只允许所有标记/标记类型不保留)。

使调试模型更加灵活,并为客户提供更多的构建块。



这也简化了我们的Java调试实现的一些部分 - 例如,功能暂停任何未捕获的异常,只需为名为 java.lang.Throwable 的类型设置断点,而不是特定的 IType 在特定的项目中

断点未注册到断点管理器(即隐藏) - 它只是已知和使用一个客户端

另一个例子是运行到线路断点 IJavaRunToLineBreakpoint 已被删除,因为不再需要其特殊功能。现在,Java调试ui只是创建一个隐藏的,不持续的断点,并且命中数为1.这是向客户端提供构建块的一个例子。



I've got a small project which, when run in the Eclipse debugger, always seems to stop in FileInputStream.class line 106, where files are opened. There are no breakpoints set, but Eclipse behaves exactly as if I have a breakpoint here. If I clear all breakpoints, it still happens.

I have a second much-larger project in the same Eclipse workspace which does not suffer from this problem.

I just moved the smaller project off of my old Linux machine, where I developed it in Europa Eclipse and had this problem, onto my new Windows machine, where I continue to see the problem in Ganymede Eclipse. The problem persists across operating systems and across Eclipse versions, yet apparently not across projects. I don't get it! I grepped through every file in this project's directory and couldn't find anything that might be a file somehow directing Eclipse to stop in FileInputStream.

Further info: the apparent breakpoint is actually not for line 106 of FileInputStream; it appears to be an Exception breakpoint for FileNotFoundException, being thrown from native code called from that line in FileInputStream. But again, I don't appear to have any breakpoints set at all. Are Exception breakpoints defined somewhere else?

解决方案

Did you try to un-select

Window > Preferences > Java > Debug : Suspend execution on uncaught exceptions

? (as mentioned in this thread, for instance)

Why does Eclipse work that way?

It goes back to 2002, when the breakpoint object hierarchy has been stripped down.

In order to set a breakpoint, with the old API, a client required Java Model Objects - such as IType, IField, etc.
With the new API, all that is required by the debug model is type names, field names, etc.

This allows clients to set breakpoints when Java Model Objects are not available.
Clients now specify the resource to associate a breakpoint with (before we constrained it to the associated Java Model resources).

Breakpoints can now also be "hidden". That is, they need not be registered with the breakpoint manager.
Breakpoints can also be selectively persisted (markers only allowed all/none of a marker type to be persisted).
This makes the debug model more flexible, and gives clients more building blocks.

This has also simplified some part of our Java debug implementation - for example, the feature "suspend on any uncaught exception", simply sets a breakpoint for the type named "java.lang.Throwable", rather than a specific IType in a specific project.
The breakpoint is not registered with the breakpoint manager (i.e. hidden) - it is only known and used by one client.
Another example is the "run to line breakpoint". The IJavaRunToLineBreakpoint has been removed, as its special functionality is no longer required. Now, the Java debug ui simply creates a "line breakpoint" that is hidden, non persisted, and has a hit count of 1. This is an example of providing building blocks to clients.

这篇关于为什么我的Eclipse项目有幻影调试器断点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆