Bug 35525 - unable to step when suspended at breakpoint during evaluation
Summary: unable to step when suspended at breakpoint during evaluation
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: 2.1 RC4   Edit
Assignee: Luc Bourlier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-21 16:52 EST by Darin Wright CLA
Modified: 2003-06-22 11:43 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Wright CLA 2003-03-21 16:52:19 EST
RC3a

When suspended at a breakpoint during an evaluation (for example, in the 
scrapbook or from the display view), the step actions are disabled.
Comment 1 Darin Wright CLA 2003-03-21 16:57:46 EST
Marking as RC4 candidate. The problem is in JDIThread#canStep(). Currently we 
disallow stepping if an evaluation is being performed. However, I beleive this 
was to protect when a user is performing rapid stepping and implicit 
evaluations are being performed. We should be able to specialize the test to 
disallow stepping only when the evaluation being performed is implicit (and 
allow stepping during explicit evaluations).
Comment 2 Darin Wright CLA 2003-03-24 09:48:18 EST
In fact, we should not discriminate between explicit/implicit evaluations. A 
user may also suspend an implicit evaluation, and be able to step.
Comment 3 Darin Wright CLA 2003-03-24 10:24:57 EST
Here is my proposed fix to JDIThread. Rather than disallowing the step if an 
evaluation is in progress, disallow stepping if there is a queued runnable yet 
to execute. This allows stepping to occurr whenever the thread is suspended 
(except when quietly suspended and evaluating a conditional breakpoint), and 
all async evaluations are complete. Here is the proposed replacement method for 
#canStep().

protected boolean canStep() {
	try {
		return isSuspended()
			&& !isSuspendedQuiet()
			&& (fAsyncThread == null || fAsyncThread.isEmpty())
			&& !isStepping()
			&& getTopStackFrame() != null
			&& !getJavaDebugTarget().isPerformingHotCodeReplace();
	} catch (DebugException e) {
		return false;
	}
}

I'd like to have John W and Luc B "evaluate" the proposed fix.
Comment 4 Darin Wright CLA 2003-03-24 10:52:53 EST
Risk is moderate - I say this because the stepping code is heavily used. 
However, I am confident with the fix. The fix is more robust than the previous 
code, since with the old code it was possible to request a step while in a 
suspended state, but while evaluations were queued.
Comment 5 Darin Wright CLA 2003-03-24 11:22:22 EST
This is a regression from 2.0 (changed sometime during the 2.1 development 
cycle). In 2.0, users were able to step within an evaluation.
Comment 6 Kai-Uwe Maetzel CLA 2003-03-24 12:32:17 EST
+1
Comment 7 Dirk Baeumer CLA 2003-03-24 13:03:53 EST
+1
Comment 8 Philipe Mulet CLA 2003-03-24 13:16:16 EST
+1
Comment 9 Darin Wright CLA 2003-03-24 13:20:14 EST
Released fix to HEAD. Please verify, Luc.
Comment 10 Darin Wright CLA 2003-03-24 13:20:29 EST
Please verify.
Comment 11 Luc Bourlier CLA 2003-03-24 13:55:10 EST
Verified.