Community
Participate
Working Groups
Created attachment 284947 [details] bug case In some new versions, the debugger cannot perform expression evaluation (error: "Evaluations must contain either an expression or a block of well-formed statements'), but it can be done in the 2017 version of eclipse. It is found through the tracking code that the problem is Java file: ASTEvaluationEngine.java->createExpressionFromAST, it seems that there is an error in the judgment of runMethodError. Please fix it, this bug affects multiple versions of eclipse!
Created attachment 284948 [details] a debug test project
I'm having similar issues, and it seems to affect the Debug Shell and Conditional Breakpoints as well. From what I can tell the problem occurs for breakpoints inside a lambda. Outside of lambdas everything works fine. If I had to guess the problem is might caused by using a newer version of Java (11 in my case), but that is pure speculation. Eclipse installation: Version: 2020-12 (4.18.0) Build id: 20201210-1552 Java Version: GraalVM EE 20.2.1
Can you attach s simple project to reproduce? I tried this : Arrays.asList("ab", "b","c").stream().filter(s -> s.length() >1).forEach(s -> { System.out.println(s); // breakpoint here }); And could evaluate "s" in the Expression view.
Created attachment 286031 [details] Example of the error Hello, I too get the error using Eclipse 2021-03, never got it before. I've addded a Java class to reproduce the error with some comments on where to set the breakpoints. In the .log file I see the following message: !ENTRY org.eclipse.debug.core 2 0 2021-04-05 21:25:14.363 !MESSAGE Compile error during code evaluation: Only the first formal parameter may be declared explicitly as 'this'
it seems the following assignment triggers the problem: class: org.eclipse.jdt.internal.debug.core.model.JDIStackFrame.LambdaASTVisitor method: visit ``` if (i == 0) { HERE --> newName = "this"; } else { newName = synVars[i - 1].getName(); } ``` Related Bug where the changes were made: Bug 534687
(In reply to Amedeo Santarelli from comment #5) > Related Bug where the changes were made: Bug 534687 That was long time ago.
Created attachment 286075 [details] [patch] Bug569413 junit test
(In reply to Andrey Loskutov from comment #6) > (In reply to Amedeo Santarelli from comment #5) > > Related Bug where the changes were made: Bug 534687 > > That was long time ago. indeed, but it seems that line is never reached at least running the EvalTestSuite. I've attached a patch that will create the junit test for the Bug, with 2 tests, when one of the two is now failing of course
(In reply to Amedeo Santarelli from comment #8) > (In reply to Andrey Loskutov from comment #6) > > (In reply to Amedeo Santarelli from comment #5) > > > Related Bug where the changes were made: Bug 534687 > > > > That was long time ago. > > indeed, but it seems that line is never reached at least running the > EvalTestSuite. > > I've attached a patch that will create the junit test for the Bug, with 2 > tests, when one of the two is now failing of course Many thanks. We use Gerrit to push patches, could you please try? https://wiki.eclipse.org/Platform/How_to_Contribute
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.debug/+/179139
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.debug/+/179804
Gayan, is this something you could check?
(In reply to Andrey Loskutov from comment #12) > Gayan, is this something you could check? Sure i can have a look. Does the two gerrits have already fixed this or do i need to look for a fix ?
(In reply to Gayan Perera from comment #13) > (In reply to Andrey Loskutov from comment #12) > > Gayan, is this something you could check? > > Sure i can have a look. Does the two gerrits have already fixed this or do i > need to look for a fix ? I had no time to verify if the problem is a regression or not, this is what is most interesting. The first patch is a test, second is supposed to be the fix.
(In reply to Andrey Loskutov from comment #14) > (In reply to Gayan Perera from comment #13) > > (In reply to Andrey Loskutov from comment #12) > > > Gayan, is this something you could check? > > > > Sure i can have a look. Does the two gerrits have already fixed this or do i > > need to look for a fix ? > > I had no time to verify if the problem is a regression or not, this is what > is most interesting. The first patch is a test, second is supposed to be the > fix. I can have a look at it in the weekend @Andrey
Gerrit change https://git.eclipse.org/r/c/jdt/eclipse.jdt.debug/+/179804 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=d8a3b956ffa479f4bd928b09f1dce4df8b9f9a26
Thanks Amedeo for providing a fix. Thanks Gayan for reviewing.
Build id: I20210518-0850
this bug still exists and happens when generics "unbounded wildcard" are used in the code that gets debugged, or when having inner classes. See attached junit tests that show working and non working examples (EclipseBug_*.java)
Created attachment 288749 [details] a working example with inner class
Created attachment 288750 [details] a failing example with inner class
Created attachment 288751 [details] a working example with generics
Created attachment 288752 [details] a failing example with generics
Comment on attachment 288752 [details] a failing example with generics do not use, more simplified version available
Created attachment 288753 [details] a failing example with generics
(In reply to Remo Liechti from comment #19) > this bug still exists and happens when generics "unbounded wildcard" are > used in the code that gets debugged, or when having inner classes. > See attached junit tests that show working and non working examples > (EclipseBug_*.java) Please report new bug here: https://github.com/eclipse-jdt/eclipse.jdt.debug/issues