1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-29 20:05:35 +02:00

2005-06-27 Alain Magloire

Refactor the class extending CLICommand to CLIXXXX for more clarity.
	Pass the MIVersion in all of the class extending MICommand, this is
	necessary some command option will not be accepted depending on the version.
	Too much file to enumerate.
	* ...
This commit is contained in:
Alain Magloire 2005-06-27 15:24:55 +00:00
parent a729a32e61
commit 189ad381e0
109 changed files with 559 additions and 446 deletions

View file

@ -1,3 +1,10 @@
2005-06-27 Alain Magloire
Refactor the class extending CLICommand to CLIXXXX for more clarity.
Pass the MIVersion in all of the class extending MICommand, this is
necessary some command option will not be accepted depending on the version.
Too much file to enumerate.
* ...
2005-06-25 Alain Magloire
We should consider a "^done" like a suspended only for CLICommands, for example:
(gdb) run

View file

@ -20,7 +20,7 @@ import org.eclipse.cdt.debug.core.cdi.ICDILocation;
/**
*/
public class Location implements ICDIFunctionLocation, ICDIAddressLocation {
public class Location /*implements ICDIFunctionLocation, ICDIAddressLocation */{
BigInteger fAddress = null;
String fFile = null;

View file

@ -26,6 +26,7 @@ import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MIFormat;
import org.eclipse.cdt.debug.mi.core.MIPlugin;
import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.RxThread;
import org.eclipse.cdt.debug.mi.core.cdi.model.Breakpoint;
import org.eclipse.cdt.debug.mi.core.cdi.model.LocationBreakpoint;
import org.eclipse.cdt.debug.mi.core.cdi.model.SharedLibrary;
@ -37,8 +38,8 @@ import org.eclipse.cdt.debug.mi.core.command.MIGDBSetSolibSearchPath;
import org.eclipse.cdt.debug.mi.core.command.MIGDBSetStopOnSolibEvents;
import org.eclipse.cdt.debug.mi.core.command.MIGDBShow;
import org.eclipse.cdt.debug.mi.core.command.MIGDBShowSolibSearchPath;
import org.eclipse.cdt.debug.mi.core.command.MIInfoSharedLibrary;
import org.eclipse.cdt.debug.mi.core.command.MISharedLibrary;
import org.eclipse.cdt.debug.mi.core.command.CLIInfoSharedLibrary;
import org.eclipse.cdt.debug.mi.core.command.CLISharedLibrary;
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointCreatedEvent;
import org.eclipse.cdt.debug.mi.core.event.MIEvent;
import org.eclipse.cdt.debug.mi.core.event.MISharedLibChangedEvent;
@ -48,7 +49,7 @@ import org.eclipse.cdt.debug.mi.core.output.MIBreakpoint;
import org.eclipse.cdt.debug.mi.core.output.MIGDBShowInfo;
import org.eclipse.cdt.debug.mi.core.output.MIGDBShowSolibSearchPathInfo;
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
import org.eclipse.cdt.debug.mi.core.output.MIInfoSharedLibraryInfo;
import org.eclipse.cdt.debug.mi.core.output.CLIInfoSharedLibraryInfo;
import org.eclipse.cdt.debug.mi.core.output.MIShared;
/**
@ -78,16 +79,21 @@ public class SharedLibraryManager extends Manager {
MIShared[] getMIShareds(MISession miSession) throws CDIException {
MIShared[] miLibs = new MIShared[0];
CommandFactory factory = miSession.getCommandFactory();
MIInfoSharedLibrary infoShared = factory.createMIInfoSharedLibrary();
CLIInfoSharedLibrary infoShared = factory.createCLIInfoSharedLibrary();
try {
RxThread rxThread = miSession.getRxThread();
rxThread.setEnableConsole(false);
miSession.postCommand(infoShared);
MIInfoSharedLibraryInfo info = infoShared.getMIInfoSharedLibraryInfo();
CLIInfoSharedLibraryInfo info = infoShared.getMIInfoSharedLibraryInfo();
if (info == null) {
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
miLibs = info.getMIShared();
} catch (MIException e) {
throw new MI2CDIException(e);
} finally {
RxThread rxThread = miSession.getRxThread();
rxThread.setEnableConsole(true);
}
return miLibs;
}
@ -320,7 +326,7 @@ public class SharedLibraryManager extends Manager {
public void loadSymbols(Target target) throws CDIException {
MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory();
MISharedLibrary sharedlibrary = factory.createMISharedLibrary();
CLISharedLibrary sharedlibrary = factory.createCLISharedLibrary();
try {
mi.postCommand(sharedlibrary);
MIInfo info = sharedlibrary.getMIInfo();
@ -340,7 +346,7 @@ public class SharedLibraryManager extends Manager {
if (libs[i].areSymbolsLoaded()) {
continue;
}
MISharedLibrary sharedlibrary = factory.createMISharedLibrary(libs[i].getFileName());
CLISharedLibrary sharedlibrary = factory.createCLISharedLibrary(libs[i].getFileName());
try {
miSession.postCommand(sharedlibrary);
MIInfo info = sharedlibrary.getMIInfo();

View file

@ -23,11 +23,11 @@ import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.model.Signal;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
import org.eclipse.cdt.debug.mi.core.command.MIHandle;
import org.eclipse.cdt.debug.mi.core.command.MIInfoSignals;
import org.eclipse.cdt.debug.mi.core.command.CLIHandle;
import org.eclipse.cdt.debug.mi.core.command.CLIInfoSignals;
import org.eclipse.cdt.debug.mi.core.event.MIEvent;
import org.eclipse.cdt.debug.mi.core.event.MISignalChangedEvent;
import org.eclipse.cdt.debug.mi.core.output.MIInfoSignalsInfo;
import org.eclipse.cdt.debug.mi.core.output.CLIInfoSignalsInfo;
import org.eclipse.cdt.debug.mi.core.output.MISigHandle;
/**
@ -55,10 +55,10 @@ public class SignalManager extends Manager {
MISigHandle[] getMISignals(MISession miSession) throws CDIException {
MISigHandle[] miSigs;
CommandFactory factory = miSession.getCommandFactory();
MIInfoSignals sigs = factory.createMIInfoSignals();
CLIInfoSignals sigs = factory.createCLIInfoSignals();
try {
miSession.postCommand(sigs);
MIInfoSignalsInfo info = sigs.getMIInfoSignalsInfo();
CLIInfoSignalsInfo info = sigs.getMIInfoSignalsInfo();
if (info == null) {
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
@ -72,10 +72,10 @@ public class SignalManager extends Manager {
MISigHandle getMISignal(MISession miSession, String name) throws CDIException {
MISigHandle sig = null;
CommandFactory factory = miSession.getCommandFactory();
MIInfoSignals sigs = factory.createMIInfoSignals(name);
CLIInfoSignals sigs = factory.createCLIInfoSignals(name);
try {
miSession.postCommand(sigs);
MIInfoSignalsInfo info = sigs.getMIInfoSignalsInfo();
CLIInfoSignalsInfo info = sigs.getMIInfoSignalsInfo();
if (info == null) {
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
@ -156,7 +156,7 @@ public class SignalManager extends Manager {
} else {
buffer.append("nostop"); //$NON-NLS-1$
}
MIHandle handle = factory.createMIHandle(buffer.toString());
CLIHandle handle = factory.createCLIHandle(buffer.toString());
try {
miSession.postCommand(handle);
handle.getMIInfo();

View file

@ -19,6 +19,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction;
import org.eclipse.cdt.debug.mi.core.GDBTypeParser;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.RxThread;
import org.eclipse.cdt.debug.mi.core.GDBTypeParser.GDBDerivedType;
import org.eclipse.cdt.debug.mi.core.GDBTypeParser.GDBType;
import org.eclipse.cdt.debug.mi.core.cdi.model.Instruction;
@ -48,14 +49,14 @@ import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
import org.eclipse.cdt.debug.mi.core.command.MIDataDisassemble;
import org.eclipse.cdt.debug.mi.core.command.MIEnvironmentDirectory;
import org.eclipse.cdt.debug.mi.core.command.MIGDBShowDirectories;
import org.eclipse.cdt.debug.mi.core.command.MIPType;
import org.eclipse.cdt.debug.mi.core.command.MIWhatis;
import org.eclipse.cdt.debug.mi.core.command.CLIPType;
import org.eclipse.cdt.debug.mi.core.command.CLIWhatis;
import org.eclipse.cdt.debug.mi.core.output.MIAsm;
import org.eclipse.cdt.debug.mi.core.output.MIDataDisassembleInfo;
import org.eclipse.cdt.debug.mi.core.output.MIGDBShowDirectoriesInfo;
import org.eclipse.cdt.debug.mi.core.output.MIPTypeInfo;
import org.eclipse.cdt.debug.mi.core.output.CLIPTypeInfo;
import org.eclipse.cdt.debug.mi.core.output.MISrcAsm;
import org.eclipse.cdt.debug.mi.core.output.MIWhatisInfo;
import org.eclipse.cdt.debug.mi.core.output.CLIWhatisInfo;
/**
@ -435,16 +436,23 @@ public class SourceManager extends Manager {
public String getDetailTypeName(Target target, String typename) throws CDIException {
try {
MISession mi = target.getMISession();
RxThread rxThread = mi.getRxThread();
rxThread.setEnableConsole(false);
CommandFactory factory = mi.getCommandFactory();
MIPType ptype = factory.createMIPType(typename);
CLIPType ptype = factory.createCLIPType(typename);
mi.postCommand(ptype);
MIPTypeInfo info = ptype.getMIPtypeInfo();
CLIPTypeInfo info = ptype.getMIPtypeInfo();
if (info == null) {
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
return info.getType();
} catch (MIException e) {
throw new MI2CDIException(e);
} finally {
MISession mi = target.getMISession();
RxThread rxThread = mi.getRxThread();
rxThread.setEnableConsole(true);
}
}
@ -466,9 +474,9 @@ public class SourceManager extends Manager {
try {
MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory();
MIWhatis whatis = factory.createMIWhatis(variable);
CLIWhatis whatis = factory.createCLIWhatis(variable);
mi.postCommand(whatis);
MIWhatisInfo info = whatis.getMIWhatisInfo();
CLIWhatisInfo info = whatis.getMIWhatisInfo();
if (info == null) {
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}

View file

@ -19,8 +19,8 @@ import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
import org.eclipse.cdt.debug.mi.core.cdi.model.Thread;
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
import org.eclipse.cdt.debug.mi.core.command.MIInfoThreads;
import org.eclipse.cdt.debug.mi.core.output.MIInfoThreadsInfo;
import org.eclipse.cdt.debug.mi.core.command.CLIInfoThreads;
import org.eclipse.cdt.debug.mi.core.output.CLIInfoThreadsInfo;
/**
@ -75,9 +75,9 @@ public class ThreadManager extends Manager { //implements ICDIThreadManager {
//MIThreadListIds tids = factory.createMIThreadListIds();
//MIThreadListIdsInfo info = tids.getMIThreadListIdsInfo();
MIInfoThreads tids = factory.createMIInfoThreads();
CLIInfoThreads tids = factory.createCLIInfoThreads();
mi.postCommand(tids);
MIInfoThreadsInfo info = tids.getMIInfoThreadsInfo();
CLIInfoThreadsInfo info = tids.getMIInfoThreadsInfo();
int [] ids;
if (info == null) {
ids = new int[0];

View file

@ -26,6 +26,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIThreadStorageDescriptor;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.RxThread;
import org.eclipse.cdt.debug.mi.core.cdi.model.Argument;
import org.eclipse.cdt.debug.mi.core.cdi.model.ArgumentDescriptor;
import org.eclipse.cdt.debug.mi.core.cdi.model.GlobalVariable;
@ -42,7 +43,7 @@ import org.eclipse.cdt.debug.mi.core.cdi.model.ThreadStorageDescriptor;
import org.eclipse.cdt.debug.mi.core.cdi.model.Variable;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableDescriptor;
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
import org.eclipse.cdt.debug.mi.core.command.MIPType;
import org.eclipse.cdt.debug.mi.core.command.CLIPType;
import org.eclipse.cdt.debug.mi.core.command.MIStackListArguments;
import org.eclipse.cdt.debug.mi.core.command.MIStackListLocals;
import org.eclipse.cdt.debug.mi.core.command.MIVarCreate;
@ -53,7 +54,7 @@ import org.eclipse.cdt.debug.mi.core.event.MIVarChangedEvent;
import org.eclipse.cdt.debug.mi.core.event.MIVarDeletedEvent;
import org.eclipse.cdt.debug.mi.core.output.MIArg;
import org.eclipse.cdt.debug.mi.core.output.MIFrame;
import org.eclipse.cdt.debug.mi.core.output.MIPTypeInfo;
import org.eclipse.cdt.debug.mi.core.output.CLIPTypeInfo;
import org.eclipse.cdt.debug.mi.core.output.MIStackListArgumentsInfo;
import org.eclipse.cdt.debug.mi.core.output.MIStackListLocalsInfo;
import org.eclipse.cdt.debug.mi.core.output.MIVar;
@ -174,16 +175,21 @@ public class VariableManager extends Manager {
((Thread)frame.getThread()).setCurrentStackFrame(frame, false);
try {
MISession miSession = target.getMISession();
RxThread rxThread = miSession.getRxThread();
rxThread.setEnableConsole(false);
CommandFactory factory = miSession.getCommandFactory();
MIPType ptype = factory.createMIPType(type);
CLIPType ptype = factory.createCLIPType(type);
miSession.postCommand(ptype);
MIPTypeInfo info = ptype.getMIPtypeInfo();
CLIPTypeInfo info = ptype.getMIPtypeInfo();
if (info == null) {
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
} catch (MIException e) {
throw new MI2CDIException(e);
} finally {
MISession miSession = target.getMISession();
RxThread rxThread = miSession.getRxThread();
rxThread.setEnableConsole(true);
target.setCurrentThread(currentThread, false);
currentThread.setCurrentStackFrame(currentFrame, false);
}

View file

@ -20,7 +20,6 @@ public class AddressLocation extends Location implements ICDIAddressLocation {
public AddressLocation(BigInteger address) {
super(address);
// TODO Auto-generated constructor stub
}
}

View file

@ -42,6 +42,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint;
import org.eclipse.cdt.debug.mi.core.CoreProcess;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.RxThread;
import org.eclipse.cdt.debug.mi.core.cdi.BreakpointManager;
import org.eclipse.cdt.debug.mi.core.cdi.CdiResources;
import org.eclipse.cdt.debug.mi.core.cdi.ExpressionManager;
@ -63,10 +64,10 @@ 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;
import org.eclipse.cdt.debug.mi.core.command.MIExecUntil;
import org.eclipse.cdt.debug.mi.core.command.MIInfoThreads;
import org.eclipse.cdt.debug.mi.core.command.MIJump;
import org.eclipse.cdt.debug.mi.core.command.CLIInfoThreads;
import org.eclipse.cdt.debug.mi.core.command.CLIJump;
import org.eclipse.cdt.debug.mi.core.command.MIGDBShowEndian;
import org.eclipse.cdt.debug.mi.core.command.MISignal;
import org.eclipse.cdt.debug.mi.core.command.CLISignal;
import org.eclipse.cdt.debug.mi.core.command.MITargetDetach;
import org.eclipse.cdt.debug.mi.core.command.MIThreadSelect;
import org.eclipse.cdt.debug.mi.core.event.MIDetachedEvent;
@ -75,7 +76,7 @@ import org.eclipse.cdt.debug.mi.core.event.MIThreadExitEvent;
import org.eclipse.cdt.debug.mi.core.output.MIDataEvaluateExpressionInfo;
import org.eclipse.cdt.debug.mi.core.output.MIFrame;
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
import org.eclipse.cdt.debug.mi.core.output.MIInfoThreadsInfo;
import org.eclipse.cdt.debug.mi.core.output.CLIInfoThreadsInfo;
import org.eclipse.cdt.debug.mi.core.output.MIGDBShowEndianInfo;
import org.eclipse.cdt.debug.mi.core.output.MIThreadSelectInfo;
@ -260,16 +261,18 @@ public class Target extends SessionObject implements ICDITarget {
*/
public Thread[] getCThreads() throws CDIException {
Thread[] cthreads = noThreads;
CommandFactory factory = miSession.getCommandFactory();
MIInfoThreads tids = factory.createMIInfoThreads();
try {
RxThread rxThread = miSession.getRxThread();
rxThread.setEnableConsole(false);
CommandFactory factory = miSession.getCommandFactory();
CLIInfoThreads tids = factory.createCLIInfoThreads();
// HACK/FIXME: gdb/mi thread-list-ids does not
// show any newly create thread, we workaround by
// issuing "info threads" instead.
//MIThreadListIds tids = factory.createMIThreadListIds();
//MIThreadListIdsInfo info = tids.getMIThreadListIdsInfo();
miSession.postCommand(tids);
MIInfoThreadsInfo info = tids.getMIInfoThreadsInfo();
CLIInfoThreadsInfo info = tids.getMIInfoThreadsInfo();
int [] ids;
String[] names;
if (info == null) {
@ -304,6 +307,9 @@ public class Target extends SessionObject implements ICDITarget {
} catch (MIException e) {
// Do not throw anything in this case.
throw new CDIException(e.getMessage());
} finally {
RxThread rxThread = miSession.getRxThread();
rxThread.setEnableConsole(true);
}
return cthreads;
}
@ -651,7 +657,7 @@ public class Target extends SessionObject implements ICDITarget {
throw new CDIException (CdiResources.getString("cdi.mode.Target.Bad_location")); //$NON-NLS-1$
}
MIJump jump = factory.createMIJump(loc);
CLIJump jump = factory.createCLIJump(loc);
try {
miSession.postCommand(jump);
MIInfo info = jump.getMIInfo();
@ -668,7 +674,7 @@ public class Target extends SessionObject implements ICDITarget {
*/
public void signal() throws CDIException {
CommandFactory factory = miSession.getCommandFactory();
MISignal signal = factory.createMISignal("0"); //$NON-NLS-1$
CLISignal signal = factory.createCLISignal("0"); //$NON-NLS-1$
try {
miSession.postCommand(signal);
MIInfo info = signal.getMIInfo();
@ -685,7 +691,7 @@ public class Target extends SessionObject implements ICDITarget {
*/
public void signal(ICDISignal signal) throws CDIException {
CommandFactory factory = miSession.getCommandFactory();
MISignal sig = factory.createMISignal(signal.getName());
CLISignal sig = factory.createCLISignal(signal.getName());
try {
miSession.postCommand(sig);
MIInfo info = sig.getMIInfo();

View file

@ -17,13 +17,13 @@ import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
import org.eclipse.cdt.debug.mi.core.command.MIExecAbort;
import org.eclipse.cdt.debug.mi.core.command.CLIExecAbort;
import org.eclipse.cdt.debug.mi.core.command.MIExecInterrupt;
import org.eclipse.cdt.debug.mi.core.command.MIGDBShowExitCode;
import org.eclipse.cdt.debug.mi.core.command.MIInfoProgram;
import org.eclipse.cdt.debug.mi.core.command.CLIInfoProgram;
import org.eclipse.cdt.debug.mi.core.event.MIInferiorExitEvent;
import org.eclipse.cdt.debug.mi.core.output.MIGDBShowExitCodeInfo;
import org.eclipse.cdt.debug.mi.core.output.MIInfoProgramInfo;
import org.eclipse.cdt.debug.mi.core.output.CLIInfoProgramInfo;
/**
*/
@ -180,7 +180,7 @@ public class MIInferior extends Process {
if (isSuspended()) {
try {
CommandFactory factory = session.getCommandFactory();
MIExecAbort abort = factory.createMIExecAbort();
CLIExecAbort abort = factory.createCLIExecAbort();
session.postCommand0(abort, -1);
// do not wait for the answer.
//abort.getMIInfo();
@ -330,10 +330,10 @@ public class MIInferior extends Process {
if (!isConnected()) {
// Try to discover the pid
CommandFactory factory = session.getCommandFactory();
MIInfoProgram prog = factory.createMIInfoProgram();
CLIInfoProgram prog = factory.createCLIInfoProgram();
try {
session.postCommand(prog);
MIInfoProgramInfo info = prog.getMIInfoProgramInfo();
CLIInfoProgramInfo info = prog.getMIInfoProgramInfo();
pid = info.getPID();
} catch (MIException e) {
// no rethrown.

View file

@ -24,6 +24,7 @@ import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
import org.eclipse.cdt.debug.mi.core.command.MIExecInterrupt;
import org.eclipse.cdt.debug.mi.core.command.MIGDBExit;
import org.eclipse.cdt.debug.mi.core.command.MIGDBSet;
import org.eclipse.cdt.debug.mi.core.command.MIGDBShowExitCode;
import org.eclipse.cdt.debug.mi.core.command.MIGDBShowPrompt;
import org.eclipse.cdt.debug.mi.core.command.MIInterpreterExecConsole;
import org.eclipse.cdt.debug.mi.core.event.MIEvent;
@ -96,6 +97,9 @@ public class MISession extends Observable {
*/
public MISession(MIProcess process, IMITTY tty, int timeout, int type, int launchTimeout) throws MIException {
// Assume mi1 for now
String miVersion = "mi1"; //$NON-NLS-1$
gdbProcess = process;
inChannel = process.getInputStream();
outChannel = process.getOutputStream();
@ -104,7 +108,6 @@ public class MISession extends Observable {
sessionType = type;
factory = new CommandFactory();
parser = new MIParser();
@ -147,21 +150,21 @@ public class MISession extends Observable {
// Like confirmation and screen size.
try {
MIGDBSet confirm = new MIGDBSet(new String[]{"confirm", "off"}); //$NON-NLS-1$ //$NON-NLS-2$
MIGDBSet confirm = new MIGDBSet(miVersion, new String[]{"confirm", "off"}); //$NON-NLS-1$ //$NON-NLS-2$
postCommand(confirm, launchTimeout);
confirm.getMIInfo();
MIGDBSet width = new MIGDBSet(new String[]{"width", "0"}); //$NON-NLS-1$ //$NON-NLS-2$
MIGDBSet width = new MIGDBSet(miVersion, new String[]{"width", "0"}); //$NON-NLS-1$ //$NON-NLS-2$
postCommand(width, launchTimeout);
width.getMIInfo();
MIGDBSet height = new MIGDBSet(new String[]{"height", "0"}); //$NON-NLS-1$ //$NON-NLS-2$
MIGDBSet height = new MIGDBSet(miVersion, new String[]{"height", "0"}); //$NON-NLS-1$ //$NON-NLS-2$
postCommand(height, launchTimeout);
height.getMIInfo();
// Try to discover is "-interpreter-exec" is supported.
try {
MIInterpreterExecConsole echo = new MIInterpreterExecConsole("echo"); //$NON-NLS-1$
MIInterpreterExecConsole echo = new MIInterpreterExecConsole(miVersion, "echo"); //$NON-NLS-1$
postCommand(echo, launchTimeout);
echo.getMIInfo();
useInterpreterExecConsole = true;
@ -170,13 +173,18 @@ public class MISession extends Observable {
}
// Get GDB's prompt
MIGDBShowPrompt prompt = new MIGDBShowPrompt();
MIGDBShowPrompt prompt = new MIGDBShowPrompt(miVersion);
postCommand(prompt);
MIGDBShowInfo infoPrompt = prompt.getMIGDBShowInfo();
String value = infoPrompt.getValue();
if (value != null && value.length() > 0) {
parser.cliPrompt = value.trim();
}
if (useInterpreterExecConsole) {
miVersion = "mi2"; //$NON-NLS-1$
}
factory = new CommandFactory(miVersion); //$NON-NI
} catch (MIException exc) {
// Kill the Transmition thread.
if (txThread.isAlive()) {
@ -343,6 +351,14 @@ public class MISession extends Observable {
}
}
if (inferior.isTerminated()) {
// the only thing that can call postCommand when the inferior is in a TERMINATED
// state is MIGDBShowExitCode, for when MIInferior is computing error code.
if (!(cmd instanceof MIGDBShowExitCode)) {
throw new MIException(MIPlugin.getResourceString("src.MISession.Inferior_Terminated")); //$NON-NLS-1$
}
}
if (isTerminated()) {
throw new MIException(MIPlugin.getResourceString("src.MISession.Session_terminated")); //$NON-NLS-1$
}
@ -553,7 +569,7 @@ public class MISession extends Observable {
return eventQueue;
}
RxThread getRxThread() {
public RxThread getRxThread() {
return rxThread;
}

View file

@ -67,6 +67,7 @@ public class RxThread extends Thread {
List oobList;
CLIProcessor cli;
int prompt = 1; // 1 --> Primary prompt "(gdb)"; 2 --> Secondary Prompt ">"
boolean fEnableConsole = true;
public RxThread(MISession s) {
super("MI RX Thread"); //$NON-NLS-1$
@ -140,6 +141,14 @@ public class RxThread extends Thread {
return prompt == 2;
}
public void setEnableConsole(boolean enable) {
fEnableConsole = enable;
}
public boolean isEnableConsole() {
return fEnableConsole;
}
/**
* Search for the command in the RxQueue, set the MIOutput
* and notify() the other end.
@ -152,7 +161,6 @@ public class RxThread extends Thread {
List list = new ArrayList();
CommandQueue rxQueue = session.getRxQueue();
// Notify any command waiting for a ResultRecord.
MIResultRecord rr = response.getMIResultRecord();
if (rr != null) {
int id = rr.getToken();
@ -160,7 +168,8 @@ public class RxThread extends Thread {
// Clear the accumulate oobList on each new Result Command
// response.
MIOOBRecord[] oobRecords = (MIOOBRecord[]) oobList.toArray(new MIOOBRecord[0]);
MIOOBRecord[] oobRecords = new MIOOBRecord[oobList.size()];
oobList.toArray(oobRecords);
// Check if the state changed.
String state = rr.getResultClass();
@ -202,14 +211,15 @@ public class RxThread extends Thread {
list.add(event);
}
} else if ("done".equals(state) && cmd instanceof CLICommand) { //$NON-NLS-1$
// Done usually mean that gdb returns after some CLI command
// Some result record contains informaton specific to oob.
// "done" usually mean that gdb returns after some CLI command
// The result record may contains informaton specific to oob.
// This will happen when CLI-Command is use, for example
// doing "run" will block and return a breakpointhit
processMIOOBRecord(rr, list);
}
// Notify the waiting command.
// Notify any command waiting for a ResultRecord.
if (cmd != null) {
// Process the Command line to recognise patterns we may need to fire event.
if (cmd instanceof CLICommand) {
@ -319,7 +329,7 @@ public class RxThread extends Thread {
String str = out.getString();
// Process the console stream too.
setPrompt(str);
if (str != null) {
if (str != null && isEnableConsole()) {
try {
console.write(str.getBytes());
console.flush();
@ -349,7 +359,7 @@ public class RxThread extends Thread {
if (log != null) {
MILogStreamOutput out = (MILogStreamOutput) stream;
String str = out.getString();
if (str != null) {
if (str != null && isEnableConsole()) {
try {
log.write(str.getBytes());
log.flush();

View file

@ -16,7 +16,7 @@ import java.io.OutputStream;
import org.eclipse.cdt.debug.mi.core.command.CLICommand;
import org.eclipse.cdt.debug.mi.core.command.Command;
import org.eclipse.cdt.debug.mi.core.command.MIInterpreterExecConsole;
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
import org.eclipse.cdt.debug.mi.core.command.RawCommand;
/**
@ -92,7 +92,8 @@ public class SessionProcess extends Process {
cmd = new RawCommand(str);
} else if (session.useExecConsole() && str.length() > 0
&& !CLIProcessor.isSteppingOperation(str)) {
cmd = new MIInterpreterExecConsole(str);
CommandFactory factory = session.getCommandFactory();
cmd = factory.createMIInterpreterExecConsole(str);
} else {
cmd = new CLICommand(str);
}

View file

@ -20,9 +20,9 @@ package org.eclipse.cdt.debug.mi.core.command;
* the function.
*
*/
public class MIExecAbort extends CLICommand
public class CLIExecAbort extends CLICommand
{
public MIExecAbort() {
public CLIExecAbort() {
super("kill"); //$NON-NLS-1$
}
}

View file

@ -18,9 +18,9 @@ package org.eclipse.cdt.debug.mi.core.command;
* handle SIGUSR1 nostop noignore
*
*/
public class MIHandle extends CLICommand {
public class CLIHandle extends CLICommand {
public MIHandle(String arg) {
public CLIHandle(String arg) {
super("handle " + arg); //$NON-NLS-1$
}

View file

@ -13,7 +13,7 @@ package org.eclipse.cdt.debug.mi.core.command;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
import org.eclipse.cdt.debug.mi.core.output.MIInfoProgramInfo;
import org.eclipse.cdt.debug.mi.core.output.CLIInfoProgramInfo;
import org.eclipse.cdt.debug.mi.core.output.MIOutput;
/**
@ -21,21 +21,21 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
* info threads
*
*/
public class MIInfoProgram extends CLICommand
public class CLIInfoProgram extends CLICommand
{
public MIInfoProgram() {
public CLIInfoProgram() {
super("info program"); //$NON-NLS-1$
}
public MIInfoProgramInfo getMIInfoProgramInfo() throws MIException {
return (MIInfoProgramInfo)getMIInfo();
public CLIInfoProgramInfo getMIInfoProgramInfo() throws MIException {
return (CLIInfoProgramInfo)getMIInfo();
}
public MIInfo getMIInfo() throws MIException {
MIInfo info = null;
MIOutput out = getMIOutput();
if (out != null) {
info = new MIInfoProgramInfo(out);
info = new CLIInfoProgramInfo(out);
if (info.isError()) {
throwMIException(info, out);
}

View file

@ -13,7 +13,7 @@ package org.eclipse.cdt.debug.mi.core.command;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
import org.eclipse.cdt.debug.mi.core.output.MIInfoSharedLibraryInfo;
import org.eclipse.cdt.debug.mi.core.output.CLIInfoSharedLibraryInfo;
import org.eclipse.cdt.debug.mi.core.output.MIOutput;
/**
@ -21,21 +21,21 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
* info threads
*
*/
public class MIInfoSharedLibrary extends CLICommand
public class CLIInfoSharedLibrary extends CLICommand
{
public MIInfoSharedLibrary() {
public CLIInfoSharedLibrary() {
super("info sharedlibrary"); //$NON-NLS-1$
}
public MIInfoSharedLibraryInfo getMIInfoSharedLibraryInfo() throws MIException {
return (MIInfoSharedLibraryInfo)getMIInfo();
public CLIInfoSharedLibraryInfo getMIInfoSharedLibraryInfo() throws MIException {
return (CLIInfoSharedLibraryInfo)getMIInfo();
}
public MIInfo getMIInfo() throws MIException {
MIInfo info = null;
MIOutput out = getMIOutput();
if (out != null) {
info = new MIInfoSharedLibraryInfo(out);
info = new CLIInfoSharedLibraryInfo(out);
if (info.isError()) {
throwMIException(info, out);
}

View file

@ -13,7 +13,7 @@ package org.eclipse.cdt.debug.mi.core.command;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
import org.eclipse.cdt.debug.mi.core.output.MIInfoSignalsInfo;
import org.eclipse.cdt.debug.mi.core.output.CLIInfoSignalsInfo;
import org.eclipse.cdt.debug.mi.core.output.MIOutput;
/**
@ -21,25 +21,25 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
* info threads
*
*/
public class MIInfoSignals extends CLICommand
public class CLIInfoSignals extends CLICommand
{
public MIInfoSignals() {
public CLIInfoSignals() {
super("info signals"); //$NON-NLS-1$
}
public MIInfoSignals(String name) {
public CLIInfoSignals(String name) {
super("info signal " + name); //$NON-NLS-1$
}
public MIInfoSignalsInfo getMIInfoSignalsInfo() throws MIException {
return (MIInfoSignalsInfo)getMIInfo();
public CLIInfoSignalsInfo getMIInfoSignalsInfo() throws MIException {
return (CLIInfoSignalsInfo)getMIInfo();
}
public MIInfo getMIInfo() throws MIException {
MIInfo info = null;
MIOutput out = getMIOutput();
if (out != null) {
info = new MIInfoSignalsInfo(out);
info = new CLIInfoSignalsInfo(out);
if (info.isError()) {
throwMIException(info, out);
}

View file

@ -13,7 +13,7 @@ package org.eclipse.cdt.debug.mi.core.command;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
import org.eclipse.cdt.debug.mi.core.output.MIInfoThreadsInfo;
import org.eclipse.cdt.debug.mi.core.output.CLIInfoThreadsInfo;
import org.eclipse.cdt.debug.mi.core.output.MIOutput;
/**
@ -21,21 +21,21 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
* info threads
*
*/
public class MIInfoThreads extends CLICommand
public class CLIInfoThreads extends CLICommand
{
public MIInfoThreads() {
public CLIInfoThreads() {
super("info threads"); //$NON-NLS-1$
}
public MIInfoThreadsInfo getMIInfoThreadsInfo() throws MIException {
return (MIInfoThreadsInfo)getMIInfo();
public CLIInfoThreadsInfo getMIInfoThreadsInfo() throws MIException {
return (CLIInfoThreadsInfo)getMIInfo();
}
public MIInfo getMIInfo() throws MIException {
MIInfo info = null;
MIOutput out = getMIOutput();
if (out != null) {
info = new MIInfoThreadsInfo(out);
info = new CLIInfoThreadsInfo(out);
if (info.isError()) {
throwMIException(info, out);
}

View file

@ -20,11 +20,11 @@ import org.eclipse.cdt.debug.mi.core.output.MIResultRecord;
* jump LINESPEC
*
*/
public class MIJump extends CLICommand {
public class CLIJump extends CLICommand {
MIOutput out;
public MIJump(String loc) {
public CLIJump(String loc) {
super("jump " + loc); //$NON-NLS-1$
}

View file

@ -14,28 +14,28 @@ package org.eclipse.cdt.debug.mi.core.command;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
import org.eclipse.cdt.debug.mi.core.output.MIOutput;
import org.eclipse.cdt.debug.mi.core.output.MIPTypeInfo;
import org.eclipse.cdt.debug.mi.core.output.CLIPTypeInfo;
/**
*
* ptype type
*
*/
public class MIPType extends CLICommand
public class CLIPType extends CLICommand
{
public MIPType(String var) {
public CLIPType(String var) {
super("ptype " + var); //$NON-NLS-1$
}
public MIPTypeInfo getMIPtypeInfo() throws MIException {
return (MIPTypeInfo)getMIInfo();
public CLIPTypeInfo getMIPtypeInfo() throws MIException {
return (CLIPTypeInfo)getMIInfo();
}
public MIInfo getMIInfo() throws MIException {
MIInfo info = null;
MIOutput out = getMIOutput();
if (out != null) {
info = new MIPTypeInfo(out);
info = new CLIPTypeInfo(out);
if (info.isError()) {
throwMIException(info, out);
}

View file

@ -18,13 +18,13 @@ package org.eclipse.cdt.debug.mi.core.command;
* sharedlibrary filename
*
*/
public class MISharedLibrary extends CLICommand {
public class CLISharedLibrary extends CLICommand {
public MISharedLibrary() {
public CLISharedLibrary() {
super("sharedlibrary"); //$NON-NLS-1$
}
public MISharedLibrary(String name) {
public CLISharedLibrary(String name) {
super("sharedlibrary " + name); //$NON-NLS-1$
}
}

View file

@ -21,11 +21,11 @@ import org.eclipse.cdt.debug.mi.core.output.MIResultRecord;
* signal SIGUSR1
*
*/
public class MISignal extends CLICommand {
public class CLISignal extends CLICommand {
MIOutput out;
public MISignal(String arg) {
public CLISignal(String arg) {
super("signal " + arg); //$NON-NLS-1$
}

View file

@ -19,9 +19,9 @@ package org.eclipse.cdt.debug.mi.core.command;
* Attach to a process PID or a file FILE outside of GDB.
*
*/
public class MITargetAttach extends CLICommand
public class CLITargetAttach extends CLICommand
{
public MITargetAttach(int pid) {
public CLITargetAttach(int pid) {
super("attach " + Integer.toString(pid)); //$NON-NLS-1$
}
}

View file

@ -14,28 +14,28 @@ package org.eclipse.cdt.debug.mi.core.command;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
import org.eclipse.cdt.debug.mi.core.output.MIOutput;
import org.eclipse.cdt.debug.mi.core.output.MIWhatisInfo;
import org.eclipse.cdt.debug.mi.core.output.CLIWhatisInfo;
/**
*
* whatis type
*
*/
public class MIWhatis extends CLICommand
public class CLIWhatis extends CLICommand
{
public MIWhatis(String var) {
public CLIWhatis(String var) {
super("whatis " + var); //$NON-NLS-1$
}
public MIWhatisInfo getMIWhatisInfo() throws MIException {
return (MIWhatisInfo)getMIInfo();
public CLIWhatisInfo getMIWhatisInfo() throws MIException {
return (CLIWhatisInfo)getMIInfo();
}
public MIInfo getMIInfo() throws MIException {
MIInfo info = null;
MIOutput out = getMIOutput();
if (out != null) {
info = new MIWhatisInfo(out);
info = new CLIWhatisInfo(out);
if (info.isError()) {
throwMIException(info, out);
}

View file

@ -11,107 +11,118 @@
package org.eclipse.cdt.debug.mi.core.command;
/**
* Factory to create GDB commands.
*/
public class CommandFactory {
String fMIVersion;
public CommandFactory(String miVersion) {
fMIVersion = miVersion;
}
public String getMIVersion() {
return fMIVersion;
}
public MIBreakAfter createMIBreakAfter(int brknum, int count) {
return new MIBreakAfter(brknum, count);
return new MIBreakAfter(getMIVersion(), brknum, count);
}
public MIBreakCondition createMIBreakCondition (int brknum, String expr) {
return new MIBreakCondition(brknum, expr);
return new MIBreakCondition(getMIVersion(), brknum, expr);
}
public MIBreakDelete createMIBreakDelete (int[] brknum) {
return new MIBreakDelete(brknum);
return new MIBreakDelete(getMIVersion(), brknum);
}
public MIBreakDisable createMIBreakDisable(int[] brknum) {
return new MIBreakDisable(brknum);
return new MIBreakDisable(getMIVersion(), brknum);
}
public MIBreakEnable createMIBreakEnable(int[] brknum) {
return new MIBreakEnable(brknum);
return new MIBreakEnable(getMIVersion(), brknum);
}
public MIBreakInsert createMIBreakInsert(boolean isTemporary, boolean isHardware,
String condition, int ignoreCount, String line, int tid) {
return new MIBreakInsert(isTemporary, isHardware, condition, ignoreCount, line, tid);
return new MIBreakInsert(getMIVersion(), isTemporary, isHardware, condition, ignoreCount, line, tid);
}
public MIBreakInsert createMIBreakInsert(String func) {
return new MIBreakInsert(func);
return new MIBreakInsert(getMIVersion(), func);
}
public MIBreakList createMIBreakList() {
return new MIBreakList();
return new MIBreakList(getMIVersion());
}
public MIBreakWatch createMIBreakWatch(boolean access, boolean read, String expression) {
return new MIBreakWatch(access, read, expression);
return new MIBreakWatch(getMIVersion(), access, read, expression);
}
public MIDataDisassemble createMIDataDisassemble(String start, String end, boolean mixed) {
return new MIDataDisassemble(start, end, mixed);
return new MIDataDisassemble(getMIVersion(), start, end, mixed);
}
public MIDataDisassemble createMIDataDisassemble(String file, int linenum, int lines, boolean mixed) {
return new MIDataDisassemble(file, linenum, lines, mixed);
return new MIDataDisassemble(getMIVersion(), file, linenum, lines, mixed);
}
public MIDataEvaluateExpression createMIDataEvaluateExpression(String expression) {
return new MIDataEvaluateExpression(expression);
return new MIDataEvaluateExpression(getMIVersion(), expression);
}
public MIDataListChangedRegisters createMIDataListChangedRegisters() {
return new MIDataListChangedRegisters();
return new MIDataListChangedRegisters(getMIVersion());
}
public MIDataListRegisterNames createMIDataListRegisterNames() {
return new MIDataListRegisterNames();
return new MIDataListRegisterNames(getMIVersion());
}
public MIDataListRegisterNames createMIDataListRegisterNames(int[] regnos) {
return new MIDataListRegisterNames(regnos);
return new MIDataListRegisterNames(getMIVersion(), regnos);
}
public MIDataListRegisterValues createMIDataListRegisterValues(int fmt, int[] regnos) {
return new MIDataListRegisterValues(fmt, regnos);
return new MIDataListRegisterValues(getMIVersion(), fmt, regnos);
}
public MIDataWriteRegisterValues createMIDataWriteRegisterValues(int fmt, int[] regnos, String[] values) {
return new MIDataWriteRegisterValues(fmt, regnos, values);
return new MIDataWriteRegisterValues(getMIVersion(), fmt, regnos, values);
}
public MIDataReadMemory createMIDataReadMemory(long offset, String address,
int wordFormat, int wordSize,
int rows, int cols, Character asChar) {
return new MIDataReadMemory(offset, address, wordFormat, wordSize,
return new MIDataReadMemory(getMIVersion(), offset, address, wordFormat, wordSize,
rows, cols, asChar);
}
public MIDataWriteMemory createMIDataWriteMemory(long offset, String address,
int wordFormat, int wordSize,
String value) {
return new MIDataWriteMemory(offset, address, wordFormat, wordSize, value);
return new MIDataWriteMemory(getMIVersion(), offset, address, wordFormat, wordSize, value);
}
public MIEnvironmentCD createMIEnvironmentCD(String pathdir) {
return new MIEnvironmentCD(pathdir);
return new MIEnvironmentCD(getMIVersion(), pathdir);
}
public MIEnvironmentDirectory createMIEnvironmentDirectory(boolean reset, String[] pathdirs) {
return new MIEnvironmentDirectory(reset, pathdirs);
return new MIEnvironmentDirectory(getMIVersion(), reset, pathdirs);
}
public MIEnvironmentPath createMIEnvironmentPath(String[] paths) {
return new MIEnvironmentPath(paths);
return new MIEnvironmentPath(getMIVersion(), paths);
}
public MIEnvironmentPWD createMIEnvironmentPWD() {
return new MIEnvironmentPWD();
return new MIEnvironmentPWD(getMIVersion());
}
/**
@ -119,23 +130,23 @@ public class CommandFactory {
* @return
*/
public MIGDBSetEnvironment createMIGDBSetEnvironment(String[] params) {
return new MIGDBSetEnvironment(params);
return new MIGDBSetEnvironment(getMIVersion(), params);
}
public MIExecAbort createMIExecAbort() {
return new MIExecAbort();
public CLIExecAbort createCLIExecAbort() {
return new CLIExecAbort();
}
public MIExecArguments createMIExecArguments(String[] args) {
return new MIExecArguments(args);
return new MIExecArguments(getMIVersion(), args);
}
public MIExecContinue createMIExecContinue() {
return new MIExecContinue();
return new MIExecContinue(getMIVersion());
}
public MIExecFinish createMIExecFinish() {
return new MIExecFinish();
return new MIExecFinish(getMIVersion());
}
public MIExecInterrupt createMIExecInterrupt() {
@ -146,191 +157,191 @@ public class CommandFactory {
}
public MIExecNext createMIExecNext(int count) {
return new MIExecNext(count);
return new MIExecNext(getMIVersion(), count);
}
public MIExecNextInstruction createMIExecNextInstruction(int count) {
return new MIExecNextInstruction(count);
return new MIExecNextInstruction(getMIVersion(), count);
}
public MIExecReturn createMIExecReturn() {
return new MIExecReturn();
return new MIExecReturn(getMIVersion());
}
public MIExecReturn createMIExecReturn(String arg) {
return new MIExecReturn(arg);
return new MIExecReturn(getMIVersion(), arg);
}
public MIExecRun createMIExecRun(String[] args) {
return new MIExecRun(args);
return new MIExecRun(getMIVersion(), args);
}
public MIExecStep createMIExecStep(int count) {
return new MIExecStep(count);
return new MIExecStep(getMIVersion(), count);
}
public MIExecStepInstruction createMIExecStepInstruction(int count) {
return new MIExecStepInstruction(count);
return new MIExecStepInstruction(getMIVersion(), count);
}
public MIExecUntil createMIExecUntil(String location) {
return new MIExecUntil(location);
return new MIExecUntil(getMIVersion(), location);
}
public MIJump createMIJump(String location) {
return new MIJump(location);
public CLIJump createCLIJump(String location) {
return new CLIJump(location);
}
public MIFileExecFile createMIFileExecFile(String file) {
return new MIFileExecFile(file);
return new MIFileExecFile(getMIVersion(), file);
}
public MIFileSymbolFile createMIFileSymbolFile(String file) {
return new MIFileSymbolFile(file);
return new MIFileSymbolFile(getMIVersion(), file);
}
public MIGDBExit createMIGDBExit() {
return new MIGDBExit();
return new MIGDBExit(getMIVersion());
}
public MIGDBSet createMIGDBSet(String[] params) {
return new MIGDBSet(params);
return new MIGDBSet(getMIVersion(), params);
}
public MIGDBSetAutoSolib createMIGDBSetAutoSolib(boolean set) {
return new MIGDBSetAutoSolib(set);
return new MIGDBSetAutoSolib(getMIVersion(), set);
}
public MIGDBSetStopOnSolibEvents createMIGDBSetStopOnSolibEvents(boolean set) {
return new MIGDBSetStopOnSolibEvents(set);
return new MIGDBSetStopOnSolibEvents(getMIVersion(), set);
}
public MIGDBSetSolibSearchPath createMIGDBSetSolibSearchPath(String[] params) {
return new MIGDBSetSolibSearchPath(params);
return new MIGDBSetSolibSearchPath(getMIVersion(), params);
}
public MIGDBShow createMIGDBShow(String[] params) {
return new MIGDBShow(params);
return new MIGDBShow(getMIVersion(), params);
}
public MIGDBShowExitCode createMIGDBShowExitCode() {
return new MIGDBShowExitCode();
return new MIGDBShowExitCode(getMIVersion());
}
public MIGDBShowDirectories createMIGDBShowDirectories() {
return new MIGDBShowDirectories();
return new MIGDBShowDirectories(getMIVersion());
}
public MIGDBShowSolibSearchPath createMIGDBShowSolibSearchPath() {
return new MIGDBShowSolibSearchPath();
return new MIGDBShowSolibSearchPath(getMIVersion());
}
public MIGDBShowAddressSize createMIGDBShowAddressSize() {
return new MIGDBShowAddressSize();
return new MIGDBShowAddressSize(getMIVersion());
}
public MIGDBShowEndian createMIGDBShowEndian() {
return new MIGDBShowEndian();
return new MIGDBShowEndian(getMIVersion());
}
public MIStackInfoDepth createMIStackInfoDepth() {
return new MIStackInfoDepth();
return new MIStackInfoDepth(getMIVersion());
}
public MIStackInfoDepth createMIStackInfoDepth(int depth) {
return new MIStackInfoDepth(depth);
return new MIStackInfoDepth(getMIVersion(), depth);
}
public MIStackListArguments createMIStackListArguments(boolean showValue) {
return new MIStackListArguments(showValue);
return new MIStackListArguments(getMIVersion(), showValue);
}
public MIStackListArguments createMIStackListArguments(boolean showValue, int lowFrame, int highFrame) {
return new MIStackListArguments(showValue, lowFrame, highFrame);
return new MIStackListArguments(getMIVersion(), showValue, lowFrame, highFrame);
}
public MIStackListFrames createMIStackListFrames() {
return new MIStackListFrames();
return new MIStackListFrames(getMIVersion());
}
public MIStackListFrames createMIStackListFrames(int lowFrame, int highFrame) {
return new MIStackListFrames(lowFrame, highFrame);
return new MIStackListFrames(getMIVersion(), lowFrame, highFrame);
}
public MIStackListLocals createMIStackListLocals(boolean showValues) {
return new MIStackListLocals(showValues);
return new MIStackListLocals(getMIVersion(), showValues);
}
public MIStackSelectFrame createMIStackSelectFrame(int frameNum) {
return new MIStackSelectFrame(frameNum);
return new MIStackSelectFrame(getMIVersion(), frameNum);
}
public MITargetAttach createMITargetAttach(int pid) {
return new MITargetAttach(pid);
public CLITargetAttach createCLITargetAttach(int pid) {
return new CLITargetAttach(pid);
}
public MITargetDetach createMITargetDetach() {
return new MITargetDetach();
return new MITargetDetach(getMIVersion());
}
public MITargetSelect createMITargetSelect(String[] params) {
return new MITargetSelect(params);
return new MITargetSelect(getMIVersion(), params);
}
public MIThreadListIds createMIThreadListIds() {
return new MIThreadListIds();
return new MIThreadListIds(getMIVersion());
}
public MIInfoThreads createMIInfoThreads() {
return new MIInfoThreads();
public CLIInfoThreads createCLIInfoThreads() {
return new CLIInfoThreads();
}
public MIThreadSelect createMIThreadSelect(int threadNum) {
return new MIThreadSelect(threadNum);
return new MIThreadSelect(getMIVersion(), threadNum);
}
public MIInfoSharedLibrary createMIInfoSharedLibrary() {
return new MIInfoSharedLibrary();
public CLIInfoSharedLibrary createCLIInfoSharedLibrary() {
return new CLIInfoSharedLibrary();
}
public MISharedLibrary createMISharedLibrary() {
return new MISharedLibrary();
public CLISharedLibrary createCLISharedLibrary() {
return new CLISharedLibrary();
}
public MISharedLibrary createMISharedLibrary(String name) {
return new MISharedLibrary(name);
public CLISharedLibrary createCLISharedLibrary(String name) {
return new CLISharedLibrary(name);
}
public MIWhatis createMIWhatis(String name) {
return new MIWhatis(name);
public CLIWhatis createCLIWhatis(String name) {
return new CLIWhatis(name);
}
public MIInfoSignals createMIInfoSignals() {
return new MIInfoSignals();
public CLIInfoSignals createCLIInfoSignals() {
return new CLIInfoSignals();
}
public MIInfoSignals createMIInfoSignals(String name) {
return new MIInfoSignals(name);
public CLIInfoSignals createCLIInfoSignals(String name) {
return new CLIInfoSignals(name);
}
public MIHandle createMIHandle(String arg) {
return new MIHandle(arg);
public CLIHandle createCLIHandle(String arg) {
return new CLIHandle(arg);
}
public MISignal createMISignal(String arg) {
return new MISignal(arg);
public CLISignal createCLISignal(String arg) {
return new CLISignal(arg);
}
public MIPType createMIPType(String name) {
return new MIPType(name);
public CLIPType createCLIPType(String name) {
return new CLIPType(name);
}
public MIInfoProgram createMIInfoProgram() {
return new MIInfoProgram();
public CLIInfoProgram createCLIInfoProgram() {
return new CLIInfoProgram();
}
public MIVarCreate createMIVarCreate(String expression) {
return new MIVarCreate(expression);
return new MIVarCreate(getMIVersion(), expression);
}
public MIVarCreate createMIVarCreate(String name, String frameAddr, String expression) {
@ -338,51 +349,54 @@ public class CommandFactory {
}
public MIVarDelete createMIVarDelete(String name) {
return new MIVarDelete(name);
return new MIVarDelete(getMIVersion(), name);
}
public MIVarSetFormat createMIVarSetFormat(String name, int format) {
return new MIVarSetFormat(name, format);
return new MIVarSetFormat(getMIVersion(), name, format);
}
public MIVarShowFormat createMIVarShowFormat(String name) {
return new MIVarShowFormat(name);
return new MIVarShowFormat(getMIVersion(), name);
}
public MIVarInfoNumChildren createMIVarInfoNumChildren(String name) {
return new MIVarInfoNumChildren(name);
return new MIVarInfoNumChildren(getMIVersion(), name);
}
public MIVarListChildren createMIVarListChildren(String name) {
return new MIVarListChildren(name);
return new MIVarListChildren(getMIVersion(), name);
}
public MIVarInfoType createMIVarInfoType(String name) {
return new MIVarInfoType(name);
return new MIVarInfoType(getMIVersion(), name);
}
public MIVarInfoExpression createMIVarInfoExpression(String name) {
return new MIVarInfoExpression(name);
return new MIVarInfoExpression(getMIVersion(), name);
}
public MIVarShowAttributes createMIVarShowAttributes(String name) {
return new MIVarShowAttributes(name);
return new MIVarShowAttributes(getMIVersion(), name);
}
public MIVarEvaluateExpression createMIVarEvaluateExpression(String name) {
return new MIVarEvaluateExpression(name);
return new MIVarEvaluateExpression(getMIVersion(), name);
}
public MIVarAssign createMIVarAssign(String name, String expr) {
return new MIVarAssign(name, expr);
return new MIVarAssign(getMIVersion(), name, expr);
}
public MIVarUpdate createMIVarUpdate() {
return new MIVarUpdate();
return new MIVarUpdate(getMIVersion());
}
public MIVarUpdate createMIVarUpdate(String name) {
return new MIVarUpdate(name);
return new MIVarUpdate(getMIVersion(), name);
}
public MIInterpreterExecConsole createMIInterpreterExecConsole(String cmd) {
return new MIInterpreterExecConsole(getMIVersion(), cmd);
}
}

View file

@ -25,8 +25,8 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIBreakAfter extends MICommand
{
public MIBreakAfter(int brknum, int count) {
super("-break-after",new String[]{Integer.toString(brknum), //$NON-NLS-1$
public MIBreakAfter(String miVersion, int brknum, int count) {
super(miVersion, "-break-after",new String[]{Integer.toString(brknum), //$NON-NLS-1$
Integer.toString(count)});
}

View file

@ -22,8 +22,8 @@ package org.eclipse.cdt.debug.mi.core.command;
* ^done
*/
public class MIBreakCondition extends MICommand {
public MIBreakCondition(int brknum, String expr) {
super("-break-condition", new String[] { Integer.toString(brknum), expr }); //$NON-NLS-1$
public MIBreakCondition(String miVersion, int brknum, String expr) {
super(miVersion, "-break-condition", new String[] { Integer.toString(brknum), expr }); //$NON-NLS-1$
}
/**

View file

@ -24,8 +24,8 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIBreakDelete extends MICommand
{
public MIBreakDelete (int[] array) {
super("-break-delete"); //$NON-NLS-1$
public MIBreakDelete (String miVersion, int[] array) {
super(miVersion, "-break-delete"); //$NON-NLS-1$
if (array != null && array.length > 0) {
String[] brkids = new String[array.length];
for (int i = 0; i < array.length; i++) {

View file

@ -23,8 +23,8 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIBreakDisable extends MICommand
{
public MIBreakDisable (int[] array) {
super("-break-disable"); //$NON-NLS-1$
public MIBreakDisable (String miVersion, int[] array) {
super(miVersion, "-break-disable"); //$NON-NLS-1$
if (array != null && array.length > 0) {
String[] brkids = new String[array.length];
for (int i = 0; i < array.length; i++) {

View file

@ -22,8 +22,8 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIBreakEnable extends MICommand
{
public MIBreakEnable (int[] array) {
super("-break-enable"); //$NON-NLS-1$
public MIBreakEnable (String miVersion, int[] array) {
super(miVersion, "-break-enable"); //$NON-NLS-1$
if (array != null && array.length > 0) {
String[] brkids = new String[array.length];
for (int i = 0; i < array.length; i++) {

View file

@ -60,13 +60,13 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
*/
public class MIBreakInsert extends MICommand
{
public MIBreakInsert(String func) {
this(false, false, null, 0, func, 0);
public MIBreakInsert(String miVersion, String func) {
this(miVersion, false, false, null, 0, func, 0);
}
public MIBreakInsert(boolean isTemporary, boolean isHardware,
public MIBreakInsert(String miVersion, boolean isTemporary, boolean isHardware,
String condition, int ignoreCount, String line, int tid) {
super("-break-insert"); //$NON-NLS-1$
super(miVersion, "-break-insert"); //$NON-NLS-1$
int i = 0;
if (isTemporary || isHardware) {

View file

@ -51,8 +51,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
*/
public class MIBreakList extends MICommand
{
public MIBreakList () {
super("-break-list"); //$NON-NLS-1$
public MIBreakList (String miVersion) {
super(miVersion, "-break-list"); //$NON-NLS-1$
}
public MIBreakListInfo getMIBreakListInfo() throws MIException {

View file

@ -31,8 +31,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
*/
public class MIBreakWatch extends MICommand
{
public MIBreakWatch (boolean access, boolean read, String expr) {
super("-break-watch");//$NON-NLS-1$
public MIBreakWatch (String miVersion, boolean access, boolean read, String expr) {
super(miVersion, "-break-watch");//$NON-NLS-1$
String[] opts = null;
if (access) {
opts = new String[] {"-a"}; //$NON-NLS-1$

View file

@ -16,24 +16,57 @@ package org.eclipse.cdt.debug.mi.core.command;
* Represents a MI command.
*/
public class MICommand extends Command {
final String[] empty = new String[0];
final static String[] empty = new String[0];
String[] options = empty;
String[] parameters = empty;
String operation = ""; //$NON-NLS-1$
String operation = new String();
String fMIVersion;
public MICommand(String oper) {
this.operation = oper;
public MICommand(String miVersion, String oper) {
this(miVersion, oper, empty);
}
public MICommand(String oper, String[] param) {
this.operation = oper;
this.parameters = param;
public MICommand(String miVersion, String oper, String[] params) {
this(miVersion, oper, empty, params);
}
public MICommand(String oper, String[] opt, String[] param) {
public MICommand(String miVersion, String oper, String[] opt, String[] params) {
fMIVersion = miVersion;
this.operation = oper;
this.options = opt;
this.parameters = param;
this.parameters = params;
}
/**
* Return the MI version for this command
* @return
*/
public String getMIVersion() {
return fMIVersion;
}
/**
* Set the MI version for this command
* @param miVersion
*/
public void setMIVersion(String miVersion) {
fMIVersion = miVersion;
}
/**
* whether the MI version is "mi1"
* @return
*/
public boolean isMI1() {
return "mi1".equalsIgnoreCase(fMIVersion); //$NON-NLS-1$
}
/**
* whether the MI version is "mi2"
* @return
*/
public boolean isMI2() {
return "mi2".equalsIgnoreCase(fMIVersion); //$NON-NLS-1$
}
/**

View file

@ -71,8 +71,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
*/
public class MIDataDisassemble extends MICommand
{
public MIDataDisassemble(String start, String end, boolean mode) {
super("-data-disassemble"); //$NON-NLS-1$
public MIDataDisassemble(String miVersion, String start, String end, boolean mode) {
super(miVersion, "-data-disassemble"); //$NON-NLS-1$
setOptions(new String[]{"-s", start, "-e", end}); //$NON-NLS-1$ //$NON-NLS-2$
String mixed = "0"; //$NON-NLS-1$
if (mode) {
@ -81,8 +81,8 @@ public class MIDataDisassemble extends MICommand
setParameters(new String[]{mixed});
}
public MIDataDisassemble(String file, int linenum, int lines, boolean mode) {
super("-data-disassemble"); //$NON-NLS-1$
public MIDataDisassemble(String miVersion, String file, int linenum, int lines, boolean mode) {
super(miVersion, "-data-disassemble"); //$NON-NLS-1$
setOptions(new String[]{"-f", file, "-l", //$NON-NLS-1$ //$NON-NLS-2$
Integer.toString(linenum), "-n", Integer.toString(lines)}); //$NON-NLS-1$
String mixed = "0"; //$NON-NLS-1$

View file

@ -27,8 +27,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
*/
public class MIDataEvaluateExpression extends MICommand
{
public MIDataEvaluateExpression(String expr) {
super("-data-evaluate-expression", new String[]{expr}); //$NON-NLS-1$
public MIDataEvaluateExpression(String miVersion, String expr) {
super(miVersion, "-data-evaluate-expression", new String[]{expr}); //$NON-NLS-1$
}
public MIDataEvaluateExpressionInfo getMIDataEvaluateExpressionInfo() throws MIException {

View file

@ -25,8 +25,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
*/
public class MIDataListChangedRegisters extends MICommand
{
public MIDataListChangedRegisters() {
super("-data-list-changed-registers" ); //$NON-NLS-1$
public MIDataListChangedRegisters(String miVersion) {
super(miVersion, "-data-list-changed-registers" ); //$NON-NLS-1$
}
public MIDataListChangedRegistersInfo getMIDataListChangedRegistersInfo() throws MIException {

View file

@ -30,12 +30,12 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
*/
public class MIDataListRegisterNames extends MICommand
{
public MIDataListRegisterNames() {
super("-data-list-register-names"); //$NON-NLS-1$
public MIDataListRegisterNames(String miVersion) {
super(miVersion, "-data-list-register-names"); //$NON-NLS-1$
}
public MIDataListRegisterNames(int [] regnos) {
this();
public MIDataListRegisterNames(String miVersion, int [] regnos) {
this(miVersion);
if (regnos != null && regnos.length > 0) {
String[] array = new String[regnos.length];
for (int i = 0; i < regnos.length; i++) {

View file

@ -30,12 +30,12 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
*/
public class MIDataListRegisterValues extends MICommand
{
public MIDataListRegisterValues(int fmt) {
this(fmt, null);
public MIDataListRegisterValues(String miVersion, int fmt) {
this(miVersion, fmt, null);
}
public MIDataListRegisterValues(int fmt, int [] regnos) {
super("-data-list-register-values"); //$NON-NLS-1$
public MIDataListRegisterValues(String miVersion, int fmt, int [] regnos) {
super(miVersion, "-data-list-register-values"); //$NON-NLS-1$
String format = "x"; //$NON-NLS-1$
switch (fmt) {

View file

@ -58,6 +58,7 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
public class MIDataReadMemory extends MICommand {
public MIDataReadMemory(
String miVersion,
long offset,
String address,
int wordFormat,
@ -65,7 +66,7 @@ public class MIDataReadMemory extends MICommand {
int rows,
int cols,
Character asChar) {
super("-data-read-memory"); //$NON-NLS-1$
super(miVersion, "-data-read-memory"); //$NON-NLS-1$
if (offset != 0) {
setOptions(new String[] { "-o", Long.toString(offset)}); //$NON-NLS-1$
}

View file

@ -39,10 +39,10 @@ import org.eclipse.cdt.debug.mi.core.MIFormat;
*/
public class MIDataWriteMemory extends MICommand {
public MIDataWriteMemory(long offset, String address, int wordFormat, int wordSize,
public MIDataWriteMemory(String miVersion, long offset, String address, int wordFormat, int wordSize,
String value) {
super ("-data-write-memory"); //$NON-NLS-1$
super (miVersion, "-data-write-memory"); //$NON-NLS-1$
if (offset != 0) {
setOptions(new String[] { "-o", Long.toString(offset)}); //$NON-NLS-1$

View file

@ -25,8 +25,8 @@ import org.eclipse.cdt.debug.mi.core.MIFormat;
*/
public class MIDataWriteRegisterValues extends MICommand {
public MIDataWriteRegisterValues(int fmt, int[] regnos, String[] values) {
super("-data-write-register-values"); //$NON-NLS-1$
public MIDataWriteRegisterValues(String miVersion, int fmt, int[] regnos, String[] values) {
super(miVersion, "-data-write-register-values"); //$NON-NLS-1$
String format = "x"; //$NON-NLS-1$
switch (fmt) {

View file

@ -22,8 +22,8 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIEnvironmentCD extends MICommand
{
public MIEnvironmentCD(String path) {
super("-environment-cd", new String[]{path}); //$NON-NLS-1$
public MIEnvironmentCD(String miVersion, String path) {
super(miVersion, "-environment-cd", new String[]{path}); //$NON-NLS-1$
}
/**

View file

@ -20,11 +20,14 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIEnvironmentDirectory extends MICommand
{
public MIEnvironmentDirectory(boolean reset, String[] paths) {
super("-environment-directory", paths); //$NON-NLS-1$
public MIEnvironmentDirectory(String miVersion, boolean reset, String[] paths) {
super(miVersion, "-environment-directory", paths); //$NON-NLS-1$
if (isMI2()) {
// earlier version do no accept the "-r" option.
if (reset) {
setOptions(new String[] {"-r"}); //$NON-NLS-1$
}
}
}
}

View file

@ -25,8 +25,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
*/
public class MIEnvironmentPWD extends MICommand
{
public MIEnvironmentPWD() {
super("-environment-pwd"); //$NON-NLS-1$
public MIEnvironmentPWD(String miVersion) {
super(miVersion, "-environment-pwd"); //$NON-NLS-1$
}
public MIInfo getMIInfo() throws MIException {

View file

@ -20,7 +20,7 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIEnvironmentPath extends MICommand
{
public MIEnvironmentPath(String[] paths) {
super("-environment-path", paths); //$NON-NLS-1$
public MIEnvironmentPath(String miVersion, String[] paths) {
super(miVersion, "-environment-path", paths); //$NON-NLS-1$
}
}

View file

@ -21,7 +21,7 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIExecArguments extends MICommand
{
public MIExecArguments(String[] args) {
super("-exec-arguments", args); //$NON-NLS-1$
public MIExecArguments(String miVersion, String[] args) {
super(miVersion, "-exec-arguments", args); //$NON-NLS-1$
}
}

View file

@ -21,7 +21,7 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIExecContinue extends MICommand
{
public MIExecContinue() {
super("-exec-continue"); //$NON-NLS-1$
public MIExecContinue(String miVersion) {
super(miVersion, "-exec-continue"); //$NON-NLS-1$
}
}

View file

@ -22,7 +22,7 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIExecFinish extends MICommand
{
public MIExecFinish() {
super("-exec-finish"); //$NON-NLS-1$
public MIExecFinish(String miVersion) {
super(miVersion, "-exec-finish"); //$NON-NLS-1$
}
}

View file

@ -25,7 +25,7 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIExecInterrupt extends MICommand
{
public MIExecInterrupt() {
super("-exec-interrupt"); //$NON-NLS-1$
public MIExecInterrupt(String miVersion) {
super(miVersion, "-exec-interrupt"); //$NON-NLS-1$
}
}

View file

@ -21,11 +21,11 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIExecNext extends MICommand
{
public MIExecNext() {
super("-exec-next"); //$NON-NLS-1$
public MIExecNext(String miVersion) {
super(miVersion, "-exec-next"); //$NON-NLS-1$
}
public MIExecNext(int count) {
super("-exec-next", new String[] { Integer.toString(count) }); //$NON-NLS-1$
public MIExecNext(String miVersion, int count) {
super(miVersion, "-exec-next", new String[] { Integer.toString(count) }); //$NON-NLS-1$
}
}

View file

@ -23,11 +23,11 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIExecNextInstruction extends MICommand
{
public MIExecNextInstruction() {
super("-exec-next-instruction"); //$NON-NLS-1$
public MIExecNextInstruction(String miVersion) {
super(miVersion, "-exec-next-instruction"); //$NON-NLS-1$
}
public MIExecNextInstruction(int count) {
super("-exec-next-instruction", new String[] { Integer.toString(count) }); //$NON-NLS-1$
public MIExecNextInstruction(String miVersion, int count) {
super(miVersion, "-exec-next-instruction", new String[] { Integer.toString(count) }); //$NON-NLS-1$
}
}

View file

@ -21,12 +21,12 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIExecReturn extends MICommand
{
public MIExecReturn() {
super("-exec-return"); //$NON-NLS-1$
public MIExecReturn(String miVersion) {
super(miVersion, "-exec-return"); //$NON-NLS-1$
}
public MIExecReturn(String arg) {
super("-exec-run", new String[] { arg }); //$NON-NLS-1$
public MIExecReturn(String miVersion, String arg) {
super(miVersion, "-exec-run", new String[] { arg }); //$NON-NLS-1$
}
}

View file

@ -22,11 +22,11 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIExecRun extends MICommand
{
public MIExecRun() {
super("-exec-run"); //$NON-NLS-1$
public MIExecRun(String miVersion) {
super(miVersion, "-exec-run"); //$NON-NLS-1$
}
public MIExecRun(String[] args) {
super("-exec-run", args); //$NON-NLS-1$
public MIExecRun(String miVersion, String[] args) {
super(miVersion, "-exec-run", args); //$NON-NLS-1$
}
}

View file

@ -23,11 +23,11 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIExecStep extends MICommand
{
public MIExecStep() {
super("-exec-step"); //$NON-NLS-1$
public MIExecStep(String miVersion) {
super(miVersion, "-exec-step"); //$NON-NLS-1$
}
public MIExecStep(int count) {
super("-exec-step", new String[] { Integer.toString(count) }); //$NON-NLS-1$
public MIExecStep(String miVersion, int count) {
super(miVersion, "-exec-step", new String[] { Integer.toString(count) }); //$NON-NLS-1$
}
}

View file

@ -26,11 +26,11 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIExecStepInstruction extends MICommand
{
public MIExecStepInstruction() {
super("-exec-step-instruction"); //$NON-NLS-1$
public MIExecStepInstruction(String miVersion) {
super(miVersion, "-exec-step-instruction"); //$NON-NLS-1$
}
public MIExecStepInstruction(int count) {
super("-exec-step-instruction", new String[] { Integer.toString(count) }); //$NON-NLS-1$
public MIExecStepInstruction(String miVersion, int count) {
super(miVersion, "-exec-step-instruction", new String[] { Integer.toString(count) }); //$NON-NLS-1$
}
}

View file

@ -24,11 +24,11 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIExecUntil extends MICommand
{
public MIExecUntil() {
super("-exec-until"); //$NON-NLS-1$
public MIExecUntil(String miVersion) {
super(miVersion, "-exec-until"); //$NON-NLS-1$
}
public MIExecUntil(String loc) {
super("-exec-until", new String[]{loc}); //$NON-NLS-1$
public MIExecUntil(String miVersion, String loc) {
super(miVersion, "-exec-until", new String[]{loc}); //$NON-NLS-1$
}
}

View file

@ -24,7 +24,7 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIFileExecFile extends MICommand
{
public MIFileExecFile(String file) {
super("-file-exec-file", new String[]{file}); //$NON-NLS-1$
public MIFileExecFile(String miVersion, String file) {
super(miVersion, "-file-exec-file", new String[]{file}); //$NON-NLS-1$
}
}

View file

@ -22,7 +22,7 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIFileSymbolFile extends MICommand
{
public MIFileSymbolFile(String file) {
super("-file-symbol-file", new String[]{file}); //$NON-NLS-1$
public MIFileSymbolFile(String miVersion, String file) {
super(miVersion, "-file-symbol-file", new String[]{file}); //$NON-NLS-1$
}
}

View file

@ -20,7 +20,7 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIGDBExit extends MICommand
{
public MIGDBExit() {
super("-gdb-exit"); //$NON-NLS-1$
public MIGDBExit(String miVersion) {
super(miVersion, "-gdb-exit"); //$NON-NLS-1$
}
}

View file

@ -20,7 +20,7 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIGDBSet extends MICommand
{
public MIGDBSet(String[] params) {
super("-gdb-set", params); //$NON-NLS-1$
public MIGDBSet(String miVersion, String[] params) {
super(miVersion, "-gdb-set", params); //$NON-NLS-1$
}
}

View file

@ -19,7 +19,7 @@ package org.eclipse.cdt.debug.mi.core.command;
*
*/
public class MIGDBSetAutoSolib extends MIGDBSet {
public MIGDBSetAutoSolib(boolean isSet) {
super(new String[] {"auto-solib-add", (isSet) ? "on" : "off"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
public MIGDBSetAutoSolib(String miVersion, boolean isSet) {
super(miVersion, new String[] {"auto-solib-add", (isSet) ? "on" : "off"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}

View file

@ -20,8 +20,8 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIGDBSetEnvironment extends MIGDBSet {
public MIGDBSetEnvironment(String[] paths) {
super(paths);
public MIGDBSetEnvironment(String miVersion, String[] paths) {
super(miVersion, paths);
// Overload the parameter
String[] newPaths = new String[paths.length + 1];
newPaths[0] = "environment"; //$NON-NLS-1$

View file

@ -19,8 +19,8 @@ package org.eclipse.cdt.debug.mi.core.command;
*
*/
public class MIGDBSetSolibSearchPath extends MIGDBSet {
public MIGDBSetSolibSearchPath(String[] paths) {
super(paths);
public MIGDBSetSolibSearchPath(String miVersion, String[] paths) {
super(miVersion, paths);
// Overload the parameter
String sep = System.getProperty("path.separator", ":"); //$NON-NLS-1$ //$NON-NLS-2$
StringBuffer buffer = new StringBuffer();

View file

@ -19,7 +19,8 @@ package org.eclipse.cdt.debug.mi.core.command;
*
*/
public class MIGDBSetStopOnSolibEvents extends MIGDBSet {
public MIGDBSetStopOnSolibEvents(boolean isSet) {
super(new String[] {"stop-on-solib-events", (isSet) ? "1" : "0"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
public MIGDBSetStopOnSolibEvents(String miVersion, boolean isSet) {
super(miVersion, new String[] {"stop-on-solib-events", (isSet) ? "1" : "0"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}

View file

@ -24,8 +24,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
*
*/
public class MIGDBShow extends MICommand {
public MIGDBShow(String[] params) {
super("-gdb-show", params); //$NON-NLS-1$
public MIGDBShow(String miVersion, String[] params) {
super(miVersion, "-gdb-show", params); //$NON-NLS-1$
}
public MIGDBShowInfo getMIGDBShowInfo() throws MIException {

View file

@ -8,12 +8,6 @@
* Contributors:
* QNX Software Systems - initial API and implementation
*******************************************************************************/
/*
* Created on Jun 4, 2004
*
* To change the template for this generated file go to
* Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
*/
package org.eclipse.cdt.debug.mi.core.command;
import org.eclipse.cdt.debug.mi.core.MIException;
@ -22,15 +16,12 @@ import org.eclipse.cdt.debug.mi.core.output.MIInfo;
import org.eclipse.cdt.debug.mi.core.output.MIOutput;
/**
* @author root
*
* To change the template for this generated type comment go to
* Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
*/
public class MIGDBShowAddressSize extends MIGDBShow {
public MIGDBShowAddressSize () {
super(new String[] { "remoteaddresssize" }); //$NON-NLS-1$
public MIGDBShowAddressSize (String miVersion) {
super(miVersion, new String[] { "remoteaddresssize" }); //$NON-NLS-1$
}
public MIInfo getMIInfo() throws MIException {

View file

@ -24,8 +24,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
*
*/
public class MIGDBShowDirectories extends MIGDBShow {
public MIGDBShowDirectories() {
super(new String[] { "directories" }); //$NON-NLS-1$
public MIGDBShowDirectories(String miVersion) {
super(miVersion, new String[] { "directories" }); //$NON-NLS-1$
}
public MIGDBShowDirectoriesInfo getMIGDBShowDirectoriesInfo() throws MIException {

View file

@ -18,8 +18,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIGDBShowEndianInfo;
public class MIGDBShowEndian extends MIGDBShow {
public MIGDBShowEndian() {
super(new String[] {"endian"}); //$NON-NLS-1$
public MIGDBShowEndian(String miVersion) {
super(miVersion, new String[] {"endian"}); //$NON-NLS-1$
}
public MIGDBShowEndianInfo getMIShowEndianInfo() throws MIException {

View file

@ -26,8 +26,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
*/
public class MIGDBShowExitCode extends MIDataEvaluateExpression {
public MIGDBShowExitCode() {
super("$_exitcode"); //$NON-NLS-1$
public MIGDBShowExitCode(String miVersion) {
super(miVersion, "$_exitcode"); //$NON-NLS-1$
}
public MIGDBShowExitCodeInfo getMIGDBShowExitCodeInfo() throws MIException {

View file

@ -19,7 +19,7 @@ public class MIGDBShowPrompt extends MIGDBShow {
/**
* @param params
*/
public MIGDBShowPrompt() {
super(new String[] { "prompt" }); //$NON-NLS-1$
public MIGDBShowPrompt(String miVersion) {
super(miVersion, new String[] { "prompt" }); //$NON-NLS-1$
}
}

View file

@ -24,8 +24,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
*
*/
public class MIGDBShowSolibSearchPath extends MIGDBShow {
public MIGDBShowSolibSearchPath() {
super(new String[] { "solib-search-path" }); //$NON-NLS-1$
public MIGDBShowSolibSearchPath(String miVersion) {
super(miVersion, new String[] { "solib-search-path" }); //$NON-NLS-1$
}
public MIGDBShowSolibSearchPathInfo getMIGDBShowSolibSearchPathInfo() throws MIException {

View file

@ -32,8 +32,8 @@ public class MIInterpreterExec extends MICommand {
/**
* @param oper
*/
public MIInterpreterExec(String interpreter, String cmd) {
super("-interpreter-exec", new String[]{interpreter}, new String[] {cmd}); //$NON-NLS-1$
public MIInterpreterExec(String miVersion, String interpreter, String cmd) {
super(miVersion, "-interpreter-exec", new String[]{interpreter}, new String[] {cmd}); //$NON-NLS-1$
}
}

View file

@ -20,8 +20,8 @@ public class MIInterpreterExecConsole extends MIInterpreterExec {
* @param interpreter
* @param cmd
*/
public MIInterpreterExecConsole(String cmd) {
super("console", cmd); //$NON-NLS-1$
public MIInterpreterExecConsole(String miVersion, String cmd) {
super(miVersion, "console", cmd); //$NON-NLS-1$
}
}

View file

@ -26,12 +26,12 @@ import org.eclipse.cdt.debug.mi.core.output.MIStackInfoDepthInfo;
*/
public class MIStackInfoDepth extends MICommand
{
public MIStackInfoDepth() {
super("-stack-info-depth"); //$NON-NLS-1$
public MIStackInfoDepth(String miVersion) {
super(miVersion, "-stack-info-depth"); //$NON-NLS-1$
}
public MIStackInfoDepth(int maxDepth) {
super("-stack-info-depth", new String[]{Integer.toString(maxDepth)}); //$NON-NLS-1$
public MIStackInfoDepth(String miVersion, int maxDepth) {
super(miVersion, "-stack-info-depth", new String[]{Integer.toString(maxDepth)}); //$NON-NLS-1$
}
public MIStackInfoDepthInfo getMIStackInfoDepthInfo() throws MIException {

View file

@ -32,8 +32,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIStackListArgumentsInfo;
*/
public class MIStackListArguments extends MICommand
{
public MIStackListArguments(boolean showValues) {
super("-stack-list-arguments"); //$NON-NLS-1$
public MIStackListArguments(String miVersion, boolean showValues) {
super(miVersion, "-stack-list-arguments"); //$NON-NLS-1$
if (showValues) {
setParameters(new String[]{"1"}); //$NON-NLS-1$
} else {
@ -41,8 +41,8 @@ public class MIStackListArguments extends MICommand
}
}
public MIStackListArguments(boolean showValues, int low, int high) {
super("-stack-list-arguments"); //$NON-NLS-1$
public MIStackListArguments(String miVersion, boolean showValues, int low, int high) {
super(miVersion, "-stack-list-arguments"); //$NON-NLS-1$
String[] params = new String[3];
if (showValues) {
params[0] = "1"; //$NON-NLS-1$

View file

@ -47,12 +47,12 @@ import org.eclipse.cdt.debug.mi.core.output.MIStackListFramesInfo;
*/
public class MIStackListFrames extends MICommand
{
public MIStackListFrames() {
super("-stack-list-frames"); //$NON-NLS-1$
public MIStackListFrames(String miVersion) {
super(miVersion, "-stack-list-frames"); //$NON-NLS-1$
}
public MIStackListFrames(int low, int high) {
super("-stack-list-frames", new String[]{Integer.toString(low), //$NON-NLS-1$
public MIStackListFrames(String miVersion, int low, int high) {
super(miVersion, "-stack-list-frames", new String[]{Integer.toString(low), //$NON-NLS-1$
Integer.toString(high)});
}

View file

@ -27,8 +27,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIStackListLocalsInfo;
*/
public class MIStackListLocals extends MICommand
{
public MIStackListLocals(boolean printValues) {
super("-stack-list-locals"); //$NON-NLS-1$
public MIStackListLocals(String miVersion, boolean printValues) {
super(miVersion, "-stack-list-locals"); //$NON-NLS-1$
if (printValues) {
setParameters(new String[]{"1"}); //$NON-NLS-1$
} else {

View file

@ -23,7 +23,7 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIStackSelectFrame extends MICommand
{
public MIStackSelectFrame(int frameNum) {
super("-stack-select-frame", new String[]{Integer.toString(frameNum)}); //$NON-NLS-1$
public MIStackSelectFrame(String miVersion, int frameNum) {
super(miVersion, "-stack-select-frame", new String[]{Integer.toString(frameNum)}); //$NON-NLS-1$
}
}

View file

@ -21,7 +21,7 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MITargetDetach extends MICommand
{
public MITargetDetach() {
super("-target-detach"); //$NON-NLS-1$
public MITargetDetach(String miVersion) {
super(miVersion, "-target-detach"); //$NON-NLS-1$
}
}

View file

@ -28,7 +28,7 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MITargetDownload extends MICommand
{
public MITargetDownload() {
super("-target-download"); //$NON-NLS-1$
public MITargetDownload(String miVersion) {
super(miVersion, "-target-download"); //$NON-NLS-1$
}
}

View file

@ -33,7 +33,7 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MITargetSelect extends MICommand
{
public MITargetSelect(String[] params) {
super("-target-select", params); //$NON-NLS-1$
public MITargetSelect(String miVersion, String[] params) {
super(miVersion, "-target-select", params); //$NON-NLS-1$
}
}

View file

@ -26,8 +26,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIThreadListIdsInfo;
*/
public class MIThreadListIds extends MICommand
{
public MIThreadListIds() {
super("-thread-list-ids"); //$NON-NLS-1$
public MIThreadListIds(String miVersion) {
super(miVersion, "-thread-list-ids"); //$NON-NLS-1$
}
public MIThreadListIdsInfo getMIThreadListIdsInfo() throws MIException {

View file

@ -26,8 +26,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIThreadSelectInfo;
*/
public class MIThreadSelect extends MICommand
{
public MIThreadSelect(int threadNum) {
super("-thread-select", new String[]{Integer.toString(threadNum)}); //$NON-NLS-1$
public MIThreadSelect(String miVersion, int threadNum) {
super(miVersion, "-thread-select", new String[]{Integer.toString(threadNum)}); //$NON-NLS-1$
}
public MIThreadSelectInfo getMIThreadSelectInfo() throws MIException {

View file

@ -21,7 +21,7 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIVarAssign extends MICommand
{
public MIVarAssign(String name, String expression) {
super("-var-assign", new String[]{name, expression}); //$NON-NLS-1$
public MIVarAssign(String miVersion, String name, String expression) {
super(miVersion, "-var-assign", new String[]{name, expression}); //$NON-NLS-1$
}
}

View file

@ -47,16 +47,16 @@ import org.eclipse.cdt.debug.mi.core.output.MIVarCreateInfo;
*/
public class MIVarCreate extends MICommand
{
public MIVarCreate(String expression) {
this("-", "*", expression); //$NON-NLS-1$ //$NON-NLS-2$
public MIVarCreate(String miVersion, String expression) {
this(miVersion, "-", "*", expression); //$NON-NLS-1$ //$NON-NLS-2$
}
public MIVarCreate(String name, String expression) {
this(name, "*", expression); //$NON-NLS-1$
public MIVarCreate(String miVersion, String name, String expression) {
this(miVersion, name, "*", expression); //$NON-NLS-1$
}
public MIVarCreate(String name, String frameAddr, String expression) {
super("-var-create", new String[]{name, frameAddr, expression}); //$NON-NLS-1$
public MIVarCreate(String miVersion, String name, String frameAddr, String expression) {
super(miVersion, "-var-create", new String[]{name, frameAddr, expression}); //$NON-NLS-1$
}
public MIVarCreateInfo getMIVarCreateInfo() throws MIException {

View file

@ -27,8 +27,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIVarDeleteInfo;
*/
public class MIVarDelete extends MICommand
{
public MIVarDelete(String name) {
super("-var-delete", new String[]{name}); //$NON-NLS-1$
public MIVarDelete(String miVersion, String name) {
super(miVersion, "-var-delete", new String[]{name}); //$NON-NLS-1$
}
public MIVarDeleteInfo getMIVarDeleteInfo() throws MIException {

View file

@ -28,8 +28,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIVarEvaluateExpressionInfo;
*
*/
public class MIVarEvaluateExpression extends MICommand {
public MIVarEvaluateExpression(String expression) {
super("-var-evaluate-expression", new String[] { expression }); //$NON-NLS-1$
public MIVarEvaluateExpression(String miVersion, String expression) {
super(miVersion, "-var-evaluate-expression", new String[] { expression }); //$NON-NLS-1$
}
public MIVarEvaluateExpressionInfo getMIVarEvaluateExpressionInfo()

View file

@ -29,8 +29,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIVarInfoExpressionInfo;
*/
public class MIVarInfoExpression extends MICommand
{
public MIVarInfoExpression(String name) {
super("-var-info-expression", new String[]{name}); //$NON-NLS-1$
public MIVarInfoExpression(String miVersion, String name) {
super(miVersion, "-var-info-expression", new String[]{name}); //$NON-NLS-1$
}
public MIVarInfoExpressionInfo getMIVarInfoExpressionInfo() throws MIException {

View file

@ -27,8 +27,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIVarInfoNumChildrenInfo;
*/
public class MIVarInfoNumChildren extends MICommand
{
public MIVarInfoNumChildren(String name) {
super("-var-info-num-children", new String[]{name}); //$NON-NLS-1$
public MIVarInfoNumChildren(String miVersion, String name) {
super(miVersion, "-var-info-num-children", new String[]{name}); //$NON-NLS-1$
}
public MIVarInfoNumChildrenInfo getMIVarInfoNumChildrenInfo() throws MIException {

View file

@ -28,8 +28,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIVarInfoTypeInfo;
*/
public class MIVarInfoType extends MICommand
{
public MIVarInfoType(String name) {
super("-var-info-type", new String[]{name}); //$NON-NLS-1$
public MIVarInfoType(String miVersion, String name) {
super(miVersion, "-var-info-type", new String[]{name}); //$NON-NLS-1$
}
public MIVarInfoTypeInfo getMIVarInfoTypeInfo() throws MIException {

View file

@ -28,8 +28,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIVarListChildrenInfo;
*/
public class MIVarListChildren extends MICommand
{
public MIVarListChildren(String name) {
super("-var-list-children", new String[]{name}); //$NON-NLS-1$
public MIVarListChildren(String miVersion, String name) {
super(miVersion, "-var-list-children", new String[]{name}); //$NON-NLS-1$
}
public MIVarListChildrenInfo getMIVarListChildrenInfo() throws MIException {

View file

@ -28,8 +28,8 @@ import org.eclipse.cdt.debug.mi.core.MIFormat;
*/
public class MIVarSetFormat extends MICommand
{
public MIVarSetFormat(String name, int fmt) {
super("-var-set-format"); //$NON-NLS-1$
public MIVarSetFormat(String miVersion, String name, int fmt) {
super(miVersion, "-var-set-format"); //$NON-NLS-1$
String format = "hexadecimal"; //$NON-NLS-1$
switch (fmt) {
case MIFormat.NATURAL:

View file

@ -29,8 +29,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIVarShowAttributesInfo;
*/
public class MIVarShowAttributes extends MICommand
{
public MIVarShowAttributes(String name) {
super("-var-show-attributes", new String[]{name}); //$NON-NLS-1$
public MIVarShowAttributes(String miVersion, String name) {
super(miVersion, "-var-show-attributes", new String[]{name}); //$NON-NLS-1$
}
public MIVarShowAttributesInfo getMIVarShowAttributesInfo() throws MIException {

View file

@ -23,7 +23,7 @@ package org.eclipse.cdt.debug.mi.core.command;
*/
public class MIVarShowFormat extends MICommand
{
public MIVarShowFormat(String name) {
super("-var-show-format", new String[]{name}); //$NON-NLS-1$
public MIVarShowFormat(String miVersion, String name) {
super(miVersion, "-var-show-format", new String[]{name}); //$NON-NLS-1$
}
}

View file

@ -27,12 +27,12 @@ import org.eclipse.cdt.debug.mi.core.output.MIVarUpdateInfo;
*/
public class MIVarUpdate extends MICommand {
public MIVarUpdate() {
this("*"); //$NON-NLS-1$
public MIVarUpdate(String miVersion) {
this(miVersion, "*"); //$NON-NLS-1$
}
public MIVarUpdate(String name) {
super("-var-update", new String[] { name }); //$NON-NLS-1$
public MIVarUpdate(String miVersion, String name) {
super(miVersion, "-var-update", new String[] { name }); //$NON-NLS-1$
}
public MIVarUpdateInfo getMIVarUpdateInfo() throws MIException {

View file

@ -26,11 +26,11 @@ info program
(gdb)
*/
public class MIInfoProgramInfo extends MIInfo {
public class CLIInfoProgramInfo extends MIInfo {
int pid;
public MIInfoProgramInfo(MIOutput out) {
public CLIInfoProgramInfo(MIOutput out) {
super(out);
parse();
}

View file

@ -16,7 +16,7 @@ import java.util.List;
/**
*
*/
public class MIInfoSharedLibraryInfo extends MIInfo {
public class CLIInfoSharedLibraryInfo extends MIInfo {
MIShared[] shared;
boolean isUnixFormat = true;
@ -26,7 +26,7 @@ public class MIInfoSharedLibraryInfo extends MIInfo {
private boolean isHPUXFormat;
static String mergestr=null;
public MIInfoSharedLibraryInfo(MIOutput out) {
public CLIInfoSharedLibraryInfo(MIOutput out) {
super(out);
parse();
}

View file

@ -28,11 +28,11 @@ import java.util.StringTokenizer;
~"SIGABRT Yes\tYes\tYes\t\tAborted\n"
~"SIGEMT Yes\tYes\tYes\t\tEmulation trap\n"
*/
public class MIInfoSignalsInfo extends MIInfo {
public class CLIInfoSignalsInfo extends MIInfo {
MISigHandle[] signals;
public MIInfoSignalsInfo(MIOutput out) {
public CLIInfoSignalsInfo(MIOutput out) {
super(out);
parse();
}

Some files were not shown because too many files have changed in this diff Show more