Bug 34440 - [expressions] [README] Improve error message for "Thread must be suspended by step or breakpoint to perform method invocation"
Summary: [expressions] [README] Improve error message for "Thread must be suspended by...
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: readme
Depends on:
Blocks:
 
Reported: 2003-03-10 15:27 EST by Darin Swanson CLA
Modified: 2011-05-20 02:58 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Swanson CLA 2003-03-10 15:27:32 EST
If you force a re-evaluation of a Watch item when the VM is suspended at a 
breakpoint and you have selected the Debug target you get: "Thread must be 
suspended by step or breakpoint to perform method invocation" in the details 
area.  

What exactly is it attempting to do in this case?
Comment 1 Luc Bourlier CLA 2003-03-12 17:42:39 EST
The problem is not with the re-evaluation (re-evaluation is not available when
the debug target is selected), but with the toString in the detail pane.

the test case is:
when the VM is suspended at a breakpoint, select the debug target, then select
an object in the variable view or in the expression view. The message will be
displayed in the detail pane.

To evaluate the toString of the value, a suspended thread is requiered. As the
selection in the debug view is not on a thread or a stackframe, the current
implementation try to find a suspended thread in the list of thread of the debug
target. In this case, the selected thread is suspended, but not in valid state
to performed a evaluation.

A fix is to select a thread which is in a valid state, but I don't think the
debugger know if the thread is in a valid state or not.

DarinW: do you know if there is any way to select a 'good' thread ?
Comment 2 Darin Wright CLA 2003-03-12 18:02:28 EST
The variables view is not a problem - unless a stack frame is selected, nothing 
is displayed. This is only a problem in the expressions view (still thinking 
about solution).
Comment 3 Darin Wright CLA 2003-03-12 18:10:14 EST
The VM will not tell us if a thread has been suspended by a user event. We'd 
like to choose the thread in which the breakpoint occurred, but there may be no 
breakpoint (if the user has performed steps).

The only option I see is keeping track of where the breakpoint/step suspends 
occurred. However, that is a "drastic" fix for a relatively rare problem. The 
workaround is to have the user select a "good" thread. 

We could just make this into a README. Propose no action immediately.
Comment 4 Luc Bourlier CLA 2003-03-12 18:29:32 EST
I agree to not change the code, but we should change the message to something
more explicite (no idea of what to say).
Comment 5 Darin Wright CLA 2003-03-12 22:56:15 EST
The IJavaThread has a status code for this error condition - 
ERR_INVALID_THREAD_STATE. We can test for this and display a better message 
(but I have to come up with a better message).
Comment 6 Darin Wright CLA 2003-03-13 10:22:25 EST
For now, I'm going to say we do nothing, except provide a README. In the future 
we want to provide a better explanation.
Comment 7 Darin Wright CLA 2003-03-13 10:22:45 EST
Deferred
Comment 8 Darin Wright CLA 2006-06-14 14:16:06 EDT
*** Bug 125673 has been marked as a duplicate of this bug. ***
Comment 9 Darin Wright CLA 2007-06-18 14:18:44 EDT
Closing. When a target is selected the watch expression shows no value now (3.3). We only show a value when a context is provided that we can use to resolve the expression (thread or frame).
Comment 10 Darin Wright CLA 2007-06-18 14:19:13 EDT
Marking as won't fix.
Comment 11 Dani Megert CLA 2007-06-19 04:39:39 EDT
Darin, either you should reopen this again or reopen bug 125673 as the problem described in bug 125673 is not solved i.e. when manually stopping a thread I still get the same behavior as described there: the Variables view contains the values but the details pane is unusable (which is sort of explained but not very user friendly).