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:
parent
5ac30e181b
commit
23cf575f17
7 changed files with 19 additions and 19 deletions
|
@ -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));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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<StepRequest> stepQueue = fStepQueues.get(execCtx);
|
||||
if (stepQueue == null) {
|
||||
stepQueue = new LinkedList<StepRequest>();
|
||||
|
@ -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<StepRequest> stepQueue = fStepQueues.get(execCtx);
|
||||
if (stepQueue == null) {
|
||||
stepQueue = new LinkedList<StepRequest>();
|
||||
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue