mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 18:56:02 +02:00
[158610] Converted the IRunControl.can*() methods to be asynchronous.
This commit is contained in:
parent
f740036430
commit
e42dcea7a8
9 changed files with 139 additions and 101 deletions
|
@ -10,7 +10,9 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.dd.dsf.debug.ui.actions;
|
package org.eclipse.dd.dsf.debug.ui.actions;
|
||||||
|
|
||||||
|
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||||
import org.eclipse.dd.dsf.concurrent.DsfExecutor;
|
import org.eclipse.dd.dsf.concurrent.DsfExecutor;
|
||||||
|
import org.eclipse.dd.dsf.concurrent.ImmediateExecutor;
|
||||||
import org.eclipse.dd.dsf.concurrent.Immutable;
|
import org.eclipse.dd.dsf.concurrent.Immutable;
|
||||||
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
||||||
import org.eclipse.dd.dsf.debug.internal.ui.DsfDebugUIPlugin;
|
import org.eclipse.dd.dsf.debug.internal.ui.DsfDebugUIPlugin;
|
||||||
|
@ -44,7 +46,15 @@ public class DsfResumeCommand implements IResumeHandler {
|
||||||
|
|
||||||
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(getRunControl().canResume(getContext()));
|
getRunControl().canResume(
|
||||||
|
getContext(),
|
||||||
|
new DataRequestMonitor<Boolean>(ImmediateExecutor.getInstance(), null) {
|
||||||
|
@Override
|
||||||
|
protected void handleCompleted() {
|
||||||
|
request.setEnabled(isSuccess() && getData());
|
||||||
|
request.done();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,9 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.dd.dsf.debug.ui.actions;
|
package org.eclipse.dd.dsf.debug.ui.actions;
|
||||||
|
|
||||||
|
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||||
import org.eclipse.dd.dsf.concurrent.DsfExecutor;
|
import org.eclipse.dd.dsf.concurrent.DsfExecutor;
|
||||||
|
import org.eclipse.dd.dsf.concurrent.ImmediateExecutor;
|
||||||
import org.eclipse.dd.dsf.concurrent.Immutable;
|
import org.eclipse.dd.dsf.concurrent.Immutable;
|
||||||
import org.eclipse.dd.dsf.debug.internal.ui.DsfDebugUIPlugin;
|
import org.eclipse.dd.dsf.debug.internal.ui.DsfDebugUIPlugin;
|
||||||
import org.eclipse.dd.dsf.debug.service.IRunControl.StepType;
|
import org.eclipse.dd.dsf.debug.service.IRunControl.StepType;
|
||||||
|
@ -44,7 +46,15 @@ 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(), StepType.STEP_INTO));
|
getStepQueueMgr().canEnqueueStep(
|
||||||
|
getContext(), StepType.STEP_INTO,
|
||||||
|
new DataRequestMonitor<Boolean>(ImmediateExecutor.getInstance(), null) {
|
||||||
|
@Override
|
||||||
|
protected void handleCompleted() {
|
||||||
|
request.setEnabled(isSuccess() && getData());
|
||||||
|
request.done();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,9 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.dd.dsf.debug.ui.actions;
|
package org.eclipse.dd.dsf.debug.ui.actions;
|
||||||
|
|
||||||
|
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||||
import org.eclipse.dd.dsf.concurrent.DsfExecutor;
|
import org.eclipse.dd.dsf.concurrent.DsfExecutor;
|
||||||
|
import org.eclipse.dd.dsf.concurrent.ImmediateExecutor;
|
||||||
import org.eclipse.dd.dsf.concurrent.Immutable;
|
import org.eclipse.dd.dsf.concurrent.Immutable;
|
||||||
import org.eclipse.dd.dsf.debug.internal.ui.DsfDebugUIPlugin;
|
import org.eclipse.dd.dsf.debug.internal.ui.DsfDebugUIPlugin;
|
||||||
import org.eclipse.dd.dsf.debug.service.IRunControl.StepType;
|
import org.eclipse.dd.dsf.debug.service.IRunControl.StepType;
|
||||||
|
@ -44,7 +46,15 @@ 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(), StepType.STEP_OVER));
|
getStepQueueMgr().canEnqueueStep(
|
||||||
|
getContext(), StepType.STEP_OVER,
|
||||||
|
new DataRequestMonitor<Boolean>(ImmediateExecutor.getInstance(), null) {
|
||||||
|
@Override
|
||||||
|
protected void handleCompleted() {
|
||||||
|
request.setEnabled(isSuccess() && getData());
|
||||||
|
request.done();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,9 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.dd.dsf.debug.ui.actions;
|
package org.eclipse.dd.dsf.debug.ui.actions;
|
||||||
|
|
||||||
|
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||||
import org.eclipse.dd.dsf.concurrent.DsfExecutor;
|
import org.eclipse.dd.dsf.concurrent.DsfExecutor;
|
||||||
|
import org.eclipse.dd.dsf.concurrent.ImmediateExecutor;
|
||||||
import org.eclipse.dd.dsf.concurrent.Immutable;
|
import org.eclipse.dd.dsf.concurrent.Immutable;
|
||||||
import org.eclipse.dd.dsf.debug.internal.ui.DsfDebugUIPlugin;
|
import org.eclipse.dd.dsf.debug.internal.ui.DsfDebugUIPlugin;
|
||||||
import org.eclipse.dd.dsf.debug.service.IRunControl.StepType;
|
import org.eclipse.dd.dsf.debug.service.IRunControl.StepType;
|
||||||
|
@ -44,7 +46,15 @@ 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(), StepType.STEP_RETURN));
|
getStepQueueMgr().canEnqueueStep(
|
||||||
|
getContext(), StepType.STEP_RETURN,
|
||||||
|
new DataRequestMonitor<Boolean>(ImmediateExecutor.getInstance(), null) {
|
||||||
|
@Override
|
||||||
|
protected void handleCompleted() {
|
||||||
|
request.setEnabled(isSuccess() && getData());
|
||||||
|
request.done();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,9 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.dd.dsf.debug.ui.actions;
|
package org.eclipse.dd.dsf.debug.ui.actions;
|
||||||
|
|
||||||
|
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||||
import org.eclipse.dd.dsf.concurrent.DsfExecutor;
|
import org.eclipse.dd.dsf.concurrent.DsfExecutor;
|
||||||
|
import org.eclipse.dd.dsf.concurrent.ImmediateExecutor;
|
||||||
import org.eclipse.dd.dsf.concurrent.Immutable;
|
import org.eclipse.dd.dsf.concurrent.Immutable;
|
||||||
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
||||||
import org.eclipse.dd.dsf.debug.internal.ui.DsfDebugUIPlugin;
|
import org.eclipse.dd.dsf.debug.internal.ui.DsfDebugUIPlugin;
|
||||||
|
@ -43,7 +45,15 @@ public class DsfSuspendCommand implements ISuspendHandler {
|
||||||
|
|
||||||
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(getRunControl().canSuspend(getContext()));
|
getRunControl().canSuspend(
|
||||||
|
getContext(),
|
||||||
|
new DataRequestMonitor<Boolean>(ImmediateExecutor.getInstance(), null) {
|
||||||
|
@Override
|
||||||
|
protected void handleCompleted() {
|
||||||
|
request.setEnabled(isSuccess() && getData());
|
||||||
|
request.done();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,15 +115,13 @@ public interface IRunControl extends IDMService
|
||||||
* Run control commands. They all require the IExecutionContext object on
|
* Run control commands. They all require the IExecutionContext object on
|
||||||
* which they perform the operations.
|
* which they perform the operations.
|
||||||
*/
|
*/
|
||||||
boolean canResume(IExecutionDMContext context);
|
void canResume(IExecutionDMContext context, DataRequestMonitor<Boolean> rm);
|
||||||
boolean canSuspend(IExecutionDMContext context);
|
void canSuspend(IExecutionDMContext context, DataRequestMonitor<Boolean> rm);
|
||||||
boolean isSuspended(IExecutionDMContext context);
|
boolean isSuspended(IExecutionDMContext context);
|
||||||
void resume(IExecutionDMContext context, RequestMonitor requestMonitor);
|
void resume(IExecutionDMContext context, RequestMonitor requestMonitor);
|
||||||
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, INSTRUCTION_STEP_OVER, INSTRUCTION_STEP_INTO, INSTRUCTION_STEP_RETUTRN };
|
||||||
boolean isStepping(IExecutionDMContext context);
|
boolean isStepping(IExecutionDMContext context);
|
||||||
boolean canStep(IExecutionDMContext context, StepType stepType);
|
void canStep(IExecutionDMContext context, StepType stepType, DataRequestMonitor<Boolean> rm);
|
||||||
void step(IExecutionDMContext context, StepType stepType, RequestMonitor requestMonitor);
|
void step(IExecutionDMContext context, StepType stepType, RequestMonitor requestMonitor);
|
||||||
boolean canInstructionStep(IExecutionDMContext context, StepType stepType);
|
|
||||||
void instructionStep(IExecutionDMContext context, StepType stepType, RequestMonitor requestMonitor);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ import java.util.Map;
|
||||||
import java.util.concurrent.ScheduledFuture;
|
import java.util.concurrent.ScheduledFuture;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||||
import org.eclipse.dd.dsf.concurrent.DsfRunnable;
|
import org.eclipse.dd.dsf.concurrent.DsfRunnable;
|
||||||
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
||||||
import org.eclipse.dd.dsf.datamodel.IDMEvent;
|
import org.eclipse.dd.dsf.datamodel.IDMEvent;
|
||||||
|
@ -64,10 +65,8 @@ public class StepQueueManager extends AbstractDsfService
|
||||||
|
|
||||||
private static class StepRequest {
|
private static class StepRequest {
|
||||||
StepType fStepType;
|
StepType fStepType;
|
||||||
boolean fIsInstructionStep;
|
StepRequest(StepType type) {
|
||||||
StepRequest(StepType type, boolean instruction) {
|
|
||||||
fStepType = type;
|
fStepType = type;
|
||||||
fIsInstructionStep = instruction;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,17 +115,17 @@ 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, StepType stepType) {
|
public void canEnqueueStep(IExecutionDMContext execCtx, StepType stepType, DataRequestMonitor<Boolean> rm) {
|
||||||
return (fRunControl.isSuspended(execCtx) && fRunControl.canStep(execCtx, stepType)) ||
|
if (doCanEnqueueStep(execCtx, stepType)) {
|
||||||
(fRunControl.isStepping(execCtx) && !isSteppingTimedOut(execCtx));
|
rm.setData(true);
|
||||||
|
rm.done();
|
||||||
|
} else {
|
||||||
|
fRunControl.canStep(execCtx, stepType, rm);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private boolean doCanEnqueueStep(IExecutionDMContext execCtx, StepType stepType) {
|
||||||
* Checks whether an instruction step command can be queued up for given context.
|
return fRunControl.isStepping(execCtx) && !isSteppingTimedOut(execCtx);
|
||||||
*/
|
|
||||||
public boolean canEnqueueInstructionStep(IExecutionDMContext execCtx, StepType stepType) {
|
|
||||||
return (fRunControl.isSuspended(execCtx) && fRunControl.canInstructionStep(execCtx, stepType)) ||
|
|
||||||
(fRunControl.isStepping(execCtx) && !isSteppingTimedOut(execCtx));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -144,40 +143,25 @@ public class StepQueueManager extends AbstractDsfService
|
||||||
* @param execCtx Execution context that should perform the step.
|
* @param execCtx Execution context that should perform the step.
|
||||||
* @param stepType Type of step to execute.
|
* @param stepType Type of step to execute.
|
||||||
*/
|
*/
|
||||||
public void enqueueStep(IExecutionDMContext execCtx, StepType stepType) {
|
public void enqueueStep(final IExecutionDMContext execCtx, final StepType stepType) {
|
||||||
if (fRunControl.canStep(execCtx, stepType)) {
|
fRunControl.canStep(
|
||||||
fRunControl.step(execCtx, stepType, new RequestMonitor(getExecutor(), null));
|
execCtx, stepType, new DataRequestMonitor<Boolean>(getExecutor(), null) {
|
||||||
} else if (canEnqueueStep(execCtx, stepType)) {
|
@Override
|
||||||
List<StepRequest> stepQueue = fStepQueues.get(execCtx);
|
protected void handleCompleted() {
|
||||||
if (stepQueue == null) {
|
if (isSuccess() && getData()) {
|
||||||
stepQueue = new LinkedList<StepRequest>();
|
fRunControl.step(execCtx, stepType, new RequestMonitor(getExecutor(), null));
|
||||||
fStepQueues.put(execCtx, stepQueue);
|
} else if (doCanEnqueueStep(execCtx, stepType)) {
|
||||||
}
|
List<StepRequest> stepQueue = fStepQueues.get(execCtx);
|
||||||
if (stepQueue.size() < fQueueDepth) {
|
if (stepQueue == null) {
|
||||||
stepQueue.add(new StepRequest(stepType, false));
|
stepQueue = new LinkedList<StepRequest>();
|
||||||
}
|
fStepQueues.put(execCtx, stepQueue);
|
||||||
}
|
}
|
||||||
}
|
if (stepQueue.size() < fQueueDepth) {
|
||||||
|
stepQueue.add(new StepRequest(stepType));
|
||||||
/**
|
}
|
||||||
* Adds an instruction step command to the execution queue for given
|
}
|
||||||
* context.
|
}
|
||||||
* @param execCtx Execution context that should perform the step.
|
});
|
||||||
* @param stepType Type of step to execute.
|
|
||||||
*/
|
|
||||||
public void enqueueInstructionStep(IExecutionDMContext execCtx, StepType stepType) {
|
|
||||||
if (fRunControl.canInstructionStep(execCtx, stepType)) {
|
|
||||||
fRunControl.instructionStep(execCtx, stepType, new RequestMonitor(getExecutor(), null));
|
|
||||||
} else if (canEnqueueInstructionStep(execCtx, stepType)) {
|
|
||||||
List<StepRequest> stepQueue = fStepQueues.get(execCtx);
|
|
||||||
if (stepQueue == null) {
|
|
||||||
stepQueue = new LinkedList<StepRequest>();
|
|
||||||
fStepQueues.put(execCtx, stepQueue);
|
|
||||||
}
|
|
||||||
if (stepQueue.size() < fQueueDepth) {
|
|
||||||
stepQueue.add(new StepRequest(stepType, true));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -191,7 +175,7 @@ public class StepQueueManager extends AbstractDsfService
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@DsfServiceEventHandler
|
@DsfServiceEventHandler
|
||||||
public void eventDispatched(ISuspendedDMEvent e) {
|
public void eventDispatched(final ISuspendedDMEvent e) {
|
||||||
// Take care of the stepping time out
|
// Take care of the stepping time out
|
||||||
fTimedOutFlags.remove(e.getDMContext());
|
fTimedOutFlags.remove(e.getDMContext());
|
||||||
ScheduledFuture<?> future = fTimedOutFutures.remove(e.getDMContext());
|
ScheduledFuture<?> future = fTimedOutFutures.remove(e.getDMContext());
|
||||||
|
@ -200,26 +184,23 @@ public class StepQueueManager extends AbstractDsfService
|
||||||
// Check if there's a step pending, if so execute it
|
// Check if there's a step pending, if so execute it
|
||||||
if (fStepQueues.containsKey(e.getDMContext())) {
|
if (fStepQueues.containsKey(e.getDMContext())) {
|
||||||
List<StepRequest> queue = fStepQueues.get(e.getDMContext());
|
List<StepRequest> queue = fStepQueues.get(e.getDMContext());
|
||||||
StepRequest request = queue.remove(queue.size() - 1);
|
final StepRequest request = queue.remove(queue.size() - 1);
|
||||||
if (queue.isEmpty()) fStepQueues.remove(e.getDMContext());
|
if (queue.isEmpty()) fStepQueues.remove(e.getDMContext());
|
||||||
if (request.fIsInstructionStep) {
|
fRunControl.canStep(
|
||||||
if (fRunControl.canInstructionStep(e.getDMContext(), request.fStepType)) {
|
e.getDMContext(), request.fStepType,
|
||||||
fRunControl.instructionStep(
|
new DataRequestMonitor<Boolean>(getExecutor(), null) {
|
||||||
e.getDMContext(), request.fStepType, new RequestMonitor(getExecutor(), null));
|
@Override
|
||||||
} else {
|
protected void handleCompleted() {
|
||||||
// For whatever reason we can't step anymore, so clear out
|
if (isSuccess() && getData()) {
|
||||||
// the step queue.
|
fRunControl.step(
|
||||||
fStepQueues.remove(e.getDMContext());
|
e.getDMContext(), request.fStepType, new RequestMonitor(getExecutor(), null));
|
||||||
}
|
} else {
|
||||||
} else {
|
// For whatever reason we can't step anymore, so clear out
|
||||||
if (fRunControl.canStep(e.getDMContext(), request.fStepType)) {
|
// the step queue.
|
||||||
fRunControl.step(e.getDMContext(), request.fStepType,new RequestMonitor(getExecutor(), null));
|
fStepQueues.remove(e.getDMContext());
|
||||||
} else {
|
}
|
||||||
// For whatever reason we can't step anymore, so clear out
|
}
|
||||||
// the step queue.
|
});
|
||||||
fStepQueues.remove(e.getDMContext());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -219,13 +219,23 @@ public class PDARunControl extends AbstractDsfService
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean canResume(IExecutionDMContext context) {
|
public void canResume(IExecutionDMContext context, DataRequestMonitor<Boolean> rm) {
|
||||||
|
rm.setData(doCanResume(context));
|
||||||
|
rm.done();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean doCanResume(IExecutionDMContext context) {
|
||||||
return isSuspended(context) && !fResumePending;
|
return isSuspended(context) && !fResumePending;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canSuspend(IExecutionDMContext context) {
|
public void canSuspend(IExecutionDMContext context, DataRequestMonitor<Boolean> rm) {
|
||||||
|
rm.setData(doCanSuspend(context));
|
||||||
|
rm.done();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean doCanSuspend(IExecutionDMContext context) {
|
||||||
return !isSuspended(context);
|
return !isSuspended(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSuspended(IExecutionDMContext context) {
|
public boolean isSuspended(IExecutionDMContext context) {
|
||||||
return fSuspended;
|
return fSuspended;
|
||||||
|
@ -238,7 +248,7 @@ public class PDARunControl extends AbstractDsfService
|
||||||
public void resume(IExecutionDMContext context, final RequestMonitor rm) {
|
public void resume(IExecutionDMContext context, final RequestMonitor rm) {
|
||||||
assert context != null;
|
assert context != null;
|
||||||
|
|
||||||
if (canResume(context)) {
|
if (doCanResume(context)) {
|
||||||
fResumePending = true;
|
fResumePending = true;
|
||||||
fCommandControl.queueCommand(
|
fCommandControl.queueCommand(
|
||||||
new PDAResumeCommand(fCommandControl.getProgramDMContext()),
|
new PDAResumeCommand(fCommandControl.getProgramDMContext()),
|
||||||
|
@ -260,7 +270,7 @@ public class PDARunControl extends AbstractDsfService
|
||||||
public void suspend(IExecutionDMContext context, final RequestMonitor rm){
|
public void suspend(IExecutionDMContext context, final RequestMonitor rm){
|
||||||
assert context != null;
|
assert context != null;
|
||||||
|
|
||||||
if (canSuspend(context)) {
|
if (doCanSuspend(context)) {
|
||||||
fCommandControl.queueCommand(
|
fCommandControl.queueCommand(
|
||||||
new PDASuspendCommand(fCommandControl.getProgramDMContext()),
|
new PDASuspendCommand(fCommandControl.getProgramDMContext()),
|
||||||
new DataRequestMonitor<PDACommandResult>(getExecutor(), rm));
|
new DataRequestMonitor<PDACommandResult>(getExecutor(), rm));
|
||||||
|
@ -270,14 +280,14 @@ public class PDARunControl extends AbstractDsfService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canStep(IExecutionDMContext context, StepType stepType) {
|
public void canStep(IExecutionDMContext context, StepType stepType, DataRequestMonitor<Boolean> rm) {
|
||||||
return canResume(context);
|
canResume(context, rm);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void step(IExecutionDMContext context, StepType stepType, final RequestMonitor rm) {
|
public void step(IExecutionDMContext context, StepType stepType, final RequestMonitor rm) {
|
||||||
assert context != null;
|
assert context != null;
|
||||||
|
|
||||||
if (canResume(context)) {
|
if (doCanResume(context)) {
|
||||||
fResumePending = true;
|
fResumePending = true;
|
||||||
fStepping = true;
|
fStepping = true;
|
||||||
|
|
||||||
|
@ -299,14 +309,6 @@ public class PDARunControl extends AbstractDsfService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canInstructionStep(IExecutionDMContext context, StepType stepType) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void instructionStep(IExecutionDMContext context, StepType stepType, RequestMonitor rm) {
|
|
||||||
PDAPlugin.failRequest(rm, NOT_SUPPORTED, "Operation not implemented");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void getExecutionContexts(final IContainerDMContext containerDmc, final DataRequestMonitor<IExecutionDMContext[]> rm) {
|
public void getExecutionContexts(final IContainerDMContext containerDmc, final DataRequestMonitor<IExecutionDMContext[]> rm) {
|
||||||
PDAPlugin.failRequest(rm, NOT_SUPPORTED, "Operation not implemented");
|
PDAPlugin.failRequest(rm, NOT_SUPPORTED, "Operation not implemented");
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,13 +110,20 @@ public class GDBRunControl extends MIRunControl {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void suspend(IExecutionDMContext context, RequestMonitor requestMonitor){
|
public void suspend(IExecutionDMContext context, final RequestMonitor rm){
|
||||||
if (canSuspend(context)) {
|
canSuspend(
|
||||||
fGdb.interrupt();
|
context,
|
||||||
} else {
|
new DataRequestMonitor<Boolean>(getExecutor(), rm) {
|
||||||
requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_STATE, "Context cannot be suspended.", null)); //$NON-NLS-1$
|
@Override
|
||||||
}
|
protected void handleSuccess() {
|
||||||
requestMonitor.done();
|
if (getData()) {
|
||||||
|
fGdb.interrupt();
|
||||||
|
} else {
|
||||||
|
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_STATE, "Context cannot be suspended.", null)); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
rm.done();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue