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 index 692638a28c4..60a06400482 100644 --- 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 @@ -30,5 +30,11 @@ public class MIPlugin extends Plugin { public static MIPlugin getDefault() { return plugin; } -} + /** + * Create a MI Session. + */ + public MISession createSession(Process proc) { + return new MISession(proc); + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MISession.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MISession.java new file mode 100644 index 00000000000..e3eca7b3a97 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MISession.java @@ -0,0 +1,64 @@ +package org.eclipse.cdt.debug.mi.core; + +import java.io.InputStream; +import java.io.OutputStream; +import java.io.Writer; + +import org.eclipse.cdt.debug.mi.core.output.MIOutput; + + +/** + */ +public class MISession { + + Process process; + Writer consoleStreamOutput = null; + Writer targetStreamOutput = null; + Writer logStreamOutput = null; + + /** + * The constructor. + */ + MISession(Process proc) { + process = proc; + } + + /** + * Set Console Stream. + */ + public void setConsoleStreamOutput(Writer consoleOutput) { + consoleStreamOutput = consoleOutput; + } + + /** + * Set Target Stream. + */ + public void setTargetStreamOutput(Writer targetOutput) { + targetStreamOutput = targetOutput; + } + + /** + * Set Log Stream + */ + public void setLogStreamOutput(Writer logOutput) { + logStreamOutput = logOutput; + } + + MIOutput parse(String buffer) { + return null; + } + + OutputStream getSessionInputStream() { + if (process != null) { + process.getOutputStream(); + } + return null; + } + + InputStream getSessionOutputStream() { + if (process != null) { + process.getInputStream(); + } + return null; + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackInfoDepth.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackInfoDepth.java new file mode 100644 index 00000000000..3be54f2bf0c --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackInfoDepth.java @@ -0,0 +1,26 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * -stack-info-depth [ MAX-DEPTH ] + * + * Return the depth of the stack. If the integer argument MAX-DEPTH is + * specified, do not count beyond MAX-DEPTH frames. + * + */ +public class MIStackInfoDepth extends MICommand +{ + public MIStackInfoDepth() { + super("-stack-info-depth"); + } + + public MIStackInfoDepth(int maxDepth) { + super("-stack-info-depth", new String[]{Integer.toString(maxDepth)}); + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListArguments.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListArguments.java new file mode 100644 index 00000000000..d0b14fd7c92 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListArguments.java @@ -0,0 +1,46 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * -stack-list-arguments SHOW-VALUES + * [ LOW-FRAME HIGH-FRAME ] + * + * Display a list of the arguments for the frames between LOW-FRAME and + * HIGH-FRAME (inclusive). If LOW-FRAME and HIGH-FRAME are not provided, + * list the arguments for the whole call stack. + * + * The SHOW-VALUES argument must have a value of 0 or 1. A value of 0 + * means that only the names of the arguments are listed, a value of 1 + * means that both names and values of the arguments are printed. + * + */ +public class MIStackListArguments extends MICommand +{ + public MIStackListArguments(boolean showValues) { + super("-stack-list-arguments"); + if (showValues) { + setParameters(new String[]{"1"}); + } else { + setParameters(new String[]{"0"}); + } + } + + public MIStackListArguments(boolean showValues, int low, int high) { + super("-stack-list-arguments"); + String[] params = new String[3]; + if (showValues) { + params[0] = "1"; + } else { + params[0] = "0"; + } + params[1] = Integer.toString(low); + params[2] = Integer.toString(high); + setParameters(params); + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListFrames.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListFrames.java new file mode 100644 index 00000000000..6f0f9ca806d --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListFrames.java @@ -0,0 +1,47 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * -stack-list-frames [ LOW-FRAME HIGH-FRAME ] + * + * List the frames currently on the stack. For each frame it displays + * the following info: + * + * `LEVEL' + * The frame number, 0 being the topmost frame, i.e. the innermost + * function. + * + * `ADDR' + * The `$pc' value for that frame. + * + * `FUNC' + * Function name. + * + * `FILE' + * File name of the source file where the function lives. + * + * `LINE' + * Line number corresponding to the `$pc'. + * + * If invoked without arguments, this command prints a backtrace for the + * whole stack. If given two integer arguments, it shows the frames whose + * levels are between the two arguments (inclusive). If the two arguments + * are equal, it shows the single frame at the corresponding level. + * + */ +public class MIStackListFrames extends MICommand +{ + public MIStackListFrames() { + super("-stack-list-frames"); + } + + public MIStackListFrames(int low, int high) { + super("-stack-list-frames", new String[]{Integer.toString(low), Integer.toString(high)}); + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListLocals.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListLocals.java new file mode 100644 index 00000000000..dfef94e9a07 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListLocals.java @@ -0,0 +1,28 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * -stack-list-locals PRINT-VALUES + * + * Display the local variable names for the current frame. With an + * argument of 0 prints only the names of the variables, with argument of 1 + * prints also their values. + * + */ +public class MIStackListLocals extends MICommand +{ + public MIStackListLocals(boolean printValues) { + super("-stack-list-locals"); + if (printValues) { + setParameters(new String[]{"1"}); + } else { + setParameters(new String[]{"0"}); + } + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackSelectFrame.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackSelectFrame.java new file mode 100644 index 00000000000..cd96fcef664 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackSelectFrame.java @@ -0,0 +1,22 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * -stack-select-frame FRAMENUM + * + * Change the current frame. Select a different frame FRAMENUM on the + * stack. + * + */ +public class MIStackSelectFrame extends MICommand +{ + public MIStackSelectFrame(int frameNum) { + super("-stack-select-frame", new String[]{Integer.toString(frameNum)}); + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetAttach.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetAttach.java new file mode 100644 index 00000000000..9d997b5e65c --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetAttach.java @@ -0,0 +1,22 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * + * -target-attach PID | FILE + * + * Attach to a process PID or a file FILE outside of GDB. + * + */ +public class MITargetAttach extends MICommand +{ + public MITargetAttach(int pid) { + super("-target-attach", new String[]{Integer.toString(pid)}); + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetDetach.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetDetach.java new file mode 100644 index 00000000000..bcbac34dc2b --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetDetach.java @@ -0,0 +1,22 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * + * -target-detach + * + * Disconnect from the remote target. There's no output. + * + */ +public class MITargetDetach extends MICommand +{ + public MITargetDetach() { + super("-target-detach"); + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetSelect.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetSelect.java new file mode 100644 index 00000000000..50465eb4079 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetSelect.java @@ -0,0 +1,34 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * -target-select TYPE PARAMETERS ... + * + * Connect GDB to the remote target. This command takes two args: + * + * `TYPE' + * The type of target, for instance `async', `remote', etc. + * + * `PARAMETERS' + * Device names, host names and the like. *Note Commands for + * managing targets: Target Commands, for more details. + * + * The output is a connection notification, followed by the address at + * which the target program is, in the following form: + * + * ^connected,addr="ADDRESS",func="FUNCTION NAME", + * args=[ARG LIST] + * + */ +public class MITargetSelect extends MICommand +{ + public MITargetSelect(String[] params) { + super("-target-select", params); + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIThreadListIds.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIThreadListIds.java new file mode 100644 index 00000000000..3d45d5c421f --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIThreadListIds.java @@ -0,0 +1,22 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * -thread-list-ids + * + * Produces a list of the currently known GDB thread ids. At the end + * of the list it also prints the total number of such threads. + * + */ +public class MIThreadListIds extends MICommand +{ + public MIThreadListIds() { + super("-thread-list-ids"); + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIThreadSelect.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIThreadSelect.java new file mode 100644 index 00000000000..6ba2e5d7bfb --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIThreadSelect.java @@ -0,0 +1,22 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * -thread-select THREADNUM + * + * Make THREADNUM the current thread. It prints the number of the new + * current thread, and the topmost frame for that thread. + * + */ +public class MIThreadSelect extends MICommand +{ + public MIThreadSelect(int threadNum) { + super("-thread-select", new String[]{Integer.toString(threadNum)}); + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarAssign.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarAssign.java new file mode 100644 index 00000000000..cf7b071720f --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarAssign.java @@ -0,0 +1,22 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * -var-assign NAME EXPRESSION + * + * Assigns the value of EXPRESSION to the variable object specified by + * NAME. The object must be `editable'. + * + */ +public class MIVarAssign extends MICommand +{ + public MIVarAssign(String name, String expression) { + super("-var-assign", new String[]{name, expression}); + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarCreate.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarCreate.java new file mode 100644 index 00000000000..06d874a67dd --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarCreate.java @@ -0,0 +1,50 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * -var-create {NAME | "-"} + * {FRAME-ADDR | "*"} EXPRESSION + * + * This operation creates a variable object, which allows the + * monitoring of a variable, the result of an expression, a memory cell or + * a CPU register. + * + * The NAME parameter is the string by which the object can be + * referenced. It must be unique. If `-' is specified, the varobj system + * will generate a string "varNNNNNN" automatically. It will be unique + * provided that one does not specify NAME on that format. The command + * fails if a duplicate name is found. + * + * The frame under which the expression should be evaluated can be + * specified by FRAME-ADDR. A `*' indicates that the current frame should + * be used. + * + * EXPRESSION is any expression valid on the current language set (must + * not begin with a `*'), or one of the following: + * + * * `*ADDR', where ADDR is the address of a memory cell + * + * * `*ADDR-ADDR' -- a memory address range (TBD) + * + * * `$REGNAME' -- a CPU register name + * + */ +public class MIVarCreate extends MICommand +{ + public MIVarCreate(String expression) { + this("-", "*", expression); + } + public MIVarCreate(String name, String expression) { + this(name, "*", expression); + } + public MIVarCreate(String name, String frameAddr, String expression) { + super("-var-name", new String[]{name, frameAddr, expression}); + } + +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarDelete.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarDelete.java new file mode 100644 index 00000000000..e3dd0c6ec5f --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarDelete.java @@ -0,0 +1,24 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * -var-delete NAME + * + * Deletes a previously created variable object and all of its children. + * + * Returns an error if the object NAME is not found. + * + */ +public class MIVarDelete extends MICommand +{ + public MIVarDelete(String name) { + super("-var-delete", new String[]{name}); + } + +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarEvaluateExpression.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarEvaluateExpression.java new file mode 100644 index 00000000000..40ba2de5e76 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarEvaluateExpression.java @@ -0,0 +1,25 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * -var-evaluate-expression NAME + * + * Evaluates the expression that is represented by the specified + * variable object and returns its value as a string in the current format + * specified for the object: + * + * value=VALUE + * + */ +public class MIVarEvaluateExpression extends MICommand +{ + public MIVarEvaluateExpression(String expression) { + super("-var-evaluate-expression", new String[]{expression}); + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoExpression.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoExpression.java new file mode 100644 index 00000000000..b4525e4b3fa --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoExpression.java @@ -0,0 +1,25 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * -var-info-expression NAME + * + * Returns what is represented by the variable object NAME: + * + * lang=LANG-SPEC,exp=EXPRESSION + * + * where LANG-SPEC is `{"C" | "C++" | "Java"}'. + * + */ +public class MIVarInfoExpression extends MICommand +{ + public MIVarInfoExpression(String name) { + super("-var-info-expression", new String[]{name}); + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoNumChildren.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoNumChildren.java new file mode 100644 index 00000000000..1eeedef7f62 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoNumChildren.java @@ -0,0 +1,23 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * -var-info-num-children NAME + * + * Returns the number of children of a variable object NAME: + * + * numchild=N + * + */ +public class MIVarInfoNumChildren extends MICommand +{ + public MIVarInfoNumChildren(String name) { + super("-var-info-num-children", new String[]{name}); + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoType.java new file mode 100644 index 00000000000..166bc36e865 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoType.java @@ -0,0 +1,24 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * -var-info-type NAME + * + * Returns the type of the specified variable NAME. The type is + * returned as a string in the same format as it is output by the GDB CLI: + * + * type=TYPENAME + * + */ +public class MIVarInfoType extends MICommand +{ + public MIVarInfoType(String name) { + super("-var-info-type", new String[]{name}); + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarListChildren.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarListChildren.java new file mode 100644 index 00000000000..959e2bf38f0 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarListChildren.java @@ -0,0 +1,24 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * -var-list-children NAME + * + * Returns a list of the children of the specified variable object: + * + * numchild=N,children={{name=NAME, + * numchild=N,type=TYPE},(repeats N times)} + * + */ +public class MIVarListChildren extends MICommand +{ + public MIVarListChildren(String name) { + super("-var-list-children", new String[]{name}); + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarSetFormat.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarSetFormat.java new file mode 100644 index 00000000000..4221d0102e6 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarSetFormat.java @@ -0,0 +1,56 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * -var-set-format NAME FORMAT-SPEC + * + * Sets the output format for the value of the object NAME to be + * FORMAT-SPEC. + * + * The syntax for the FORMAT-SPEC is as follows: + * + * FORMAT-SPEC ==> + * {binary | decimal | hexadecimal | octal | natural} + * + */ +public class MIVarSetFormat extends MICommand +{ + public final static int HEXADECIMAL = 0; + public final static int OCTAL = 1; + public final static int BINARY = 2; + public final static int DECIMAL = 3; +// public final static int RAW = 4; + public final static int NATURAL = 5; + + public MIVarSetFormat(String name, int fmt) { + super("-var-set-format"); + String format = "hexadecimal"; + switch (fmt) { + case NATURAL: + format = "natural"; + break; + case DECIMAL: + format = "decimal"; + break; + case BINARY: + format = "binary"; + break; + case OCTAL: + format = "octal"; + break; + /* + case HEXADECIMAL: + default: + format = "x"; + break; + */ + } + setParameters(new String[]{name, format}); + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarShowAttributes.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarShowAttributes.java new file mode 100644 index 00000000000..2c8b7d40851 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarShowAttributes.java @@ -0,0 +1,25 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * -var-show-attributes NAME + * + * List attributes of the specified variable object NAME: + * + * status=ATTR [ ( ,ATTR )* ] + * + * where ATTR is `{ { editable | noneditable } | TBD }'. + * + */ +public class MIVarShowAttributes extends MICommand +{ + public MIVarShowAttributes(String name) { + super("-var-show-attributes", new String[]{name}); + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarShowFormat.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarShowFormat.java new file mode 100644 index 00000000000..72d6a14c089 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarShowFormat.java @@ -0,0 +1,24 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * -var-show-format NAME + * + * Returns the format used to display the value of the object NAME. + * + * FORMAT ==> + * FORMAT-SPEC + * + */ +public class MIVarShowFormat extends MICommand +{ + public MIVarShowFormat(String name) { + super("-var-show-format", new String[]{name}); + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarUpdate.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarUpdate.java new file mode 100644 index 00000000000..91619ed2e27 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarUpdate.java @@ -0,0 +1,26 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ + +package org.eclipse.cdt.debug.mi.core.command; + +/** + * + * -var-update {NAME | "*"} + * + * Update the value of the variable object NAME by evaluating its + * expression after fetching all the new values from memory or registers. + * A `*' causes all existing variable objects to be updated. + * + */ +public class MIVarUpdate extends MICommand +{ + public MIVarUpdate() { + this("*"); + } + public MIVarUpdate(String name) { + super("-var-update", new String[]{name}); + } +}