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

Bug 464255

Summary: debugger does not stop at breakpoint on assignment of a boolean expression on the next line
Product: [Eclipse Project] JDT Reporter: Henno Vermeulen <strider80>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: sarika.sinha
Version: 4.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows 8   
Whiteboard: stalebug

Description Henno Vermeulen CLA 2015-04-09 04:42:29 EDT
Eclipse debugger will not stop at a breakpoint placed on the line "boolean test =" in the following code. It does stop when putting the breakpoint on the next line. It also stops when changing from boolean assignment to int assignment with a + operator (I haven't tested other types). It ALSO stops when changing the assignment to simply "a()". Same issue with || operator.


import static org.junit.Assert.assertFalse;

import org.junit.Test;

public class BreakPointTest {

	@Test
	public void test() {
		boolean test = 
				a() && b();
		assertFalse(test);
	}

	public boolean a() {
		return true;
	}

	public boolean b() {
		return false;
	}
}
Comment 1 Henno Vermeulen CLA 2015-04-09 04:43:27 EDT
Could this be related to Bug 445024 with while(true)?
Comment 2 Sarika Sinha CLA 2015-04-09 04:59:29 EDT
(In reply to SlowStrider Mising name from comment #1)
> Could this be related to Bug 445024 with while(true)?

You meant Bug 429317 ?
Comment 3 Henno Vermeulen CLA 2015-04-15 03:13:18 EDT
You're absolutely right, I actually meant Bug 429317

There's a new comment on that bug claiming Bug 429317 is a duplicate of Bug 55459 where breakpoints cannot be hit if the code is optimized out by the compiler.

So I guess these bugs don't have the same cause as this one:
 - the breakpoint works fine on the next line, or when the assignment is put in one line
 - all these methods are overridable so they cannot be inlined (unless the JIT compiler knows there are no such classes but I guess that has nothing to do with it) 
 - this is a simplified version of my original problem which had more complicated logic in methods a and b which I doubt could be optimized out

But I have little knowledge of compiler internals.
Comment 4 Eclipse Genie CLA 2020-02-26 19:38:17 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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.