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

Bug 80323

Summary: Make global step actions retargettable
Product: [Eclipse Project] Platform Reporter: Nobody - feel free to take it <nobody>
Component: DebugAssignee: Darin Wright <darin.eclipse>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P2 CC: dalexiev, John_Wiegand, mimrisek, oyvind.harboe
Version: 3.0.1   
Target Milestone: 3.2 M6   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 79872    
Attachments:
Description Flags
patch none

Description Nobody - feel free to take it CLA 2004-12-06 16:46:35 EST
Following the request submitted to CDT 
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=79872) I would like to suggest 
to make the global step actions retargettable. The reason for this is that the 
stepping in the CDT disassembly view has different meaning than the stepping in 
the C/C++ editor. 
The behavior of these actions should be the following: if the active part 
provides a step target the actions should use it, otherwise the target provided 
by the Debug view should be used.
Comment 1 Darin Wright CLA 2004-12-13 09:46:00 EST
Consider for 3.1, time permitting.
Comment 2 Darin Wright CLA 2005-02-24 10:14:45 EST
Jared, please investigate this one.

Since we already have the notion of IStep, we don't need to define a 
new "retargettable" interface. I beleive the actions should still 
update/enable based on selection change in the debug view and debug events 
being fired. When the action is invoked, it shold first ask the active part 
for its "IStep" adapter to operate on. If present, use it, otherwise, use the 
current selection in the debug view.

One thing to think about is what happens when the selection in the debug view 
has an enablement of "false", but the active part has an enablement of "true". 
(I'm not sure that can happen). From the original request, we may not have to 
worry about such a situation - i.e. we only worry about using the alternate 
step adapter when the current selection in the debug view also supports 
stepping. Mikhail, can you verify this requirement?
Comment 3 Jared Burns CLA 2005-03-04 18:22:12 EST
Mikhail, can you please verify that DW's suggestion fulfills your requirements?
Comment 4 Nobody - feel free to take it CLA 2005-03-06 18:13:58 EST
Sorry for delay.

>I beleive the actions should still 
>update/enable based on selection change in the debug view and debug events 
>being fired.

I am not sure about this. Why the action enablement can't be based on the same 
IStep adapter provided by the active part? The priority should be given to the 
active part's adapter. This will solve the problem you mentioned.

Another minor inconsistency is that IRunToLineTarget is defined in the UI 
plugin and IStep is in the core. I would suggest to have "retargettable" 
interfaces in UI and leave it to the debugger implementors to define additional 
core interfaces, for example, IInstructionStep. In CDT we have IRunToLine and 
IRunToAddress defined as debug model additions and RunToLineAdapter selects the 
corresponding adapter depending on the active part.
Comment 5 Darin Wright CLA 2005-03-16 17:15:14 EST
What about the other global actions like resume/suspend/terminate?
Comment 6 Darin Wright CLA 2005-03-16 17:37:39 EST
I still think we can re-use the interfaces from core, without introducing new 
API. Moving to M7.
Comment 7 Nobody - feel free to take it CLA 2005-03-16 17:53:56 EST
Probably. I can't think of an example right now, but it is possible to have 
some "exotic" views. 
Comment 8 Darin Wright CLA 2005-03-18 16:40:59 EST
Yep - but as long as the vew provides an adapter, it can delegate in whatever 
way it wants. The IStep interface is not limited to debug elements - it is 
stand alone.
Comment 9 Darin Wright CLA 2005-04-04 12:30:03 EDT
Pending PMC approval.
Comment 10 Darin Wright CLA 2005-04-05 09:33:07 EDT
Proposed implementation, requiring PMC approval:

When a retargettable "step" action is created or whenever the active part 
changes, the action will ask the active part for its IStep adapter. If the 
active part has an adapter, that part will be targeted, otherwise the action 
will target the debug view. The action will update as it does now (i.e. in 
response to debug events, and selection change events).

The performance impact should be negligable, as the action will only need to 
adjust/set its source when the active part changes (i.e. it does not need to 
lookup the source each time the action is invoked).

The same pattern should be applied to the following actions: step over, step 
into, step return, resume, suspend, terminate.
Comment 11 Mike Wilson CLA 2005-04-19 09:09:45 EDT
This was discussed and approved by the PMC last Wed. Sorry about the communication failure.
Comment 12 Darin Wright CLA 2005-04-29 17:05:26 EDT
Created attachment 20531 [details]
patch

I've attached a patch for a work in progress. It provides a retargettable
action for the "step over" action. I have some reservations with this approach
as the step actions, etc., already perform a lot updating in response to
selection changes in the debug view and in response to debug events. This
causes the actions to additionally udpate when a selection change occurrs in
any view/editor, causing jobs to be scheduled to run in the background,
adapters to be retrieved, etc.
Comment 13 Darin Wright CLA 2005-04-29 17:06:18 EDT
Comments and feedback welcome. If this feature is not critical for 3.1 we may 
want to defer.
Comment 14 Darin Wright CLA 2005-05-05 14:43:06 EDT
Propose to defer for post 3.1 consideration.

There may be other workarounds for this problem:
* The disassembly view could set a property on the underlying/associated debug 
model to step in the different mode, when it has focus.
* The disassembly view could bind an action to the action definition ids of 
the step commands to override the handler for the step action.

I would like to revisit this issue post 3.1
Comment 15 Darin Wright CLA 2006-03-27 09:37:25 EST
This is fixed in 3.2. There are new interfaces for the debug actions - @see IAsynchronousStep, etc.
Comment 16 Darin Wright CLA 2006-03-27 09:37:39 EST
Marking fixed.
Comment 17 Darin Wright CLA 2006-03-27 09:38:04 EST
Verified