Bug 349476 - Provide error details when any evaluation fails
Summary: Provide error details when any evaluation fails
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-15 12:51 EDT by Michael Rennie CLA
Modified: 2019-11-22 10:50 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Rennie CLA 2011-06-15 12:51:31 EDT
Currently if you try to perform an evaluation (conditional breakpoint, Inspect, Disply, etc) and it fails you will get an error dialog that sometimes will hint at what is wrong, but most often will be the completely useless / cryptic "Evaluations must contain either an expression or a block of well-formed statements".

We should change this to provide a multi-status to the dialog that describes the errors found in the snippet - which is easy to do because our evaluation engine collects the instructions with errors and does nothing with them except to know that an error was found.
Comment 1 Stephan Herrmann CLA 2019-05-09 09:24:33 EDT
I have seen this cryptic

  Evaluations must contain either an expression or a block of well-formed statements

plenty of times, recently.

Hence I suggest to implement Michael's proposal within the 4.12 time frame, given that it "is easy to do" :)
Comment 2 Sarika Sinha CLA 2019-05-17 05:35:06 EDT
(In reply to Stephan Herrmann from comment #1)
> I have seen this cryptic
> 
>   Evaluations must contain either an expression or a block of well-formed
> statements
> 
> plenty of times, recently.
> 
> Hence I suggest to implement Michael's proposal within the 4.12 time frame,
> given that it "is easy to do" :)

Unfortunately it is done at various places differently, so not very easy to do as I thought.
Can you add may be 2 examples so that verify the changes I have in my mind.
Comment 3 Stephan Herrmann CLA 2019-05-19 13:08:04 EDT
(In reply to Sarika Sinha from comment #2)
> (In reply to Stephan Herrmann from comment #1)
> > I have seen this cryptic
> > 
> >   Evaluations must contain either an expression or a block of well-formed
> > statements
> > 
> > plenty of times, recently.
> > 
> > Hence I suggest to implement Michael's proposal within the 4.12 time frame,
> > given that it "is easy to do" :)
> 
> Unfortunately it is done at various places differently, so not very easy to
> do as I thought.
> Can you add may be 2 examples so that verify the changes I have in my mind.

Sorry, I don't have any records of those situations.

IMHO, even if not complete, just surfacing those errors in the most common situations would already be a huge help.

I'd vote for Debug Shell as the highest priority.

The exact kind of error that triggers this I can't tell you. That's what I hope we'll find out by better error reporting :)
Comment 4 Sarika Sinha CLA 2019-05-21 07:03:48 EDT
This comment was added as part of Bug 3103 (Commit fe0f813c0e21e68fb1a69966c92da75cb7f5e979) , where the error is a runtime error. 
Moving to 4.13 for a better understanding of problem.
Comment 5 Stephan Herrmann CLA 2019-05-21 09:20:29 EDT
(In reply to Sarika Sinha from comment #4)
> This comment was added as part of Bug 3103 (Commit
> fe0f813c0e21e68fb1a69966c92da75cb7f5e979) , where the error is a runtime
> error. 
> Moving to 4.13 for a better understanding of problem.

In createExpressionFromAST() (modified in said commit) you directly operate on a "Message" which has getMessage() : String.

Right in this section we see that the message is filtered for "void methods cannot return a result" -- aha!

In all other cases you should have an interesting message.getMessage() at hand. That I want to see :)

Btw, that code section doesn't speak of *runtime* error, it just tries to isolate runMethodError vs. snippetError, which I read as: if we have a compile error, is it inside the run method or elsewhere in the snippet?
Comment 6 Stephan Herrmann CLA 2019-05-21 13:06:02 EDT
OK, looking at today's version of the code I see that
   errorSequence.addError(problem.getMessage());
is called in one branch, just not in the other.

So the problems with insufficient error output result from IProblems with a range outside the original snippet.

I quickly tried to trigger this situation with various forms of bogus code, but failed.
Comment 7 Eclipse Genie CLA 2019-05-21 13:08:50 EDT
New Gerrit change created: https://git.eclipse.org/r/142538
Comment 8 Stephan Herrmann CLA 2019-05-21 13:11:10 EDT
(In reply to Eclipse Genie from comment #7)
> New Gerrit change created: https://git.eclipse.org/r/142538

@Sarika, while we don't have a recipe to systematically analyse, would you mind just a log warning in the otherwise silent branch?

Maybe we can still sneak this in for RC1 to help us gathering information from the field?
Comment 9 Sarika Sinha CLA 2019-05-22 00:28:06 EDT
(In reply to Stephan Herrmann from comment #8)
> (In reply to Eclipse Genie from comment #7)
> > New Gerrit change created: https://git.eclipse.org/r/142538
> 
> @Sarika, while we don't have a recipe to systematically analyse, would you
> mind just a log warning in the otherwise silent branch?
> 
> Maybe we can still sneak this in for RC1 to help us gathering information
> from the field?

Yes, we can push this today itself, need not wait for RC1.
Comment 11 Stephan Herrmann CLA 2019-05-22 14:17:49 EDT
(In reply to Sarika Sinha from comment #9)
> (In reply to Stephan Herrmann from comment #8)
> > (In reply to Eclipse Genie from comment #7)
> > > New Gerrit change created: https://git.eclipse.org/r/142538
> > 
> > @Sarika, while we don't have a recipe to systematically analyse, would you
> > mind just a log warning in the otherwise silent branch?
> > 
> > Maybe we can still sneak this in for RC1 to help us gathering information
> > from the field?
> 
> Yes, we can push this today itself, need not wait for RC1.

Thanks!
Comment 12 Sarika Sinha CLA 2019-08-20 00:58:45 EDT
If someone observed any logs related to this, it will help to proceed.
Comment 13 Sarika Sinha CLA 2019-11-22 10:50:39 EST
I don't know what else to be done here.