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

Bug 359151

Summary: [run control][menu] Run to line action is enabled even if target is terminated.
Product: [Eclipse Project] Platform Reporter: Pawel Piech <pawel.1.piech>
Component: DebugAssignee: Platform-Debug-Inbox <platform-debug-inbox>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Michael_Rennie
Version: 3.8Flags: Michael_Rennie: review+
Target Milestone: 3.8 M3   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on:    
Bug Blocks: 258767, 360172    
Attachments:
Description Flags
Changes to retarget action.
none
Fix for JDT's run to line target. none

Description Pawel Piech CLA 2011-09-27 18:15:32 EDT
Build id: I20110915-1308

The run to line action is enabled almost all the time, at least for the JDT debugger.  There's a couple of reasons for this:

1) The retarget actions were redesigned with bug 180441 not to udpate with every selection change in editor.  Instead, their enablement is controlled by whether a IRunToLineTarget adapter is available (i.e. IRunToLineTarget.canRunToLine() is not called).

2) JDT's canRunToLine() implementation does not check whether target is terminated.  It should call canResume().

The latter problem is easy to take care of, the former is more complicated.  Attached patch would fix the RetargetAction so that it would check action target's enablement upon active part change and debug context change, but it would not for editor selection change.  It's a relatively risky change though as it affects the toggle breakpoint actions.
Comment 1 Pawel Piech CLA 2011-09-27 18:17:27 EDT
Created attachment 204126 [details]
Changes to retarget action.
Comment 2 Pawel Piech CLA 2011-09-27 18:21:03 EDT
Created attachment 204127 [details]
Fix for JDT's run to line target.
Comment 3 Pawel Piech CLA 2011-10-06 19:10:26 EDT
I committed the changes to the retarget action:
http://git.eclipse.org/c/platform/eclipse.platform.debug.git/commit/?id=0c5cbbd64f85f7684dd46ea34a9abb4247a3ca1b

I also opened bug 360172 to fix JDT's IRunToLineTarget.  After that we can add
this action to the toolbar.

Mike, please review.
Comment 4 Michael Rennie CLA 2011-10-17 10:59:24 EDT
+1 verified along with the fix for bug 360172
Comment 5 Pawel Piech CLA 2011-10-27 17:05:30 EDT
Verified in 4.2 I20111025-2000