Bug 15067 - code optimization removes breakpoints as well
Summary: code optimization removes breakpoints as well
Status: RESOLVED DUPLICATE of bug 1591
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 2.0   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Darin Wright CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-02 06:07 EDT by Claude Knaus CLA
Modified: 2003-05-12 15:51 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Claude Knaus CLA 2002-05-02 06:07:20 EDT
If I set a breakpoint on a line which gets optimized away (beacause of
constant folding, dead code elimination, etc.), the break point is ignored
as well. In the case below, I want to set a breakpoint on the first statement,
to see if I enter the method. I don't want to care if the first
statement will be opmitized away or not.

---8<---

public class IgnoredBreakpoint {

	private static final boolean fgDebug= true;

	public static void main(String[] arguments) {
		if (fgDebug) // set breakpoint on this line
			System.out.println("foo");
		System.out.println("bar");
	}

}
Comment 1 Philipe Mulet CLA 2002-05-02 06:13:40 EDT
Breakpoint source -> pc mapping is done by JDT/Debug. The information encoded 
in the classfile attributes should be enough to address this one.
Comment 2 Darin Wright CLA 2002-05-02 08:52:09 EDT
Do not intend to address for 2.0
Comment 3 Darin Wright CLA 2003-05-12 15:51:18 EDT
Dup.
Comment 4 Darin Wright CLA 2003-05-12 15:51:41 EDT

*** This bug has been marked as a duplicate of 1591 ***