3

Sometimes, during a debugging session, the ability to set breakpoints in Eclipse seems to break. From that moment onwards, double-clicking the margin no longer shows a blue ball, and neither does right clicking and explicitly asking to "toggle break point". This happens for all the lines.

  • This happens rarely, but I already remember quite a few times it happened to me, on different machines, different operating systems and different Eclipse versions (3.6/3.7, maybe also 3.5)
  • The file is saved and refreshed.
  • This is a Java project in classic Eclipse.
  • The line is a valid line for a breakpoint - in fact, once this happens, no line can get a breakpoint.
  • Closing and re-opening the file, or restarting Eclipse, seems to solve the issue.

Because of the last bullet I'm pretty sure this is a bug of some sort. How can I avoid this behavior?

Oak
  • 26,231
  • 8
  • 93
  • 152
  • Is it because of http://stackoverflow.com/questions/3187805/eclipse-helios-ignores-breakpoints? Or http://stackoverflow.com/questions/2415655/unable-to-place-breakpoints-in-eclipse (jar path issue), http://stackoverflow.com/questions/1022007/why-are-my-breakpoints-ignored-with-gwt-eclipse-and-java-1-6-0-14 (jdk version issue) – VonC Oct 31 '11 at 07:38
  • If your file has, as an icon, an "hollow J", I have posted below a possible explanation. – VonC Oct 31 '11 at 07:43
  • @VonC thanks for the links... unfortunately, it appears none of these questions describe the same issue I am experiencing. – Oak Oct 31 '11 at 08:58

1 Answers1

0

As illustrated by bug 125768 and bug 322625, the already-defined breakpoints can disappear when the source file opened is not the one referenced by your project (internal file with an IResource), but an external one (like one created on the fly by a decompiler) .

In that case, you see something similar to:

no more breakpoint in the source

The file is the source for a compiled class that's in a JAR (i.e. read-only, non-editable).

It seems that the IDE doesn't always pick that up as a "Java file that's on the classpath". Other editors have the "J" icon with the binary underlay.

I just checked: If I get the hollow "J", then breakpoints aren't visible.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks, but the file in question is a writable Java file from my own project, not from any external jar. The icon isn't a hollow J. – Oak Oct 31 '11 at 09:00
  • @Oak: very strange, then. I always know that bug when Eclipse decided to open the code from another source than the one used to set the breakpoint. I will follow this page, hoping you find the answer. – VonC Oct 31 '11 at 09:06