Eclipse 在不存在的断点处停止
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7178096/
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
Eclipse stops at non-existent breakpoint
提问by Geoff
I have an Eclipse (java) project which stops at non-existent breakpoints. There was a breakpoint at this location at one time, but I removed it. Any ideas why this would be happening?
我有一个 Eclipse (java) 项目,它在不存在的断点处停止。曾经在这个位置有一个断点,但我把它删除了。任何想法为什么会发生这种情况?
Note: It is not the same issue mentioned here - phantom breakpoint driving me crazy!
注意:这不是这里提到的同一个问题 -幻影断点让我发疯!
采纳答案by Heisenbug
If you are sure that there aren't breakpoints (Run > Remove All Breakpoints), then there are 2 things to consider:
如果您确定没有断点(运行 > 删除所有断点),则需要考虑两件事:
- You are misunderstanding something of how the debugger works.
- Your program is stopped because it's waiting for some input.
- 您误解了调试器的工作原理。
- 您的程序已停止,因为它正在等待某些输入。
回答by Suraj Chandran
I have suffered this. To fix it, just goto Run->Remove All Breakpointsin the menu. It will remove it. Later you can redefine your required breakpoints again.
我受过这样的苦。要修复它,只需转到菜单中的运行->删除所有断点。它会删除它。稍后您可以再次重新定义所需的断点。
回答by katana0815
Eclipse possibly stops because of an uncaught exception. To fix this:
Eclipse 可能由于未捕获的异常而停止。要解决此问题:
- handle the exception
- Preferences -> Java -> Debug > Suspend execution on uncaught exceptions (in this menu there are more settings to suspend execution!)
- 处理异常
- Preferences -> Java -> Debug > Suspend execution on uncaught exceptions (在这个菜单中有更多暂停执行的设置!)
I got this information from: https://stackoverflow.com/a/723313/944440
我从以下位置获得此信息:https: //stackoverflow.com/a/723313/944440
回答by Roshan Kumar
I had same issue, I am using eclipse Mars. In my case I fixed it differently. Steps:
我有同样的问题,我正在使用 eclipse Mars。在我的情况下,我以不同的方式修复它。脚步:
I opened breakpoint tab (you will see this if you are in debug perspective)
I saw there were two breakpoints enabled for the same line of code one of them was already unchecked but another was checked
I unchecked it and now it does not stop anymore.
我打开了断点选项卡(如果您处于调试角度,您会看到这个)
我看到为同一行代码启用了两个断点,其中一个已取消选中,但另一个已选中
我取消选中它,现在它不再停止。
回答by Maayan Hope
The problem is that eclipse stops in your "removed" break-point in an other thread. So if you have, for example 10 threads, and the debugger is stopped in a breakpoint that you have placed then ,even if you remove the breakpoint , the debugger will stop at the place where the breakpoint used to be in the rest 9 threads
问题是 Eclipse 在另一个线程中的“已删除”断点处停止。因此,例如,如果您有 10 个线程,并且调试器在您放置的断点处停止,即使您删除断点,调试器也将停在断点曾经位于其余 9 个线程中的位置
If you choose to stop the entire VM when a breakpoint is hit, then other threads will not reach that breakpoint (since they are suspended) and you will not get this strange behavior
如果您选择在遇到断点时停止整个 VM,那么其他线程将不会到达该断点(因为它们已暂停)并且您不会遇到这种奇怪的行为
In order to change Suspend scope, right click on the breakpoint ==> properties => select relevant radio option
为了更改挂起范围,右键单击断点 ==> 属性 => 选择相关的单选选项
Suspend thread/VM : These are radio buttons. By default debugger will only suspend the thread in which breakpoint is hit. However, if you select the radio box Suspend VM, then all threads will be suspended when breakpoint is hit.
暂停线程/VM:这些是单选按钮。默认情况下,调试器只会挂起断点所在的线程。但是,如果您选择单选框 Suspend VM,那么当断点被击中时所有线程都将被挂起。
回答by zeta
If it happens on the first line, then it should be a Debugger setting. This thread should help: Prevent xdebug to break at first line of index file
如果它发生在第一行,那么它应该是一个调试器设置。这个线程应该有帮助:防止 xdebug 在索引文件的第一行中断
But in short:
但简而言之:
- "Windows -> Preferences -> PHP (or Java in this case) -> Debug" and uncheck "Break at first line".
- "Run > Debug Configurations > PHP Web Application (or Java in this case)" and unselect "Break at first line" in all the configurations
- "Project > Properties > PHP > Debug", unselect "Break at First Line"
- “Windows -> Preferences -> PHP (or Java in this case) -> Debug”并取消选中“Break at first line”。
- “运行 > 调试配置 > PHP Web 应用程序(在本例中为 Java)”并在所有配置中取消选择“在第一行中断”
- “项目 > 属性 > PHP > 调试”,取消选择“在第一行中断”