1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +02:00

[236765] - Additional fixes for use of command cache.

This commit is contained in:
Pawel Piech 2008-06-17 03:46:41 +00:00
parent 25500c44ab
commit a8fe7f6a27
17 changed files with 49 additions and 59 deletions

View file

@ -292,11 +292,7 @@ public class PDAExpressions extends AbstractDsfService implements IExpressions {
// Send the command to evaluate the variable.
fCommandCache.execute(
new PDAVarCommand(
fCommandControl.getVirtualMachineDMContext(),
threadCtx.getID(),
frameId,
exprCtx.getExpression()),
new PDAVarCommand(threadCtx, frameId, exprCtx.getExpression()),
new DataRequestMonitor<PDACommandResult>(getExecutor(), rm) {
@Override
protected void handleSuccess() {
@ -331,12 +327,7 @@ public class PDAExpressions extends AbstractDsfService implements IExpressions {
// Send the "write" command to PDA debugger
fCommandCache.execute(
new PDASetVarCommand(
fCommandControl.getVirtualMachineDMContext(),
threadCtx.getID(),
frameId,
exprCtx.getExpression(),
exprValue),
new PDASetVarCommand( threadCtx, frameId, exprCtx.getExpression(), exprValue),
new DataRequestMonitor<PDACommandResult>(getExecutor(), rm) {
@Override
protected void handleSuccess() {

View file

@ -530,7 +530,7 @@ public class PDARunControl extends AbstractDsfService
final PDAThreadDMContext threadCtx = (PDAThreadDMContext)context;
fThreads.get(threadCtx.getID()).fResumePending = true;
fCommandControl.queueCommand(
new PDAResumeCommand(fDMContext, threadCtx.getID()),
new PDAResumeCommand(threadCtx),
new DataRequestMonitor<PDACommandResult>(getExecutor(), rm) {
@Override
protected void handleFailure() {
@ -618,8 +618,8 @@ public class PDARunControl extends AbstractDsfService
AbstractPDACommand<PDACommandResult> stepCommand =
stepType == StepType.STEP_RETURN
? new PDAStepReturnCommand(fDMContext, threadCtx.getID())
: new PDAStepCommand(fDMContext, threadCtx.getID());
? new PDAStepReturnCommand(threadCtx)
: new PDAStepCommand(threadCtx);
fCommandControl.queueCommand(

View file

@ -232,7 +232,7 @@ public class PDAStack extends AbstractDsfService implements IStack {
// Execute the PDA stack command, or retrieve the result from cache if already available.
fCommandCache.execute(
new PDAStackCommand(fCommandControl.getVirtualMachineDMContext(), threadCtx.getID()),
new PDAStackCommand(threadCtx),
new DataRequestMonitor<PDAStackCommandResult>(getExecutor(), rm) {
@Override
protected void handleSuccess() {
@ -268,7 +268,7 @@ public class PDAStack extends AbstractDsfService implements IStack {
// Execute the stack command and create the corresponding frame contexts.
fCommandCache.execute(
new PDAStackCommand(fCommandControl.getVirtualMachineDMContext(), threadCtx.getID()),
new PDAStackCommand(threadCtx),
new DataRequestMonitor<PDAStackCommandResult>(getExecutor(), rm) {
@Override
protected void handleSuccess() {
@ -300,7 +300,7 @@ public class PDAStack extends AbstractDsfService implements IStack {
}
fCommandCache.execute(
new PDAStackCommand(fCommandControl.getVirtualMachineDMContext(), threadCtx.getID()),
new PDAStackCommand(threadCtx),
new DataRequestMonitor<PDAStackCommandResult>(getExecutor(), rm) {
@Override
protected void handleSuccess() {
@ -336,7 +336,7 @@ public class PDAStack extends AbstractDsfService implements IStack {
// Execute stack command and return the data's size.
fCommandCache.execute(
new PDAStackCommand(fCommandControl.getVirtualMachineDMContext(), threadCtx.getID()),
new PDAStackCommand(threadCtx),
new DataRequestMonitor<PDAStackCommandResult>(getExecutor(), rm) {
@Override
protected void handleSuccess() {

View file

@ -14,7 +14,6 @@ import org.eclipse.dd.dsf.concurrent.Immutable;
import org.eclipse.dd.dsf.datamodel.IDMContext;
import org.eclipse.dd.dsf.debug.service.command.ICommand;
import org.eclipse.dd.dsf.debug.service.command.ICommandResult;
import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
/**
* Base class for PDA commands. The PDA commands consist of a text request and
@ -27,7 +26,7 @@ abstract public class AbstractPDACommand<V extends PDACommandResult> implements
final private IDMContext fContext;
final private String fRequest;
public AbstractPDACommand(PDAVirtualMachineDMContext context, String request) {
public AbstractPDACommand(IDMContext context, String request) {
fContext = context;
fRequest = request;
}

View file

@ -11,7 +11,7 @@
package org.eclipse.dd.examples.pda.service.commands;
import org.eclipse.dd.dsf.concurrent.Immutable;
import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
import org.eclipse.dd.examples.pda.service.PDAThreadDMContext;
/**
* Retrieves data stack information
@ -27,8 +27,8 @@ import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
@Immutable
public class PDADataCommand extends AbstractPDACommand<PDADataCommandResult> {
public PDADataCommand(PDAVirtualMachineDMContext context, int threadId) {
super(context, "data " + threadId);
public PDADataCommand(PDAThreadDMContext thread) {
super(thread, "data " + thread.getID());
}
@Override

View file

@ -11,7 +11,7 @@
package org.eclipse.dd.examples.pda.service.commands;
import org.eclipse.dd.dsf.concurrent.Immutable;
import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
import org.eclipse.dd.examples.pda.service.PDAThreadDMContext;
/**
* Returns from the current frame without executing the rest of instructions.
@ -36,8 +36,8 @@ import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
@Immutable
public class PDADropFrameCommand extends AbstractPDACommand<PDACommandResult> {
public PDADropFrameCommand(PDAVirtualMachineDMContext context, int threadId) {
super(context, "drop " + threadId);
public PDADropFrameCommand(PDAThreadDMContext thread) {
super(thread, "drop " + thread.getID());
}
@Override

View file

@ -11,7 +11,7 @@
package org.eclipse.dd.examples.pda.service.commands;
import org.eclipse.dd.dsf.concurrent.Immutable;
import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
import org.eclipse.dd.examples.pda.service.PDAThreadDMContext;
/**
* Sets what events cause the execution to stop.
@ -34,8 +34,8 @@ import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
@Immutable
public class PDAEvalCommand extends AbstractPDACommand<PDACommandResult> {
public PDAEvalCommand(PDAVirtualMachineDMContext context, int threadId, String operation) {
super(context, "eval " + threadId + " " + operation);
public PDAEvalCommand(PDAThreadDMContext thread, String operation) {
super(thread, "eval " + thread.getID() + " " + operation);
}
@Override

View file

@ -11,7 +11,7 @@
package org.eclipse.dd.examples.pda.service.commands;
import org.eclipse.dd.dsf.concurrent.Immutable;
import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
import org.eclipse.dd.examples.pda.service.PDAThreadDMContext;
/**
* Pops the top value from the data stack
@ -27,8 +27,8 @@ import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
@Immutable
public class PDAPopDataCommand extends AbstractPDACommand<PDACommandResult> {
public PDAPopDataCommand(PDAVirtualMachineDMContext context, int threadId) {
super(context, "popdata " + threadId);
public PDAPopDataCommand(PDAThreadDMContext thread) {
super(thread, "popdata " + thread.getID());
}
@Override

View file

@ -11,7 +11,7 @@
package org.eclipse.dd.examples.pda.service.commands;
import org.eclipse.dd.dsf.concurrent.Immutable;
import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
import org.eclipse.dd.examples.pda.service.PDAThreadDMContext;
/**
* Pushes the given value on top of the data stack.
@ -27,8 +27,8 @@ import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
@Immutable
public class PDAPushDataCommand extends AbstractPDACommand<PDACommandResult> {
public PDAPushDataCommand(PDAVirtualMachineDMContext context, int threadId, int value) {
super(context, "pushdata " + threadId + " " + value);
public PDAPushDataCommand(PDAThreadDMContext thread, int value) {
super(thread, "pushdata " + thread.getID() + " " + value);
}
@Override

View file

@ -11,7 +11,7 @@
package org.eclipse.dd.examples.pda.service.commands;
import org.eclipse.dd.dsf.concurrent.Immutable;
import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
import org.eclipse.dd.examples.pda.service.PDAThreadDMContext;
/**
* Resumes the execution of a single thread. Can be issued only if the virtual
@ -31,8 +31,8 @@ import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
@Immutable
public class PDAResumeCommand extends AbstractPDACommand<PDACommandResult> {
public PDAResumeCommand(PDAVirtualMachineDMContext context, int threadId) {
super(context, "resume " + threadId);
public PDAResumeCommand(PDAThreadDMContext thread) {
super(thread, "resume " + thread.getID());
}
@Override

View file

@ -11,7 +11,7 @@
package org.eclipse.dd.examples.pda.service.commands;
import org.eclipse.dd.dsf.concurrent.Immutable;
import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
import org.eclipse.dd.examples.pda.service.PDAThreadDMContext;
/**
* Sets a data value in the data stack at the given location
@ -27,8 +27,8 @@ import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
@Immutable
public class PDASetDataCommand extends AbstractPDACommand<PDACommandResult> {
public PDASetDataCommand(PDAVirtualMachineDMContext context, int threadId, int index, String value) {
super(context, "setdata " + threadId + " " + index + " " + value);
public PDASetDataCommand(PDAThreadDMContext thread, int index, String value) {
super(thread, "setdata " + thread.getID() + " " + index + " " + value);
}
@Override

View file

@ -11,7 +11,7 @@
package org.eclipse.dd.examples.pda.service.commands;
import org.eclipse.dd.dsf.concurrent.Immutable;
import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
import org.eclipse.dd.examples.pda.service.PDAThreadDMContext;
/**
* Sets a variable value
@ -27,8 +27,8 @@ import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
@Immutable
public class PDASetVarCommand extends AbstractPDACommand<PDACommandResult> {
public PDASetVarCommand(PDAVirtualMachineDMContext context, int threadId, int frame, String variable, String value) {
super(context, "setvar " + threadId + " " + frame + " " + variable + " " + value);
public PDASetVarCommand(PDAThreadDMContext thread, int frame, String variable, String value) {
super(thread, "setvar " + thread.getID() + " " + frame + " " + variable + " " + value);
}
@Override

View file

@ -11,7 +11,7 @@
package org.eclipse.dd.examples.pda.service.commands;
import org.eclipse.dd.dsf.concurrent.Immutable;
import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
import org.eclipse.dd.examples.pda.service.PDAThreadDMContext;
/**
* Retrieves command stack information
@ -27,8 +27,8 @@ import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
@Immutable
public class PDAStackCommand extends AbstractPDACommand<PDAStackCommandResult> {
public PDAStackCommand(PDAVirtualMachineDMContext context, int threadId) {
super(context, "stack " + threadId);
public PDAStackCommand(PDAThreadDMContext thread) {
super(thread, "stack " + thread.getID());
}
@Override

View file

@ -11,7 +11,7 @@
package org.eclipse.dd.examples.pda.service.commands;
import org.eclipse.dd.dsf.concurrent.Immutable;
import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
import org.eclipse.dd.examples.pda.service.PDAThreadDMContext;
/**
* Executes next instruction
@ -36,8 +36,8 @@ import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
@Immutable
public class PDAStepCommand extends AbstractPDACommand<PDACommandResult> {
public PDAStepCommand(PDAVirtualMachineDMContext context, int threadId) {
super(context, "step " + threadId);
public PDAStepCommand(PDAThreadDMContext thread) {
super(thread, "step " + thread.getID());
}
@Override

View file

@ -11,7 +11,7 @@
package org.eclipse.dd.examples.pda.service.commands;
import org.eclipse.dd.dsf.concurrent.Immutable;
import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
import org.eclipse.dd.examples.pda.service.PDAThreadDMContext;
/**
* Executes instructions until the current subroutine is finished
@ -36,8 +36,8 @@ import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
@Immutable
public class PDAStepReturnCommand extends AbstractPDACommand<PDACommandResult> {
public PDAStepReturnCommand(PDAVirtualMachineDMContext context, int threadId) {
super(context, "stepreturn " + threadId);
public PDAStepReturnCommand(PDAThreadDMContext thread) {
super(thread, "stepreturn " + thread.getID());
}
@Override

View file

@ -11,7 +11,7 @@
package org.eclipse.dd.examples.pda.service.commands;
import org.eclipse.dd.dsf.concurrent.Immutable;
import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
import org.eclipse.dd.examples.pda.service.PDAThreadDMContext;
/**
* Suspends execution of a single thread. Can be issued only if the virtual
@ -31,8 +31,8 @@ import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
@Immutable
public class PDASuspendCommand extends AbstractPDACommand<PDACommandResult> {
public PDASuspendCommand(PDAVirtualMachineDMContext context, int threadId) {
super(context, "suspend " + threadId);
public PDASuspendCommand(PDAThreadDMContext thread) {
super(thread, "suspend " + thread.getID());
}
@Override

View file

@ -11,7 +11,7 @@
package org.eclipse.dd.examples.pda.service.commands;
import org.eclipse.dd.dsf.concurrent.Immutable;
import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
import org.eclipse.dd.examples.pda.service.PDAThreadDMContext;
/**
* Retrieves variable value
@ -28,8 +28,8 @@ import org.eclipse.dd.examples.pda.service.PDAVirtualMachineDMContext;
@Immutable
public class PDAVarCommand extends AbstractPDACommand<PDACommandResult> {
public PDAVarCommand(PDAVirtualMachineDMContext context, int threadId, int frameId, String name) {
super(context, "var " + threadId + " " + frameId + " " + name);
public PDAVarCommand(PDAThreadDMContext thread, int frameId, String name) {
super(thread, "var " + thread.getID() + " " + frameId + " " + name);
}
@Override