mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
2004-09-09 Alain Magloire
Introduction of new classes in the CDI interface ICDIExecuteStep ICDIExecuteStepReturn ICDIExecuteResume ICDISuspend ICDIThreadGroup The code is adjust to the new demands.
This commit is contained in:
parent
f2a61c16a4
commit
d20c71ba18
13 changed files with 372 additions and 222 deletions
|
@ -1,3 +1,12 @@
|
|||
2004-09-09 Alain Magloire
|
||||
Introduction of new classes in the CDI interface
|
||||
ICDIExecuteStep
|
||||
ICDIExecuteStepReturn
|
||||
ICDIExecuteResume
|
||||
ICDISuspend
|
||||
ICDIThreadGroup
|
||||
The code is adjust to the new demands.
|
||||
|
||||
2004-09-07 Alain Magloire
|
||||
|
||||
Remove ICDIBreakpointManager class
|
||||
|
|
|
@ -386,16 +386,16 @@ public class EventManager extends SessionObject implements ICDIEventManager, Obs
|
|||
if (lastUserCommand == null) {
|
||||
switch (type) {
|
||||
case MIRunningEvent.NEXT:
|
||||
lastUserCommand = factory.createMIExecNext();
|
||||
lastUserCommand = factory.createMIExecNext(1);
|
||||
break;
|
||||
case MIRunningEvent.NEXTI:
|
||||
lastUserCommand = factory.createMIExecNextInstruction();
|
||||
lastUserCommand = factory.createMIExecNextInstruction(1);
|
||||
break;
|
||||
case MIRunningEvent.STEP:
|
||||
lastUserCommand = factory.createMIExecStep();
|
||||
lastUserCommand = factory.createMIExecStep(1);
|
||||
break;
|
||||
case MIRunningEvent.STEPI:
|
||||
lastUserCommand = factory.createMIExecStepInstruction();
|
||||
lastUserCommand = factory.createMIExecStepInstruction(1);
|
||||
break;
|
||||
case MIRunningEvent.FINISH:
|
||||
lastUserCommand = factory.createMIExecFinish();
|
||||
|
|
|
@ -17,7 +17,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
|
|||
*/
|
||||
public class CObject implements ICDIObject {
|
||||
|
||||
private Target fTarget;
|
||||
protected Target fTarget;
|
||||
|
||||
public CObject(Target t) {
|
||||
fTarget = t;
|
||||
|
|
|
@ -74,6 +74,6 @@ public class Signal extends CObject implements ICDISignal {
|
|||
* Continue program giving it signal specified by the argument.
|
||||
*/
|
||||
public void signal() throws CDIException {
|
||||
getTarget().signal(this);
|
||||
getTarget().resume(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,12 +16,21 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIArgument;
|
|||
import org.eclipse.cdt.debug.core.cdi.model.ICDIArgumentObject;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIValue;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject;
|
||||
import org.eclipse.cdt.debug.mi.core.MIException;
|
||||
import org.eclipse.cdt.debug.mi.core.MISession;
|
||||
import org.eclipse.cdt.debug.mi.core.cdi.CdiResources;
|
||||
import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException;
|
||||
import org.eclipse.cdt.debug.mi.core.cdi.Session;
|
||||
import org.eclipse.cdt.debug.mi.core.cdi.Location;
|
||||
import org.eclipse.cdt.debug.mi.core.cdi.VariableManager;
|
||||
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIExecFinish;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIExecReturn;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIFrame;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
|
||||
|
||||
/**
|
||||
*/
|
||||
|
@ -148,4 +157,65 @@ public class StackFrame extends CObject implements ICDIStackFrame {
|
|||
return super.equals(stackframe);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIExecuteStepReturn#stepReturn()
|
||||
*/
|
||||
public void stepReturn() throws CDIException {
|
||||
finish();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIExecuteStepReturn#stepReturn(org.eclipse.cdt.debug.core.cdi.model.ICDIValue)
|
||||
*/
|
||||
public void stepReturn(ICDIValue value) throws CDIException {
|
||||
execReturn(value.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
protected void finish() throws CDIException {
|
||||
|
||||
((Thread)getThread()).setCurrentStackFrame(this, false);
|
||||
|
||||
Target target = (Target)getTarget();
|
||||
MISession miSession = target.getMISession();
|
||||
CommandFactory factory = miSession.getCommandFactory();
|
||||
MIExecFinish finish = factory.createMIExecFinish();
|
||||
try {
|
||||
miSession.postCommand(finish);
|
||||
MIInfo info = finish.getMIInfo();
|
||||
if (info == null) {
|
||||
throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
|
||||
}
|
||||
} catch (MIException e) {
|
||||
throw new MI2CDIException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
protected void execReturn(String value) throws CDIException {
|
||||
|
||||
((Thread)getThread()).setCurrentStackFrame(this, false);
|
||||
|
||||
Target target = (Target)getTarget();
|
||||
MISession miSession = target.getMISession();
|
||||
CommandFactory factory = miSession.getCommandFactory();
|
||||
MIExecReturn ret;
|
||||
if (value == null) {
|
||||
ret = factory.createMIExecReturn();
|
||||
} else {
|
||||
ret = factory.createMIExecReturn(value);
|
||||
}
|
||||
try {
|
||||
miSession.postCommand(ret);
|
||||
MIInfo info = ret.getMIInfo();
|
||||
if (info == null) {
|
||||
throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
|
||||
}
|
||||
} catch (MIException e) {
|
||||
throw new MI2CDIException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -30,14 +30,11 @@ import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException;
|
|||
import org.eclipse.cdt.debug.mi.core.cdi.RegisterManager;
|
||||
import org.eclipse.cdt.debug.mi.core.cdi.Session;
|
||||
import org.eclipse.cdt.debug.mi.core.cdi.VariableManager;
|
||||
import org.eclipse.cdt.debug.mi.core.command.Command;
|
||||
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIDataEvaluateExpression;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIExecContinue;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIExecFinish;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIExecNext;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIExecNextInstruction;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIExecReturn;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIExecRun;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIExecStep;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIExecStepInstruction;
|
||||
|
@ -66,7 +63,6 @@ public class Target implements ICDITarget {
|
|||
Thread[] noThreads = new Thread[0];
|
||||
Thread[] currentThreads;
|
||||
int currentThreadId;
|
||||
Command lastExecutionCommand;
|
||||
|
||||
public Target(Session s, MISession mi) {
|
||||
session = s;
|
||||
|
@ -74,10 +70,6 @@ public class Target implements ICDITarget {
|
|||
currentThreads = noThreads;
|
||||
}
|
||||
|
||||
public Command getLastExecutionCommand() {
|
||||
return lastExecutionCommand;
|
||||
}
|
||||
|
||||
public MISession getMISession() {
|
||||
return miSession;
|
||||
}
|
||||
|
@ -154,12 +146,10 @@ public class Target implements ICDITarget {
|
|||
// some variables like Register. Call an update()
|
||||
// To generate changeEvents.
|
||||
if (doUpdate) {
|
||||
// TODO: only our Process
|
||||
RegisterManager regMgr = (RegisterManager)session.getRegisterManager();
|
||||
if (regMgr.isAutoUpdate()) {
|
||||
regMgr.update(this);
|
||||
}
|
||||
// TODO: only our Process
|
||||
VariableManager varMgr = (VariableManager)session.getVariableManager();
|
||||
if (varMgr.isAutoUpdate()) {
|
||||
varMgr.update(this);
|
||||
|
@ -341,7 +331,6 @@ public class Target implements ICDITarget {
|
|||
public void restart() throws CDIException {
|
||||
CommandFactory factory = miSession.getCommandFactory();
|
||||
MIExecRun run = factory.createMIExecRun(new String[0]);
|
||||
lastExecutionCommand = run;
|
||||
try {
|
||||
miSession.postCommand(run);
|
||||
MIInfo info = run.getMIInfo();
|
||||
|
@ -353,39 +342,19 @@ public class Target implements ICDITarget {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#resume()
|
||||
*/
|
||||
public void resume() throws CDIException {
|
||||
if (miSession.getMIInferior().isRunning()) {
|
||||
throw new CDIException(CdiResources.getString("cdi.model.Target.Inferior_already_running")); //$NON-NLS-1$
|
||||
} else if (miSession.getMIInferior().isSuspended()) {
|
||||
CommandFactory factory = miSession.getCommandFactory();
|
||||
MIExecContinue cont = factory.createMIExecContinue();
|
||||
lastExecutionCommand = cont;
|
||||
try {
|
||||
miSession.postCommand(cont);
|
||||
MIInfo info = cont.getMIInfo();
|
||||
if (info == null) {
|
||||
throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
|
||||
}
|
||||
} catch (MIException e) {
|
||||
throw new MI2CDIException(e);
|
||||
}
|
||||
} else if (miSession.getMIInferior().isTerminated()) {
|
||||
restart();
|
||||
} else {
|
||||
restart();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#stepInto()
|
||||
*/
|
||||
public void stepInto() throws CDIException {
|
||||
stepInto(1);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIExecuteStep#stepInto(int)
|
||||
*/
|
||||
public void stepInto(int count) throws CDIException {
|
||||
CommandFactory factory = miSession.getCommandFactory();
|
||||
MIExecStep step = factory.createMIExecStep();
|
||||
lastExecutionCommand = step;
|
||||
MIExecStep step = factory.createMIExecStep(count);
|
||||
try {
|
||||
miSession.postCommand(step);
|
||||
MIInfo info = step.getMIInfo();
|
||||
|
@ -397,13 +366,20 @@ public class Target implements ICDITarget {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#stepIntoInstruction()
|
||||
*/
|
||||
public void stepIntoInstruction() throws CDIException {
|
||||
stepIntoInstruction(1);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIExecuteStep#stepIntoInstruction(int)
|
||||
*/
|
||||
public void stepIntoInstruction(int count) throws CDIException {
|
||||
CommandFactory factory = miSession.getCommandFactory();
|
||||
MIExecStepInstruction stepi = factory.createMIExecStepInstruction();
|
||||
lastExecutionCommand = stepi;
|
||||
MIExecStepInstruction stepi = factory.createMIExecStepInstruction(count);
|
||||
try {
|
||||
miSession.postCommand(stepi);
|
||||
MIInfo info = stepi.getMIInfo();
|
||||
|
@ -413,15 +389,22 @@ public class Target implements ICDITarget {
|
|||
} catch (MIException e) {
|
||||
throw new MI2CDIException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#stepOver()
|
||||
*/
|
||||
public void stepOver() throws CDIException {
|
||||
stepOver(1);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIExecuteStep#stepOver(int)
|
||||
*/
|
||||
public void stepOver(int count) throws CDIException {
|
||||
CommandFactory factory = miSession.getCommandFactory();
|
||||
MIExecNext next = factory.createMIExecNext();
|
||||
lastExecutionCommand = next;
|
||||
MIExecNext next = factory.createMIExecNext(count);
|
||||
try {
|
||||
miSession.postCommand(next);
|
||||
MIInfo info = next.getMIInfo();
|
||||
|
@ -437,9 +420,15 @@ public class Target implements ICDITarget {
|
|||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#stepOverInstruction()
|
||||
*/
|
||||
public void stepOverInstruction() throws CDIException {
|
||||
stepOverInstruction(1);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIExecuteStep#stepOverInstruction(int)
|
||||
*/
|
||||
public void stepOverInstruction(int count) throws CDIException {
|
||||
CommandFactory factory = miSession.getCommandFactory();
|
||||
MIExecNextInstruction nexti = factory.createMIExecNextInstruction();
|
||||
lastExecutionCommand = nexti;
|
||||
MIExecNextInstruction nexti = factory.createMIExecNextInstruction(count);
|
||||
try {
|
||||
miSession.postCommand(nexti);
|
||||
MIInfo info = nexti.getMIInfo();
|
||||
|
@ -455,46 +444,33 @@ public class Target implements ICDITarget {
|
|||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#stepReturn()
|
||||
*/
|
||||
public void stepReturn() throws CDIException {
|
||||
stepReturn(true);
|
||||
((Thread)getCurrentThread()).getCurrentStackFrame().stepReturn();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#stepReturn(boolean)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#runUntil(ICDILocation)
|
||||
*/
|
||||
public void stepReturn(boolean execute) throws CDIException {
|
||||
if (execute) {
|
||||
finish();
|
||||
} else {
|
||||
execReturn();
|
||||
}
|
||||
public void runUntil(ICDILocation location) throws CDIException {
|
||||
stepUntil(location);
|
||||
}
|
||||
|
||||
/**
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIExecuteStep#stepUntil(org.eclipse.cdt.debug.core.cdi.ICDILocation)
|
||||
*/
|
||||
protected void finish() throws CDIException {
|
||||
public void stepUntil(ICDILocation location) throws CDIException {
|
||||
CommandFactory factory = miSession.getCommandFactory();
|
||||
MIExecFinish finish = factory.createMIExecFinish();
|
||||
lastExecutionCommand = finish;
|
||||
String loc = ""; //$NON-NLS-1$
|
||||
if (location.getFile() != null && location.getFile().length() > 0) {
|
||||
loc = location.getFile() + ":" + location.getLineNumber(); //$NON-NLS-1$
|
||||
} else if (location.getFunction() != null && location.getFunction().length() > 0) {
|
||||
loc = location.getFunction();
|
||||
} else if (location.getAddress() != 0) {
|
||||
loc = "*" + location.getAddress(); //$NON-NLS-1$
|
||||
}
|
||||
MIExecUntil until = factory.createMIExecUntil(loc);
|
||||
try {
|
||||
miSession.postCommand(finish);
|
||||
MIInfo info = finish.getMIInfo();
|
||||
if (info == null) {
|
||||
throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
|
||||
}
|
||||
} catch (MIException e) {
|
||||
throw new MI2CDIException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
protected void execReturn() throws CDIException {
|
||||
CommandFactory factory = miSession.getCommandFactory();
|
||||
MIExecReturn ret = factory.createMIExecReturn();
|
||||
lastExecutionCommand = ret;
|
||||
try {
|
||||
miSession.postCommand(ret);
|
||||
MIInfo info = ret.getMIInfo();
|
||||
miSession.postCommand(until);
|
||||
MIInfo info = until.getMIInfo();
|
||||
if (info == null) {
|
||||
throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
|
||||
}
|
||||
|
@ -536,30 +512,57 @@ public class Target implements ICDITarget {
|
|||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#runUntil(ICDILocation)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#resume()
|
||||
*/
|
||||
public void runUntil(ICDILocation location) throws CDIException {
|
||||
CommandFactory factory = miSession.getCommandFactory();
|
||||
String loc = ""; //$NON-NLS-1$
|
||||
if (location.getFile() != null && location.getFile().length() > 0) {
|
||||
loc = location.getFile() + ":" + location.getLineNumber(); //$NON-NLS-1$
|
||||
} else if (location.getFunction() != null && location.getFunction().length() > 0) {
|
||||
loc = location.getFunction();
|
||||
} else if (location.getAddress() != 0) {
|
||||
loc = "*" + location.getAddress(); //$NON-NLS-1$
|
||||
public void resume() throws CDIException {
|
||||
resume(false);
|
||||
}
|
||||
MIExecUntil until = factory.createMIExecUntil(loc);
|
||||
lastExecutionCommand = until;
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIExecuteResume#resume(org.eclipse.cdt.debug.core.cdi.ICDILocation)
|
||||
*/
|
||||
public void resume(ICDILocation location) throws CDIException {
|
||||
jump(location);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIExecuteResume#resume(org.eclipse.cdt.debug.core.cdi.model.ICDISignal)
|
||||
*/
|
||||
public void resume(ICDISignal signal) throws CDIException {
|
||||
signal(signal);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIExecuteResume#resume(boolean)
|
||||
*/
|
||||
public void resume(boolean passSignal) throws CDIException {
|
||||
if (miSession.getMIInferior().isRunning()) {
|
||||
throw new CDIException(CdiResources.getString("cdi.model.Target.Inferior_already_running")); //$NON-NLS-1$
|
||||
} else if (miSession.getMIInferior().isSuspended()) {
|
||||
if (passSignal) {
|
||||
signal();
|
||||
} else {
|
||||
continuation();
|
||||
}
|
||||
} else if (miSession.getMIInferior().isTerminated()) {
|
||||
restart();
|
||||
} else {
|
||||
restart();
|
||||
}
|
||||
}
|
||||
|
||||
public void continuation() throws CDIException {
|
||||
CommandFactory factory = miSession.getCommandFactory();
|
||||
MIExecContinue cont = factory.createMIExecContinue();
|
||||
try {
|
||||
miSession.postCommand(until);
|
||||
MIInfo info = until.getMIInfo();
|
||||
miSession.postCommand(cont);
|
||||
MIInfo info = cont.getMIInfo();
|
||||
if (info == null) {
|
||||
throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
|
||||
}
|
||||
} catch (MIException e) {
|
||||
throw new MI2CDIException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -576,7 +579,6 @@ public class Target implements ICDITarget {
|
|||
loc = "*" + location.getAddress(); //$NON-NLS-1$
|
||||
}
|
||||
MIJump jump = factory.createMIJump(loc);
|
||||
lastExecutionCommand = jump;
|
||||
try {
|
||||
miSession.postCommand(jump);
|
||||
MIInfo info = jump.getMIInfo();
|
||||
|
@ -588,6 +590,40 @@ public class Target implements ICDITarget {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#signal()
|
||||
*/
|
||||
public void signal() throws CDIException {
|
||||
CommandFactory factory = miSession.getCommandFactory();
|
||||
MISignal signal = factory.createMISignal("0"); //$NON-NLS-1$
|
||||
try {
|
||||
miSession.postCommand(signal);
|
||||
MIInfo info = signal.getMIInfo();
|
||||
if (info == null) {
|
||||
throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
|
||||
}
|
||||
} catch (MIException e) {
|
||||
throw new MI2CDIException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#signal(ICDISignal)
|
||||
*/
|
||||
public void signal(ICDISignal signal) throws CDIException {
|
||||
CommandFactory factory = miSession.getCommandFactory();
|
||||
MISignal sig = factory.createMISignal(signal.getName());
|
||||
try {
|
||||
miSession.postCommand(sig);
|
||||
MIInfo info = sig.getMIInfo();
|
||||
if (info == null) {
|
||||
throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
|
||||
}
|
||||
} catch (MIException e) {
|
||||
throw new MI2CDIException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#evaluateExpressionToString(String)
|
||||
*/
|
||||
|
@ -654,40 +690,6 @@ public class Target implements ICDITarget {
|
|||
return miSession.getMIInferior();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#signal()
|
||||
*/
|
||||
public void signal() throws CDIException {
|
||||
CommandFactory factory = miSession.getCommandFactory();
|
||||
MISignal signal = factory.createMISignal("0"); //$NON-NLS-1$
|
||||
try {
|
||||
miSession.postCommand(signal);
|
||||
MIInfo info = signal.getMIInfo();
|
||||
if (info == null) {
|
||||
throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
|
||||
}
|
||||
} catch (MIException e) {
|
||||
throw new MI2CDIException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#signal(ICDISignal)
|
||||
*/
|
||||
public void signal(ICDISignal signal) throws CDIException {
|
||||
CommandFactory factory = miSession.getCommandFactory();
|
||||
MISignal sig = factory.createMISignal(signal.getName());
|
||||
try {
|
||||
miSession.postCommand(sig);
|
||||
MIInfo info = sig.getMIInfo();
|
||||
if (info == null) {
|
||||
throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
|
||||
}
|
||||
} catch (MIException e) {
|
||||
throw new MI2CDIException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// Implementaton of ICDIBreapointManagement.
|
||||
|
||||
|
||||
|
@ -747,4 +749,5 @@ public class Target implements ICDITarget {
|
|||
return bMgr.createLocation(address);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -305,6 +305,89 @@ public class Thread extends CObject implements ICDIThread {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#stepInto()
|
||||
*/
|
||||
public void stepInto() throws CDIException {
|
||||
stepInto(1);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIExecuteStep#stepInto(int)
|
||||
*/
|
||||
public void stepInto(int count) throws CDIException {
|
||||
((Target)getTarget()).setCurrentThread(this);
|
||||
getTarget().stepInto(count);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#stepIntoInstruction()
|
||||
*/
|
||||
public void stepIntoInstruction() throws CDIException {
|
||||
stepIntoInstruction(1);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIExecuteStep#stepIntoInstruction(int)
|
||||
*/
|
||||
public void stepIntoInstruction(int count) throws CDIException {
|
||||
((Target)getTarget()).setCurrentThread(this);
|
||||
getTarget().stepIntoInstruction(count);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#stepOver()
|
||||
*/
|
||||
public void stepOver() throws CDIException {
|
||||
stepOver(1);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIExecuteStep#stepOver(int)
|
||||
*/
|
||||
public void stepOver(int count) throws CDIException {
|
||||
((Target)getTarget()).setCurrentThread(this);
|
||||
getTarget().stepOver(count);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#stepOverInstruction()
|
||||
*/
|
||||
public void stepOverInstruction() throws CDIException {
|
||||
stepOverInstruction(1);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIExecuteStep#stepOverInstruction(int)
|
||||
*/
|
||||
public void stepOverInstruction(int count) throws CDIException {
|
||||
((Target)getTarget()).setCurrentThread(this);
|
||||
getTarget().stepOverInstruction(count);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#stepReturn()
|
||||
*/
|
||||
public void stepReturn() throws CDIException {
|
||||
getCurrentStackFrame().stepReturn();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#runUntil(ICDILocation)
|
||||
*/
|
||||
public void runUntil(ICDILocation location) throws CDIException {
|
||||
stepUntil(location);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIExecuteStep#stepUntil(org.eclipse.cdt.debug.core.cdi.ICDILocation)
|
||||
*/
|
||||
public void stepUntil(ICDILocation location) throws CDIException {
|
||||
((Target)getTarget()).setCurrentThread(this);
|
||||
getTarget().stepUntil(location);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#isSuspended()
|
||||
*/
|
||||
|
@ -312,102 +395,69 @@ public class Thread extends CObject implements ICDIThread {
|
|||
return getTarget().isSuspended();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#resume()
|
||||
*/
|
||||
public void resume() throws CDIException {
|
||||
getTarget().setCurrentThread(this);
|
||||
getTarget().resume();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#stepInto()
|
||||
*/
|
||||
public void stepInto() throws CDIException {
|
||||
getTarget().setCurrentThread(this);
|
||||
getTarget().stepInto();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#stepIntoInstruction()
|
||||
*/
|
||||
public void stepIntoInstruction() throws CDIException {
|
||||
getTarget().setCurrentThread(this);
|
||||
getTarget().stepIntoInstruction();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#stepOver()
|
||||
*/
|
||||
public void stepOver() throws CDIException {
|
||||
getTarget().setCurrentThread(this);
|
||||
getTarget().stepOver();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#stepOverInstruction()
|
||||
*/
|
||||
public void stepOverInstruction() throws CDIException {
|
||||
getTarget().setCurrentThread(this);
|
||||
getTarget().stepOverInstruction();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#stepReturn()
|
||||
*/
|
||||
public void stepReturn() throws CDIException {
|
||||
getTarget().setCurrentThread(this);
|
||||
getTarget().stepReturn();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#stepReturn(boolean)
|
||||
*/
|
||||
public void stepReturn(boolean execute) throws CDIException {
|
||||
getTarget().setCurrentThread(this);
|
||||
getTarget().stepReturn(execute);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#runUntil(ICDILocation)
|
||||
*/
|
||||
public void runUntil(ICDILocation location) throws CDIException {
|
||||
getTarget().setCurrentThread(this);
|
||||
getTarget().runUntil(location);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#suspend()
|
||||
*/
|
||||
public void suspend() throws CDIException {
|
||||
getTarget().suspend();
|
||||
getTarget().setCurrentThread(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#resume()
|
||||
*/
|
||||
public void resume() throws CDIException {
|
||||
resume(false);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIExecuteResume#resume(boolean)
|
||||
*/
|
||||
|
||||
public void resume(boolean passSignal) throws CDIException {
|
||||
((Target)getTarget()).setCurrentThread(this);
|
||||
getTarget().resume(passSignal);
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIExecuteResume#resume(org.eclipse.cdt.debug.core.cdi.ICDILocation)
|
||||
*/
|
||||
public void resume(ICDILocation location) throws CDIException {
|
||||
// TODO Auto-generated method stub
|
||||
((Target)getTarget()).setCurrentThread(this);
|
||||
getTarget().resume(location);
|
||||
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIExecuteResume#resume(org.eclipse.cdt.debug.core.cdi.model.ICDISignal)
|
||||
*/
|
||||
public void resume(ICDISignal signal) throws CDIException {
|
||||
((Target)getTarget()).setCurrentThread(this);
|
||||
getTarget().resume(signal);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#jump(org.eclipse.cdt.debug.core.cdi.ICDILocation)
|
||||
*/
|
||||
public void jump(ICDILocation location) throws CDIException {
|
||||
getTarget().setCurrentThread(this);
|
||||
getTarget().jump(location);
|
||||
resume(location);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#signal()
|
||||
*/
|
||||
public void signal() throws CDIException {
|
||||
getTarget().setCurrentThread(this);
|
||||
getTarget().signal();
|
||||
resume(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#signal(org.eclipse.cdt.debug.core.cdi.model.ICDISignal)
|
||||
*/
|
||||
public void signal(ICDISignal signal) throws CDIException {
|
||||
getTarget().setCurrentThread(this);
|
||||
getTarget().signal(signal);
|
||||
resume(signal);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#equals(ICDIThread)
|
||||
*/
|
||||
|
|
|
@ -36,11 +36,6 @@ public class CommandFactory {
|
|||
return new MIBreakEnable(brknum);
|
||||
}
|
||||
|
||||
// public MIBreakInsert createMIBreakInsert(boolean isTemporary, boolean isHardware,
|
||||
// String condition, int ignoreCount, String line) {
|
||||
// return new MIBreakInsert(isTemporary, isHardware, condition, ignoreCount, line, 0);
|
||||
// }
|
||||
|
||||
public MIBreakInsert createMIBreakInsert(boolean isTemporary, boolean isHardware,
|
||||
String condition, int ignoreCount, String line, int tid) {
|
||||
return new MIBreakInsert(isTemporary, isHardware, condition, ignoreCount, line, tid);
|
||||
|
@ -147,28 +142,32 @@ public class CommandFactory {
|
|||
return null;
|
||||
}
|
||||
|
||||
public MIExecNext createMIExecNext() {
|
||||
return new MIExecNext();
|
||||
public MIExecNext createMIExecNext(int count) {
|
||||
return new MIExecNext(count);
|
||||
}
|
||||
|
||||
public MIExecNextInstruction createMIExecNextInstruction() {
|
||||
return new MIExecNextInstruction();
|
||||
public MIExecNextInstruction createMIExecNextInstruction(int count) {
|
||||
return new MIExecNextInstruction(count);
|
||||
}
|
||||
|
||||
public MIExecReturn createMIExecReturn() {
|
||||
return new MIExecReturn();
|
||||
}
|
||||
|
||||
public MIExecReturn createMIExecReturn(String arg) {
|
||||
return new MIExecReturn(arg);
|
||||
}
|
||||
|
||||
public MIExecRun createMIExecRun(String[] args) {
|
||||
return new MIExecRun(args);
|
||||
}
|
||||
|
||||
public MIExecStep createMIExecStep() {
|
||||
return new MIExecStep();
|
||||
public MIExecStep createMIExecStep(int count) {
|
||||
return new MIExecStep(count);
|
||||
}
|
||||
|
||||
public MIExecStepInstruction createMIExecStepInstruction() {
|
||||
return new MIExecStepInstruction();
|
||||
public MIExecStepInstruction createMIExecStepInstruction(int count) {
|
||||
return new MIExecStepInstruction(count);
|
||||
}
|
||||
|
||||
public MIExecUntil createMIExecUntil(String location) {
|
||||
|
|
|
@ -24,4 +24,8 @@ public class MIExecNext extends MICommand
|
|||
public MIExecNext() {
|
||||
super("-exec-next"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public MIExecNext(int count) {
|
||||
super("-exec-next", new String[] { Integer.toString(count) }); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,4 +26,8 @@ public class MIExecNextInstruction extends MICommand
|
|||
public MIExecNextInstruction() {
|
||||
super("-exec-next-instruction"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public MIExecNextInstruction(int count) {
|
||||
super("-exec-next-instruction", new String[] { Integer.toString(count) }); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
|
||||
package org.eclipse.cdt.debug.mi.core.command;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* -exec-return
|
||||
|
@ -26,4 +24,9 @@ public class MIExecReturn extends MICommand
|
|||
public MIExecReturn() {
|
||||
super("-exec-return"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public MIExecReturn(String arg) {
|
||||
super("-exec-run", new String[] { arg }); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -26,4 +26,8 @@ public class MIExecStep extends MICommand
|
|||
public MIExecStep() {
|
||||
super("-exec-step"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public MIExecStep(int count) {
|
||||
super("-exec-step", new String[] { Integer.toString(count) }); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,4 +29,8 @@ public class MIExecStepInstruction extends MICommand
|
|||
public MIExecStepInstruction() {
|
||||
super("-exec-step-instruction"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public MIExecStepInstruction(int count) {
|
||||
super("-exec-step-instruction", new String[] { Integer.toString(count) }); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue