gpt4 book ai didi

eclipse - 为什么我的 Eclipse 项目有虚拟调试器断点?

转载 作者:行者123 更新时间:2023-12-03 05:22:30 25 4
gpt4 key购买 nike

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

我在同一个 Eclipse 工作区中有第二个更大的项目,它没有遇到这个问题。

我刚刚将较小的项目从我的旧 Linux 机器(我在 Europa Eclipse 中开发并遇到了这个问题)移到了我的新 Windows 机器上,在 Ganymede Eclipse 中我仍然看到该问题。该问题跨操作系统和跨 Eclipse 版本仍然存在,但显然不是跨项目。我不明白!我搜索了该项目目录中的每个文件,但找不到任何可能以某种方式指示 Eclipse 在 FileInputStream 中停止的文件。

更多信息:明显的断点实际上不是 FileInputStream 的第 106 行;它似乎是 FileNotFoundException 的异常断点,从 FileInputStream 中的该行调用的 native 代码抛出。但同样,我似乎根本没有设置任何断点。异常断点是否在其他地方定义?

最佳答案

您是否尝试取消选择

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

? (例如 mentioned in this thread )

alt text

为什么 Eclipse 会这样工作?

goes back to 2002 ,当断点对象层次结构被剥离时。

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 - 为什么我的 Eclipse 项目有虚拟调试器断点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/723199/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com