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

Bug 255618

Summary: [breakpoints] Compilation error in breakpoint can't be corrected
Product: [Eclipse Project] JDT Reporter: Ulrich Hobelmann <ulrich.hobelmann>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: darin.eclipse, Michael_Rennie, ori.kremer
Version: 3.4.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Ulrich Hobelmann CLA 2008-11-18 05:24:33 EST
Build ID: M20080911-1700

Steps To Reproduce:
This does not always happen, but usually when I remote-debug my JBoss server (i.e. not during debugging of a local Java app launched from Eclipse).  Both run (AFAIK) on Java 1.6.0_10.

The breakpoint condition can be something like "variable == null".  When the breakpoint is reached, Eclipse will complain that the condition is not well-formed and that it should be either a number of statements or an expression.  The variable is local.

If I correct the breakpoint condition to "return (variable == null);" it will not help, either.

More information:
Very probably it has nothing to do with parsing (or I guess it would be 100% reproducible), maybe it's related to what variables Eclipse can see in the stack frame.  Quite often I have to turn the "show logical structure" button on or off to correctly show all local variables, and also the expandable "+" sign next to them in the "Variables" view.  Not sure if these are related, but that's the only other problem I'm experiencing with Debugging, so they might be related.

(When I reach the "illegal" conditional breakpoint, though, it always shows all variables in the stackframe, so maybe these problems are totally unrelated.)
Comment 1 Ulrich Hobelmann CLA 2008-12-09 09:35:08 EST
The same problem sometimes occurs in the expressions and display views: the expressions entry will stay red and not display a value, and the display view will print "Evaluation failed. Reason(s): Evaluations must contain either an expression or a block of well-formed statements" on "display".

The expression I'm trying to evaluate is usually something like object.getSomething(), and yes, I'm positive there are no trailing or missing parentheses around/in the expression.

Interestingly, the variables view will display the contents of 'object' and even a correct popup with instance fields of 'object' is shown in the Java editor when I hover above it.
Comment 2 Ulrich Hobelmann CLA 2009-01-14 07:53:51 EST
This problems seems to occur whenever the system is remotely debugged (i.e. when I connect Eclipse to my running JBoss server).  JDK is 1.6.0_11 in both cases, but the server uses the server VM.  JBoss is 4.2.2GA.  The deployed server code was built with Sun's javac in Java5-mode.

Both Expressions and conditional breakpoints do not work, the complaint being that the expression is not valid.  If I use non-conditional breakpoints, however, I can see the variable used in the stack frame.  Trying to evaluate an expression (or just the variable name) in the Display view also fails.
Comment 3 Darin Wright CLA 2009-01-14 14:09:48 EST
Could there be a mismatch between workspace compiler settings and what the server VM can handle?
Comment 4 Ulrich Hobelmann CLA 2009-01-15 12:34:44 EST
I don't believe so.  The build target for 'javac' should be set to Java 5, and the server VM is 1.6.0_11 (jdk) anyway (just using server, not client VM).

Is there a difference in the code that's used for the Variables view and that's used to access variables that are used in expressions/conditions/...?  That's the only reason I can think of that could explain why Variables can be looked at, but everything that involves evaluation does not.
Comment 5 Ulrich Hobelmann CLA 2009-01-21 03:43:26 EST
For the record, server debugging works for me with Eclipse 3.5M4 (great and awesomely stable, btw!).  It may also have to do with upgrading JBoss from 4.2.2 to 4.2.3 (which we also just did), but I don't think that should make a difference, as it's rather unrelated to debugging tech.
Comment 6 Ulrich Hobelmann CLA 2009-01-26 02:15:39 EST
Correction: sometimes it works with 3.5M4, sometimes not.  Right now it works in the second stackframe (ctrl-shift-I for inspect shows a variable's value there), but in the top stackframe (method with two nested for-loops and a switch inside them) it doesn't, and conditional breakpoints fail there, too.
Comment 7 Darin Wright CLA 2009-06-17 11:23:12 EDT
Note bug 277187 was fixed in 3.5RC2. Can someone re-test to see if this problem is also fixed?
Comment 8 Ori Kremer CLA 2009-07-10 17:23:10 EDT
(In reply to comment #7)
> Note bug 277187 was fixed in 3.5RC2. Can someone re-test to see if this problem
> is also fixed?
> 

I'm experiencing the same error in 3.5 GA when remote debugging (a JBoss web app).
Comment 9 Eclipse Genie CLA 2020-04-02 15:09:07 EDT
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.