diff options
author | Alain Magloire | 2002-07-26 23:46:25 +0000 |
---|---|---|
committer | Alain Magloire | 2002-07-26 23:46:25 +0000 |
commit | 8d3f439caf647904121dca17877eb3356a8b993f (patch) | |
tree | b35fac49894c4888a98428b3be44ae2f6dd7f0ee | |
parent | c5bb4d2bde13086486f273b48c5849805eec06f0 (diff) | |
download | org.eclipse.cdt-8d3f439caf647904121dca17877eb3356a8b993f.tar.gz org.eclipse.cdt-8d3f439caf647904121dca17877eb3356a8b993f.tar.xz org.eclipse.cdt-8d3f439caf647904121dca17877eb3356a8b993f.zip |
a first approach to GDB/MI
23 files changed, 510 insertions, 0 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIException.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIException.java new file mode 100644 index 00000000000..8adbb48955b --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIException.java @@ -0,0 +1,28 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IStatus; + +/** + * + * A checked exception representing a failure. + * + * @author Mikhail Khodjaiants + * @since Jul 11, 2002 + */ +public class MIException extends CoreException +{ + /** + * Constructor for MIException. + */ + public MIException( IStatus status ) + { + super( status ); + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java new file mode 100644 index 00000000000..692638a28c4 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java @@ -0,0 +1,34 @@ +package org.eclipse.cdt.debug.mi.core; + +import org.eclipse.core.runtime.IPluginDescriptor; +import org.eclipse.core.runtime.Plugin; + +/** + * @author alain + * + * To change this generated comment edit the template variable "typecomment": + * Window>Preferences>Java>Templates. + * To enable and disable the creation of type comments go to + * Window>Preferences>Java>Code Generation. + */ +public class MIPlugin extends Plugin { + + //The shared instance. + private static MIPlugin plugin; + + /** + * The constructor. + */ + public MIPlugin(IPluginDescriptor descriptor) { + super(descriptor); + plugin = this; + } + + /** + * Returns the shared instance. + */ + public static MIPlugin getDefault() { + return plugin; + } +} + diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CLICommand.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CLICommand.java new file mode 100644 index 00000000000..eb98f9b0d70 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CLICommand.java @@ -0,0 +1,31 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * Represents a CLI command. + * + * @author Mikhail Khodjaiants + * @since Jul 11, 2002 + */ +public class CLICommand extends Command +{ + /** + * Returns the text representation of this command. + * + * @return the text representation of this command + */ + public String getToken() { + return ""; + } + + public String toString(){ + return ""; + } + +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/Command.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/Command.java new file mode 100644 index 00000000000..b0830ab45a8 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/Command.java @@ -0,0 +1,26 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * A base class for all mi requests. + * + * @author Mikhail Khodjaiants + * @since Jul 11, 2002 + */ +public abstract class Command +{ + /** + * Returns the identifier of this request. + * + * @return the identifier of this request + */ + public abstract String getToken(); + + public abstract String toString(); +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MICommand.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MICommand.java new file mode 100644 index 00000000000..d5e07d8b953 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MICommand.java @@ -0,0 +1,54 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * Represents a MI command. + * + * @author Mikhail Khodjaiants + * @since Jul 11, 2002 + */ +public class MICommand extends Command +{ + /** + * Returns the operation of this command. + * + * @return the operation of this command + */ + public String getOperation() { + return ""; + } + + /** + * Returns an array of command's options. An empty collection is + * returned if there are no options. + * + * @return an array of command's options + */ + public String[] getOptions() { + return new String[0]; + } + + /** + * Returns an array of command's parameters. An empty collection is + * returned if there are no parameters. + * + * @return an array of command's parameters + */ + public String[] getParameters() { + return new String[0]; + } + + public String toString() { + return ""; + } + + public String getToken() { + return ""; + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIRequestManager.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIRequestManager.java new file mode 100644 index 00000000000..75bddd749d3 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIRequestManager.java @@ -0,0 +1,28 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +import org.eclipse.cdt.debug.mi.core.MIException; + +/** + * + * Allows clients to communicate with the debug engine by posting + * MI requests. + * + * @author Mikhail Khodjaiants + * @since Jul 11, 2002 + */ +public interface MIRequestManager +{ + /** + * Posts request to the debug engine. + * + * @param request - the request to post + * @throws MIException if this method fails. Reasons include: + */ + void postRequest (Command request) throws MIException; +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIAsyncRecord.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIAsyncRecord.java new file mode 100644 index 00000000000..998b1d46d16 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIAsyncRecord.java @@ -0,0 +1,20 @@ +package org.eclipse.cdt.debug.mi.core.output; + +/** + * @author alain + * + * To change this generated comment edit the template variable "typecomment": + * Window>Preferences>Java>Templates. + * To enable and disable the creation of type comments go to + * Window>Preferences>Java>Code Generation. + */ +public class MIAsyncRecord extends MIOOBRecord { + + /** + * @see org.eclipse.cdt.debug.mi.core.MIOutput#interpret() + */ + public boolean interpret() { + return super.interpret(); + } + +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIConsoleStreamOutput.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIConsoleStreamOutput.java new file mode 100644 index 00000000000..a3b970fc14f --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIConsoleStreamOutput.java @@ -0,0 +1,20 @@ +package org.eclipse.cdt.debug.mi.core.output; + +/** + * @author alain + * + * To change this generated comment edit the template variable "typecomment": + * Window>Preferences>Java>Templates. + * To enable and disable the creation of type comments go to + * Window>Preferences>Java>Code Generation. + */ +public class MIConsoleStreamOutput extends MIStreamRecord { + + /** + * @see org.eclipse.cdt.debug.mi.core.MIOutput#interpret() + */ + public boolean interpret() { + return super.interpret(); + } + +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIConst.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIConst.java new file mode 100644 index 00000000000..febdfa2b0be --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIConst.java @@ -0,0 +1,13 @@ +package org.eclipse.cdt.debug.mi.core.output; + +/** + * @author alain + * + * To change this generated comment edit the template variable "typecomment": + * Window>Preferences>Java>Templates. + * To enable and disable the creation of type comments go to + * Window>Preferences>Java>Code Generation. + */ +public class MIConst extends MIValue { + +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIExecAsyncOutput.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIExecAsyncOutput.java new file mode 100644 index 00000000000..e9991d5b0dd --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIExecAsyncOutput.java @@ -0,0 +1,20 @@ +package org.eclipse.cdt.debug.mi.core.output; + +/** + * @author alain + * + * To change this generated comment edit the template variable "typecomment": + * Window>Preferences>Java>Templates. + * To enable and disable the creation of type comments go to + * Window>Preferences>Java>Code Generation. + */ +public class MIExecAsyncOutput extends MIAsyncRecord { + + /** + * @see org.eclipse.cdt.debug.mi.core.MIOutput#interpret() + */ + public boolean interpret() { + return super.interpret(); + } + +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIList.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIList.java new file mode 100644 index 00000000000..04c7a5c933d --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIList.java @@ -0,0 +1,13 @@ +package org.eclipse.cdt.debug.mi.core.output; + +/** + * @author alain + * + * To change this generated comment edit the template variable "typecomment": + * Window>Preferences>Java>Templates. + * To enable and disable the creation of type comments go to + * Window>Preferences>Java>Code Generation. + */ +public class MIList extends MIValue { + +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MILogStreamOutput.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MILogStreamOutput.java new file mode 100644 index 00000000000..c6fd9e90dab --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MILogStreamOutput.java @@ -0,0 +1,20 @@ +package org.eclipse.cdt.debug.mi.core.output; + +/** + * @author alain + * + * To change this generated comment edit the template variable "typecomment": + * Window>Preferences>Java>Templates. + * To enable and disable the creation of type comments go to + * Window>Preferences>Java>Code Generation. + */ +public class MILogStreamOutput extends MIStreamRecord { + + /** + * @see org.eclipse.cdt.debug.mi.core.MIOutput#interpret() + */ + public boolean interpret() { + return super.interpret(); + } + +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MINotifyAsyncOutput.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MINotifyAsyncOutput.java new file mode 100644 index 00000000000..0be64748986 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MINotifyAsyncOutput.java @@ -0,0 +1,20 @@ +package org.eclipse.cdt.debug.mi.core.output; + +/** + * @author alain + * + * To change this generated comment edit the template variable "typecomment": + * Window>Preferences>Java>Templates. + * To enable and disable the creation of type comments go to + * Window>Preferences>Java>Code Generation. + */ +public class MINotifyAsyncOutput extends MIAsyncRecord { + + /** + * @see org.eclipse.cdt.debug.mi.core.MIOutput#interpret() + */ + public boolean interpret() { + return super.interpret(); + } + +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIOOBRecord.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIOOBRecord.java new file mode 100644 index 00000000000..723c552bfd9 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIOOBRecord.java @@ -0,0 +1,29 @@ +package org.eclipse.cdt.debug.mi.core.output; + +/** + * @author alain + * + * To change this generated comment edit the template variable "typecomment": + * Window>Preferences>Java>Templates. + * To enable and disable the creation of type comments go to + * Window>Preferences>Java>Code Generation. + */ +public class MIOOBRecord extends MIOutput { + + public final int ASYNC_STOPPED = 0; + + /** + * @see org.eclipse.cdt.debug.mi.core.MIOutput#interpret() + */ + public boolean interpret() { + return false; + } + + public int getAsyncType() { + return ASYNC_STOPPED; + } + + public MIResult getResult() { + return null; + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIOutput.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIOutput.java new file mode 100644 index 00000000000..07635ff5aa5 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIOutput.java @@ -0,0 +1,22 @@ +package org.eclipse.cdt.debug.mi.core.output; + +/** + * @author alain + * + * To change this generated comment edit the template variable "typecomment": + * Window>Preferences>Java>Templates. + * To enable and disable the creation of type comments go to + * Window>Preferences>Java>Code Generation. + */ +public class MIOutput { + + public static final String terminator = "(gdb)\n"; + + public boolean interpret() { + return false; + } + + public String getToken() { + return ""; + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIResult.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIResult.java new file mode 100644 index 00000000000..8b1629dd28e --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIResult.java @@ -0,0 +1,13 @@ +package org.eclipse.cdt.debug.mi.core.output; + +/** + * @author alain + * + * To change this generated comment edit the template variable "typecomment": + * Window>Preferences>Java>Templates. + * To enable and disable the creation of type comments go to + * Window>Preferences>Java>Code Generation. + */ +public abstract class MIResult { + public abstract boolean interpret(); +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIResultRecord.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIResultRecord.java new file mode 100644 index 00000000000..beda0f7008c --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIResultRecord.java @@ -0,0 +1,20 @@ +package org.eclipse.cdt.debug.mi.core.output; + +/** + * @author alain + * + * To change this generated comment edit the template variable "typecomment": + * Window>Preferences>Java>Templates. + * To enable and disable the creation of type comments go to + * Window>Preferences>Java>Code Generation. + */ +public class MIResultRecord extends MIOutput { + + /** + * @see org.eclipse.cdt.debug.mi.core.MIOutput#interpret() + */ + public boolean interpret() { + return false; + } + +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStatusAsyncOutput.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStatusAsyncOutput.java new file mode 100644 index 00000000000..650f357264f --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStatusAsyncOutput.java @@ -0,0 +1,20 @@ +package org.eclipse.cdt.debug.mi.core.output; + +/** + * @author alain + * + * To change this generated comment edit the template variable "typecomment": + * Window>Preferences>Java>Templates. + * To enable and disable the creation of type comments go to + * Window>Preferences>Java>Code Generation. + */ +public class MIStatusAsyncOutput extends MIAsyncRecord { + + /** + * @see org.eclipse.cdt.debug.mi.core.MIOutput#interpret() + */ + public boolean interpret() { + return super.interpret(); + } + +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStreamRecord.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStreamRecord.java new file mode 100644 index 00000000000..d639be34e1f --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStreamRecord.java @@ -0,0 +1,20 @@ +package org.eclipse.cdt.debug.mi.core.output; + +/** + * @author alain + * + * To change this generated comment edit the template variable "typecomment": + * Window>Preferences>Java>Templates. + * To enable and disable the creation of type comments go to + * Window>Preferences>Java>Code Generation. + */ +public class MIStreamRecord extends MIOOBRecord { + + /** + * @see org.eclipse.cdt.debug.mi.core.MIOutput#interpret() + */ + public boolean interpret() { + return super.interpret(); + } + +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MITargetStreamOutput.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MITargetStreamOutput.java new file mode 100644 index 00000000000..d10947e12b8 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MITargetStreamOutput.java @@ -0,0 +1,20 @@ +package org.eclipse.cdt.debug.mi.core.output; + +/** + * @author alain + * + * To change this generated comment edit the template variable "typecomment": + * Window>Preferences>Java>Templates. + * To enable and disable the creation of type comments go to + * Window>Preferences>Java>Code Generation. + */ +public class MITargetStreamOutput extends MIStreamRecord { + + /** + * @see org.eclipse.cdt.debug.mi.core.MIOutput#interpret() + */ + public boolean interpret() { + return super.interpret(); + } + +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MITuple.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MITuple.java new file mode 100644 index 00000000000..ac123442481 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MITuple.java @@ -0,0 +1,13 @@ +package org.eclipse.cdt.debug.mi.core.output; + +/** + * @author alain + * + * To change this generated comment edit the template variable "typecomment": + * Window>Preferences>Java>Templates. + * To enable and disable the creation of type comments go to + * Window>Preferences>Java>Code Generation. + */ +public class MITuple extends MIValue { + +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIValue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIValue.java new file mode 100644 index 00000000000..9cb100f5a4f --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIValue.java @@ -0,0 +1,13 @@ +package org.eclipse.cdt.debug.mi.core.output; + +/** + * @author alain + * + * To change this generated comment edit the template variable "typecomment": + * Window>Preferences>Java>Templates. + * To enable and disable the creation of type comments go to + * Window>Preferences>Java>Code Generation. + */ +public class MIValue { + +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVariable.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVariable.java new file mode 100644 index 00000000000..4ff24ca9f52 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVariable.java @@ -0,0 +1,13 @@ +package org.eclipse.cdt.debug.mi.core.output; + +/** + * @author alain + * + * To change this generated comment edit the template variable "typecomment": + * Window>Preferences>Java>Templates. + * To enable and disable the creation of type comments go to + * Window>Preferences>Java>Code Generation. + */ +public class MIVariable { + +} |