eclipse can't remove certain breakpoints

我的梦境 提交于 2019-12-08 14:44:06

问题


Double-clicking in the blue bar on the left of eclipse sets a breakpoint. Double-clicking again removes the breakpoint. This works great for me but if I use git to checkout a different branch, often times the blue dots for breakpoints get "confused" or something. I can no longer double-click to unset them. I am forced to go into debug perspective, and find the breakpoint in the "breakpoints" view and then right click and remove. Does anybody have an easier solution for this? I am coding in java on windows 7 for what it's worth.

I can reproduce this bug with this code (assume the if is line 1):

if(bool)
{
  // comment
  doSomething();
} else {
  doOther();
}

I breakpoint on line 4 - doSomething(). Then I put a new line above the if to shift everything down. (moving the breakpoint on line 5). Then I do git stash save. When I click back to eclipse, the blue dot is displayed on the correct line, but the breakpoint window still says line 5. If I double click to disable, it actually adds a second breakpoint on line 4.

I feel like I should report this to the Eclipse guys.


回答1:


Right click on the break point -> Disable break point. Should work. Also, if you click (in the same menu) on the "toggle breakpoint" again, it disappears fully; In the first case it just disables it, but it remains existing.




回答2:


open debug perspective [right conrer]

go to breakpoints

click clear all breakpoints [double X] or scroll until you find the breakpoint which doesn't want to go away and delete it.




回答3:


None of the solutions here worked for me. Because I removed the breakpoints from breakpoints view but could not get rid of them in the editor. I think this is a kind of bug. What it worked for me is simply

  1. Select the whole class (Ctrl + a)

  2. Cut the whole class (Ctrl + x)

  3. Paste it back (Ctrl + v)

Sometimes, the solution is easier than we think:)




回答4:


Goto Run -> Remove All Breakpoints. This will clear all breakpoints which cannot be removed individually.




回答5:


This happens to me sometimes. In the Debug Perspective there is a breakpoints tab. Even if breakpoints have become invisible in the editor, they are probable visible in that list. So you can safely remove the breakpoints that you want to get rid off.



来源:https://stackoverflow.com/questions/14746899/eclipse-cant-remove-certain-breakpoints

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