Java Eclipse 中不同断点图标的含义是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4079000/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 11:22:20  来源:igfitidea点击:

What different breakpoint icons mean in Eclipse?

javaeclipsedebuggingbreakpoints

提问by Fixpoint

When working with breakpoints in Eclipse I sometimes notice that they have different icons / annotations (markers on left sidebar). Sometimes it's just a blue ball, sometimes it has a checkmark on it and sometimes it is crossed. What do all these annotations mean?

在 Eclipse 中使用断点时,我有时会注意到它们有不同的图标/注释(左侧边栏上的标记)。有时它只是一个蓝色的球,有时上面有一个复选标记,有时它被交叉了。所有这些注释是什么意思?

采纳答案by sleske

  • blue ball: regular breakpoint, active (possibly with a hit count set)
  • empty ball (i.e. white): breakpoint has been disabled (remove checkmark in the breakpoint view, or disablein context menu)
  • diagonal line through breakpoint: all breakpoints have been disabled (button skip all breakpointsin breakpoint view)
  • question mark next to breakpoint: a condition is active for this breakpoint (look under properties of the breakpoint)
  • 蓝球:常规断点,活动(可能设置了命中次数)
  • 空球(即白色):断点已被禁用(在断点视图或disable上下文菜单中删除复选标记)
  • 通过断点的对角线:所有断点都已禁用(skip all breakpoints断点视图中的按钮)
  • 断点旁边的问号:此断点的条件处于活动状态(查看断点的属性)

回答by Tom Anderson

The tick means that the breakpoint has been successfully set. I think it may only appear when you're doing remote debugging; when you add a breakpoint, it starts out as a plain ball, but once the JPDA agent in the remote system has been told about it, and has confirmed it's set, then it gets a tick.

打勾表示断点设置成功。我认为它可能只有在您进行远程调试时才会出现;当你添加一个断点时,它开始是一个普通的球,但是一旦远程系统中的 JPDA 代理被告知它并确认它已设置,那么它就会得到一个滴答声。

回答by Honza Zidek

I have created an example code with explanation inline.

我已经创建了一个带有内联解释的示例代码。

public class Breakpoints {
    int field1; // watchpoint - suspend when field1 is read
    int field2; // watchpoint - suspend when field1 is written
    int field3; // watchpoint - suspend when field1 is read or written

    public void method() {
        int x;
        x = 10; // suspend before this line is executed 
        x = 11; // same as above but this breakpoint is temporarily disabled
        for (int i = 0; i < 100; i++) {
            x = i; // conditional breakpoint - suspend when i==5
        }
    }
}

Eclipse breakpoint icons

Eclipse 断点图标

Once you select Skip All Breakpointsin the Breakpoints view (Window | Show Viev | Debug | Breakpoints), all the icons become diagonally struck through like this:

Skip All Breakpoints在 Breakpoints 视图 ( Window | Show Viev | Debug | Breakpoints) 中选择后,所有图标都变成对角线,如下所示:

Eclipse breakpoint icons Skip All

Eclipse 断点图标 Skip All

回答by Ali Khan

Adding to earlier answers. The small white cover a green ballicon means that the breakpoint is at the class level.

添加到先前的答案。绿色球图标上的小白色c表示断点位于类级别。

Class Load Breakpoint

类加载断点

Eclipse Help

日食帮助

回答by rdj7

I think answer given by @sleske is explaining all things except for :

我认为@sleske 给出的答案解释了除以下内容之外的所有内容:

Blue Ball with Tick: Breakpoint is successfully set because Your Source code matches with the Byte Code and debug control will reach there.

Blue Ball with Tick: Breakpoint 成功设置,因为您的源代码与字节代码匹配,调试控制将到达那里。

Only Blue Ball: Source code differs from Byte code (May be you are running a older Snapshot of code). Control will never reach at this breakpoint. You will have to update your JARs to get control to these breakpoints.

只有蓝球:源代码与字节代码不同(可能您正在运行旧的代码快照)。控制永远不会到达这个断点。您必须更新 JAR 才能控制这些断点。

回答by Minilik

If you see a "T" on the blue ball, It means a triggering point for remote debugging enter image description here

如果看到蓝球上有一个“T”,表示远程调试的触发点 在此处输入图片说明