1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

[219031] Added the StepType parameter to IRunControl.canStep().

This commit is contained in:
Pawel Piech 2008-03-27 20:53:39 +00:00
parent 5ac30e181b
commit 23cf575f17
7 changed files with 19 additions and 19 deletions

View file

@ -44,7 +44,7 @@ public class DsfStepIntoCommand implements IStepIntoHandler {
fExecutor.submit(new DsfCommandRunnable(fTracker, request.getElements()[0], request) { fExecutor.submit(new DsfCommandRunnable(fTracker, request.getElements()[0], request) {
@Override public void doExecute() { @Override public void doExecute() {
request.setEnabled(getStepQueueMgr().canEnqueueStep(getContext())); request.setEnabled(getStepQueueMgr().canEnqueueStep(getContext(), StepType.STEP_INTO));
} }
}); });
} }

View file

@ -44,7 +44,7 @@ public class DsfStepOverCommand implements IStepOverHandler {
fExecutor.submit(new DsfCommandRunnable(fTracker, request.getElements()[0], request) { fExecutor.submit(new DsfCommandRunnable(fTracker, request.getElements()[0], request) {
@Override public void doExecute() { @Override public void doExecute() {
request.setEnabled(getStepQueueMgr().canEnqueueStep(getContext())); request.setEnabled(getStepQueueMgr().canEnqueueStep(getContext(), StepType.STEP_OVER));
} }
}); });
} }

View file

@ -44,7 +44,7 @@ public class DsfStepReturnCommand implements IStepReturnHandler {
fExecutor.submit(new DsfCommandRunnable(fTracker, request.getElements()[0], request) { fExecutor.submit(new DsfCommandRunnable(fTracker, request.getElements()[0], request) {
@Override public void doExecute() { @Override public void doExecute() {
request.setEnabled(getStepQueueMgr().canEnqueueStep(getContext())); request.setEnabled(getStepQueueMgr().canEnqueueStep(getContext(), StepType.STEP_RETURN));
} }
}); });
} }

View file

@ -128,8 +128,8 @@ public interface IRunControl extends IDMService
void suspend(IExecutionDMContext context, RequestMonitor requestMonitor); void suspend(IExecutionDMContext context, RequestMonitor requestMonitor);
public enum StepType { STEP_OVER, STEP_INTO, STEP_RETURN }; public enum StepType { STEP_OVER, STEP_INTO, STEP_RETURN };
boolean isStepping(IExecutionDMContext context); boolean isStepping(IExecutionDMContext context);
boolean canStep(IExecutionDMContext context); boolean canStep(IExecutionDMContext context, StepType stepType);
void step(IExecutionDMContext context, StepType stepType, RequestMonitor requestMonitor); 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); void instructionStep(IExecutionDMContext context, StepType stepType, RequestMonitor requestMonitor);
} }

View file

@ -116,16 +116,16 @@ public class StepQueueManager extends AbstractDsfService
/** /**
* Checks whether a step command can be queued up for given context. * Checks whether a step command can be queued up for given context.
*/ */
public boolean canEnqueueStep(IExecutionDMContext execCtx) { public boolean canEnqueueStep(IExecutionDMContext execCtx, StepType stepType) {
return (fRunControl.isSuspended(execCtx) && fRunControl.canStep(execCtx)) || return (fRunControl.isSuspended(execCtx) && fRunControl.canStep(execCtx, stepType)) ||
(fRunControl.isStepping(execCtx) && !isSteppingTimedOut(execCtx)); (fRunControl.isStepping(execCtx) && !isSteppingTimedOut(execCtx));
} }
/** /**
* Checks whether an instruction step command can be queued up for given context. * Checks whether an instruction step command can be queued up for given context.
*/ */
public boolean canEnqueueInstructionStep(IExecutionDMContext execCtx) { public boolean canEnqueueInstructionStep(IExecutionDMContext execCtx, StepType stepType) {
return (fRunControl.isSuspended(execCtx) && fRunControl.canInstructionStep(execCtx)) || return (fRunControl.isSuspended(execCtx) && fRunControl.canInstructionStep(execCtx, stepType)) ||
(fRunControl.isStepping(execCtx) && !isSteppingTimedOut(execCtx)); (fRunControl.isStepping(execCtx) && !isSteppingTimedOut(execCtx));
} }
@ -145,9 +145,9 @@ public class StepQueueManager extends AbstractDsfService
* @param stepType Type of step to execute. * @param stepType Type of step to execute.
*/ */
public void enqueueStep(IExecutionDMContext execCtx, StepType stepType) { public void enqueueStep(IExecutionDMContext execCtx, StepType stepType) {
if (fRunControl.canStep(execCtx)) { if (fRunControl.canStep(execCtx, stepType)) {
fRunControl.step(execCtx, stepType, new RequestMonitor(getExecutor(), null)); fRunControl.step(execCtx, stepType, new RequestMonitor(getExecutor(), null));
} else if (canEnqueueStep(execCtx)) { } else if (canEnqueueStep(execCtx, stepType)) {
List<StepRequest> stepQueue = fStepQueues.get(execCtx); List<StepRequest> stepQueue = fStepQueues.get(execCtx);
if (stepQueue == null) { if (stepQueue == null) {
stepQueue = new LinkedList<StepRequest>(); stepQueue = new LinkedList<StepRequest>();
@ -166,9 +166,9 @@ public class StepQueueManager extends AbstractDsfService
* @param stepType Type of step to execute. * @param stepType Type of step to execute.
*/ */
public void enqueueInstructionStep(IExecutionDMContext execCtx, StepType stepType) { public void enqueueInstructionStep(IExecutionDMContext execCtx, StepType stepType) {
if (fRunControl.canInstructionStep(execCtx)) { if (fRunControl.canInstructionStep(execCtx, stepType)) {
fRunControl.instructionStep(execCtx, stepType, new RequestMonitor(getExecutor(), null)); fRunControl.instructionStep(execCtx, stepType, new RequestMonitor(getExecutor(), null));
} else if (canEnqueueInstructionStep(execCtx)) { } else if (canEnqueueInstructionStep(execCtx, stepType)) {
List<StepRequest> stepQueue = fStepQueues.get(execCtx); List<StepRequest> stepQueue = fStepQueues.get(execCtx);
if (stepQueue == null) { if (stepQueue == null) {
stepQueue = new LinkedList<StepRequest>(); stepQueue = new LinkedList<StepRequest>();
@ -203,7 +203,7 @@ public class StepQueueManager extends AbstractDsfService
StepRequest request = queue.remove(queue.size() - 1); StepRequest request = queue.remove(queue.size() - 1);
if (queue.isEmpty()) fStepQueues.remove(e.getDMContext()); if (queue.isEmpty()) fStepQueues.remove(e.getDMContext());
if (request.fIsInstructionStep) { if (request.fIsInstructionStep) {
if (fRunControl.canInstructionStep(e.getDMContext())) { if (fRunControl.canInstructionStep(e.getDMContext(), request.fStepType)) {
fRunControl.instructionStep( fRunControl.instructionStep(
e.getDMContext(), request.fStepType, new RequestMonitor(getExecutor(), null)); e.getDMContext(), request.fStepType, new RequestMonitor(getExecutor(), null));
} else { } else {
@ -212,7 +212,7 @@ public class StepQueueManager extends AbstractDsfService
fStepQueues.remove(e.getDMContext()); fStepQueues.remove(e.getDMContext());
} }
} else { } else {
if (fRunControl.canStep(e.getDMContext())) { if (fRunControl.canStep(e.getDMContext(), request.fStepType)) {
fRunControl.step(e.getDMContext(), request.fStepType,new RequestMonitor(getExecutor(), null)); fRunControl.step(e.getDMContext(), request.fStepType,new RequestMonitor(getExecutor(), null));
} else { } else {
// For whatever reason we can't step anymore, so clear out // For whatever reason we can't step anymore, so clear out

View file

@ -270,7 +270,7 @@ public class PDARunControl extends AbstractDsfService
} }
} }
public boolean canStep(IExecutionDMContext context) { public boolean canStep(IExecutionDMContext context, StepType stepType) {
return canResume(context); 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; return false;
} }

View file

@ -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); 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; return false;
} }