Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317025 - [breakpoints] Conditional Breakpoint expression should be compiled against running JRE
Summary: [breakpoints] Conditional Breakpoint expression should be compiled against ru...
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Sarika Sinha CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-16 07:18 EDT by Markus Keller CLA
Modified: 2019-12-31 12:33 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2010-06-16 07:18:50 EDT
I20100608-0911

The expression of a Conditional Breakpoint should be compiled against the running JRE, not the JRE specified in the project.

I had a conditional breakpoint in an SWT class with this condition:

StackTraceElement[] s= new Throwable().getStackTrace();
for (int i= 0; i < s.length; i++) {
	if ("org.eclipse.swt.custom.CTabFolderRenderer".
			equals(s[i].getClassName()))
		return false;
}
return true;

This worked fine when I selected a JDK6 as JRE for the CDC-1.0/Foundation-1.0 execution environment, but it showed an error dialog when I actually had a CDC-1.0/Foundation-1.0 JRE installed (where Throwable#getStackTrace() is not available). In both scenarios, I debugged with the JDK6.
Comment 1 Sarika Sinha CLA 2014-03-20 07:08:48 EDT
Not sure, if we should treat the Conditional breakpoint snippet against running JRE. To me it is very similar to a assert kind of test executed at runtime.
Comment 2 Markus Keller CLA 2014-03-20 09:11:46 EDT
The difference is that at compile time, we're restricted by the JRE that's on the classpath.

But at run time, we know the exact JRE we're running on, so we can offer more functionality. At run time, the compile-time restrictions are lifted, and the debug user is not interested in those restrictions any more. For me, conditional breakpoints are more like aspects that are weaved in at run time.
Comment 3 Eclipse Genie CLA 2019-12-31 12:33:16 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.