16

Is there a way to enable and disable all breakpoints in Eclipse...? I dont want to remove them just disable them & enable them after some condition is met.

Thanks in advance

Asad Khan
  • 11,469
  • 13
  • 44
  • 59

3 Answers3

25

Under the Run menu, there's a Skip All Breakpoints checkbox. If you select that, breakpoints won't fire (the actual breakpoint markers in the source have a line drawn through them to indicate they're in skip mode).

Of course, in the default configuration, running the code (rather than debugging it) also seems to ignore breakpoints so you may want to try running it instead of debugging. Note that this is default behaviour under Galileo/Ubuntu - whether that's different under other versions or operating systems is unknown to me.

paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953
  • 2
    So, how do you turn them back on? I hit ```Skip All Breakpoints``` and now that option is gone from the run menu. – Adam Parkin Dec 14 '15 at 22:35
  • @Adam, you'd probably be better off asking a *new* question rather than leaving a comment. That way, you'll get a lot more exposure (all of SO rather than just me). For what it's worth, that behaviour doesn't happen for me, running Eclipse 3.8.1 (Juno) under Debian - it's just a simple checkbox menu item. If you *do* raise it as another question, be sure to mention the OS and Eclipse version you're running. – paxdiablo Dec 15 '15 at 11:17
  • 2
    @paxdiablo Well I disagree. Adam has established some context here. Asking a new question will cause that context to be totally lost. The new functionality is related. Ideally, I would have suggested that your answer be more complete. Each question need not be "atomic". – Sid Kshatriya Jan 14 '16 at 05:57
  • @SidKshatriya, Adam could go either way really. First he could add the relevant stuff to this question (i.e., the platform/environment as I mentioned in my comment reply and possibly some screenshots since the described behaviour is not what happens in my environment (as also mentioned)) in which case there'll probably be enough info to answer it. Or he could ask another question, linking back to this one for context if desired. I prefer the atomic questions myself or, if not atomic, at least not a long rambling list :-) – paxdiablo Jan 14 '16 at 08:46
  • @SidKshatriya: In any case, since Adam was not the original asker (and the original asker has already accepted an answer), it's probably best as a new question. – paxdiablo Jan 14 '16 at 08:48
20

This is a bit old question, but maybe someone will find this useful..

If you would like to disable all breakpoints and enable just one breakpoint, then you should open the Breakpoints window in the Debug tab and Select all Breakpoints(Ctrl - A) and right click -> disable and then select the breakpoint you need activated and right click -> enable.

M.C.
  • 1,765
  • 3
  • 29
  • 31
  • 1
    +1 IntelliJ has a "Force Goto Line" command which will temporarily bypass all breakpoints until flow reaches the current line. I was looking for this option in eclipse and this technique is the closest I have found. – Adrian Pronk Jul 16 '14 at 21:28
  • 4
    This is the answer I was looking for. In real life debugging you accumulate a lot of breakpoints. But then you want to restart you're program and only interested in one of them. – Sid Kshatriya Jan 14 '16 at 05:54
0

My own question lead me here when marked as duplicity.

...just disable them & enable them after some condition is met.

There is also option to configure breakpoint with a condition (right click on breakpoint):

Eclipse breakpoint properties

Community
  • 1
  • 1
Betlista
  • 10,327
  • 13
  • 69
  • 110