Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 359151 - [run control][menu] Run to line action is enabled even if target is terminated.
Summary: [run control][menu] Run to line action is enabled even if target is terminated.
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.8   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.8 M3   Edit
Assignee: Platform-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 258767 360172
  Show dependency tree
 
Reported: 2011-09-27 18:15 EDT by Pawel Piech CLA
Modified: 2011-10-27 17:05 EDT (History)
1 user (show)

See Also:
Michael_Rennie: review+


Attachments
Changes to retarget action. (1.58 KB, patch)
2011-09-27 18:17 EDT, Pawel Piech CLA
no flags Details | Diff
Fix for JDT's run to line target. (1.04 KB, patch)
2011-09-27 18:21 EDT, Pawel Piech CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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