Eclipse stops at non-existent breakpoint

六眼飞鱼酱① 提交于 2019-12-06 17:16:25

问题


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?

Note: It is not the same issue mentioned here - phantom breakpoint driving me crazy!


回答1:


If you are sure that there aren't breakpoints (Run > Remove All Breakpoints), then there are 2 things to consider:

  1. You are misunderstanding something of how the debugger works.
  2. Your program is stopped because it's waiting for some input.



回答2:


I have suffered this. To fix it, just goto Run->Remove All Breakpoints in the menu. It will remove it. Later you can redefine your required breakpoints again.




回答3:


Eclipse possibly stops because of an uncaught exception. To fix this:

  • handle the exception
  • Preferences -> Java -> Debug > Suspend execution on uncaught exceptions (in this menu there are more settings to suspend execution!)

I got this information from: https://stackoverflow.com/a/723313/944440




回答4:


I had same issue, I am using eclipse Mars. In my case I fixed it differently. Steps:

  1. I opened breakpoint tab (you will see this if you are in debug perspective)

  2. I saw there were two breakpoints enabled for the same line of code one of them was already unchecked but another was checked

  3. I unchecked it and now it does not stop anymore.




回答5:


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

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

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.




回答6:


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

But in short:

  1. "Windows -> Preferences -> PHP (or Java in this case) -> Debug" and uncheck "Break at first line".
  2. "Run > Debug Configurations > PHP Web Application (or Java in this case)" and unselect "Break at first line" in all the configurations
  3. "Project > Properties > PHP > Debug", unselect "Break at First Line"


来源:https://stackoverflow.com/questions/7178096/eclipse-stops-at-non-existent-breakpoint

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!