diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/actions/DsfStepIntoCommand.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/actions/DsfStepIntoCommand.java index 31a184e29b0..52ce0cefcb6 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/actions/DsfStepIntoCommand.java +++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/actions/DsfStepIntoCommand.java @@ -44,7 +44,7 @@ public class DsfStepIntoCommand implements IStepIntoHandler { fExecutor.submit(new DsfCommandRunnable(fTracker, request.getElements()[0], request) { @Override public void doExecute() { - request.setEnabled(getStepQueueMgr().canEnqueueStep(getContext())); + request.setEnabled(getStepQueueMgr().canEnqueueStep(getContext(), StepType.STEP_INTO)); } }); } diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/actions/DsfStepOverCommand.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/actions/DsfStepOverCommand.java index 6967dedd3be..f4c2a28afa7 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/actions/DsfStepOverCommand.java +++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/actions/DsfStepOverCommand.java @@ -44,7 +44,7 @@ public class DsfStepOverCommand implements IStepOverHandler { fExecutor.submit(new DsfCommandRunnable(fTracker, request.getElements()[0], request) { @Override public void doExecute() { - request.setEnabled(getStepQueueMgr().canEnqueueStep(getContext())); + request.setEnabled(getStepQueueMgr().canEnqueueStep(getContext(), StepType.STEP_OVER)); } }); } diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/actions/DsfStepReturnCommand.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/actions/DsfStepReturnCommand.java index 295919ac191..d3d9dc2d16b 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/actions/DsfStepReturnCommand.java +++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/actions/DsfStepReturnCommand.java @@ -44,7 +44,7 @@ public class DsfStepReturnCommand implements IStepReturnHandler { fExecutor.submit(new DsfCommandRunnable(fTracker, request.getElements()[0], request) { @Override public void doExecute() { - request.setEnabled(getStepQueueMgr().canEnqueueStep(getContext())); + request.setEnabled(getStepQueueMgr().canEnqueueStep(getContext(), StepType.STEP_RETURN)); } }); } diff --git a/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/IRunControl.java b/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/IRunControl.java index a7f5b14bab8..b5b0d4a3421 100644 --- a/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/IRunControl.java +++ b/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/IRunControl.java @@ -128,8 +128,8 @@ public interface IRunControl extends IDMService void suspend(IExecutionDMContext context, RequestMonitor requestMonitor); public enum StepType { STEP_OVER, STEP_INTO, STEP_RETURN }; boolean isStepping(IExecutionDMContext context); - boolean canStep(IExecutionDMContext context); + boolean canStep(IExecutionDMContext context, StepType stepType); void step(IExecutionDMContext context, StepType stepType, RequestMonitor requestMonitor); - boolean canInstructionStep(IExecutionDMContext context); + boolean canInstructionStep(IExecutionDMContext context, StepType stepType); void instructionStep(IExecutionDMContext context, StepType stepType, RequestMonitor requestMonitor); } diff --git a/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/StepQueueManager.java b/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/StepQueueManager.java index e15bbcb5040..2fea35e74bd 100644 --- a/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/StepQueueManager.java +++ b/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/StepQueueManager.java @@ -116,16 +116,16 @@ public class StepQueueManager extends AbstractDsfService /** * Checks whether a step command can be queued up for given context. */ - public boolean canEnqueueStep(IExecutionDMContext execCtx) { - return (fRunControl.isSuspended(execCtx) && fRunControl.canStep(execCtx)) || + public boolean canEnqueueStep(IExecutionDMContext execCtx, StepType stepType) { + return (fRunControl.isSuspended(execCtx) && fRunControl.canStep(execCtx, stepType)) || (fRunControl.isStepping(execCtx) && !isSteppingTimedOut(execCtx)); } /** * Checks whether an instruction step command can be queued up for given context. */ - public boolean canEnqueueInstructionStep(IExecutionDMContext execCtx) { - return (fRunControl.isSuspended(execCtx) && fRunControl.canInstructionStep(execCtx)) || + public boolean canEnqueueInstructionStep(IExecutionDMContext execCtx, StepType stepType) { + return (fRunControl.isSuspended(execCtx) && fRunControl.canInstructionStep(execCtx, stepType)) || (fRunControl.isStepping(execCtx) && !isSteppingTimedOut(execCtx)); } @@ -145,9 +145,9 @@ public class StepQueueManager extends AbstractDsfService * @param stepType Type of step to execute. */ public void enqueueStep(IExecutionDMContext execCtx, StepType stepType) { - if (fRunControl.canStep(execCtx)) { + if (fRunControl.canStep(execCtx, stepType)) { fRunControl.step(execCtx, stepType, new RequestMonitor(getExecutor(), null)); - } else if (canEnqueueStep(execCtx)) { + } else if (canEnqueueStep(execCtx, stepType)) { List stepQueue = fStepQueues.get(execCtx); if (stepQueue == null) { stepQueue = new LinkedList(); @@ -166,9 +166,9 @@ public class StepQueueManager extends AbstractDsfService * @param stepType Type of step to execute. */ public void enqueueInstructionStep(IExecutionDMContext execCtx, StepType stepType) { - if (fRunControl.canInstructionStep(execCtx)) { + if (fRunControl.canInstructionStep(execCtx, stepType)) { fRunControl.instructionStep(execCtx, stepType, new RequestMonitor(getExecutor(), null)); - } else if (canEnqueueInstructionStep(execCtx)) { + } else if (canEnqueueInstructionStep(execCtx, stepType)) { List stepQueue = fStepQueues.get(execCtx); if (stepQueue == null) { stepQueue = new LinkedList(); @@ -203,7 +203,7 @@ public class StepQueueManager extends AbstractDsfService StepRequest request = queue.remove(queue.size() - 1); if (queue.isEmpty()) fStepQueues.remove(e.getDMContext()); if (request.fIsInstructionStep) { - if (fRunControl.canInstructionStep(e.getDMContext())) { + if (fRunControl.canInstructionStep(e.getDMContext(), request.fStepType)) { fRunControl.instructionStep( e.getDMContext(), request.fStepType, new RequestMonitor(getExecutor(), null)); } else { @@ -212,7 +212,7 @@ public class StepQueueManager extends AbstractDsfService fStepQueues.remove(e.getDMContext()); } } else { - if (fRunControl.canStep(e.getDMContext())) { + if (fRunControl.canStep(e.getDMContext(), request.fStepType)) { fRunControl.step(e.getDMContext(), request.fStepType,new RequestMonitor(getExecutor(), null)); } else { // For whatever reason we can't step anymore, so clear out diff --git a/plugins/org.eclipse.dd.examples.pda/src/org/eclipse/dd/examples/pda/service/PDARunControl.java b/plugins/org.eclipse.dd.examples.pda/src/org/eclipse/dd/examples/pda/service/PDARunControl.java index 6a0c0c59ed9..a9e70efc4d7 100644 --- a/plugins/org.eclipse.dd.examples.pda/src/org/eclipse/dd/examples/pda/service/PDARunControl.java +++ b/plugins/org.eclipse.dd.examples.pda/src/org/eclipse/dd/examples/pda/service/PDARunControl.java @@ -270,7 +270,7 @@ public class PDARunControl extends AbstractDsfService } } - public boolean canStep(IExecutionDMContext context) { + public boolean canStep(IExecutionDMContext context, StepType stepType) { return canResume(context); } @@ -299,7 +299,7 @@ public class PDARunControl extends AbstractDsfService } } - public boolean canInstructionStep(IExecutionDMContext context) { + public boolean canInstructionStep(IExecutionDMContext context, StepType stepType) { return false; } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRunControl.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRunControl.java index 31481a48b4c..0294e4035cc 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRunControl.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRunControl.java @@ -527,7 +527,7 @@ public class MIRunControl extends AbstractDsfService implements IRunControl } } - public boolean canStep(IExecutionDMContext context) { + public boolean canStep(IExecutionDMContext context, StepType stepType) { return canResume(context); } @@ -583,7 +583,7 @@ public class MIRunControl extends AbstractDsfService implements IRunControl } } - public boolean canInstructionStep(IExecutionDMContext context) { + public boolean canInstructionStep(IExecutionDMContext context, StepType stepType) { return false; }