Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 329937

Summary: [breakpoints] Don't allow setting conditional breakpoints in JVM library classes
Product: [Eclipse Project] JDT Reporter: Alexander Kidd <alexkidd>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: CLOSED WORKSFORME QA Contact:
Severity: enhancement    
Priority: P3 CC: davidb.arbete+bugs+eclipse.org, hieplq, jhouklis, loskutov, massimo.rabbi, Michael.Valenta, Michael_Rennie, remy.suen
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Alexander Kidd CLA 2010-11-10 13:25:28 EST
Build Identifier: M20100211-1343

Conditional breakpoints don't work in classes that are part of the JVM library. That's fine.

Right now Eclipse will let you set a condition anyway even though it'll always fail and then when the breakpoint is hit it shows an error that the Java project context is missing.
It would be nicer if we just greyed out the Enable Condition option in the breakpoint properties when in a JVM library class.

Reproducible: Always
Comment 1 Michael Rennie CLA 2011-04-06 15:30:06 EDT
*** Bug 336372 has been marked as a duplicate of this bug. ***
Comment 2 Michael Rennie CLA 2013-12-06 14:27:14 EST
*** Bug 304498 has been marked as a duplicate of this bug. ***
Comment 3 Massimo Rabbi CLA 2017-04-05 06:03:09 EDT
Any news on this? I'm debugging a class loading issue and just faced this problem when setting a conditional breakpoint in the ClassLoader class.
Comment 4 Andrey Loskutov CLA 2017-04-05 08:22:02 EDT
Question: why should they don't work *in general* in the JVM library classes?

public class Main {
	public static void main(String[] args) {
		String s = new String("Hello");
	}
}

Breakpoint at public String(String original) constructor with condition "Hello".equals(original) works just fine for me (4.7 head).

@Massimo: classloaders usually load classes inside locked code to protect themselves from race conditions, so I guess this could be your issue.

Beside this, I would close this as "WORKS FOR ME". Feel free to reopen but please provide a concrete example how to reproduce.
Comment 5 hiep lq CLA 2018-03-08 01:57:59 EST
i got same issue with remote debug (eclipse Oxygen 2)
Comment 6 Atlas Amfistomos CLA 2018-03-19 06:57:45 EDT
(In reply to hiep lq from comment #5)
> i got same issue with remote debug (eclipse Oxygen 2)

Same here.... Why is the bug closed?
Comment 7 Atlas Amfistomos CLA 2018-03-19 07:06:51 EDT
Steps to reproduce

1. Connect to a remote OSGi server running the application via remote debugging
  Settings are:
   - Connection Type: Standard Socket
   - Host: localhost
   - Port: 8102
2. Set a conditional breakpoint at the source code of a class (not the JVM library class)
3. The server halts at that breakpoint and eclipse displays an error
   'Unable to compile conditional breakpoint - missing Java project context'

Happens with Oxygen 2
Comment 8 Andrey Loskutov CLA 2018-03-19 08:22:58 EDT
(In reply to Atlas Amfistomos from comment #6)
> (In reply to hiep lq from comment #5)
> > i got same issue with remote debug (eclipse Oxygen 2)
> 
> Same here.... Why is the bug closed?

Because it is a different use case as the one you posted in comment 7, and the original requestor did not provided any steps to reproduce the problem. 

For your issue (which seem to be related to the missing project context for OSGI launch), please file a different one and don't hijack this bug.