diff options
Diffstat (limited to 'debug/org.eclipse.cdt.debug.mi.core/mi/org')
225 files changed, 0 insertions, 16143 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/CLIProcessor.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/CLIProcessor.java deleted file mode 100644 index 7fd44d4b150..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/CLIProcessor.java +++ /dev/null @@ -1,222 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core; - -import org.eclipse.cdt.debug.mi.core.command.CLICommand; -import org.eclipse.cdt.debug.mi.core.command.MIInterpreterExecConsole; -import org.eclipse.cdt.debug.mi.core.event.MIBreakpointChangedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIDetachedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIEvent; -import org.eclipse.cdt.debug.mi.core.event.MIRunningEvent; -import org.eclipse.cdt.debug.mi.core.event.MISignalChangedEvent; - -/** - * Transmission command thread blocks on the command Queue - * and wake cmd are available and push them to gdb out channel. - */ -public class CLIProcessor { - - MISession session; - - public CLIProcessor(MISession s) { - session = s; - } - - /** - * An attempt to discover the command type and - * fire an event if necessary. - */ - void processStateChanges(CLICommand cmd) { - String operation = cmd.getOperation().trim(); - processStateChanges(cmd.getToken(), operation); - } - - void processStateChanges(MIInterpreterExecConsole exec) { - String[] operations = exec.getParameters(); - if (operations != null && operations.length > 0) { - processStateChanges(exec.getToken(), operations[0]); - } - } - - void processStateChanges(int token, String operation) { - // Get the command name. - int indx = operation.indexOf(' '); - if (indx != -1) { - operation = operation.substring(0, indx).trim(); - } else { - operation = operation.trim(); - } - - // Check the type of command - - int type = getSteppingOperationKind(operation); - if (type != -1) { - // if it was a step instruction set state running - session.getMIInferior().setRunning(); - MIEvent event = new MIRunningEvent(session, token, type); - session.fireEvent(event); - } - } - - /** - * An attempt to discover the command type and - * fire an event if necessary. - */ - void processSettingChanges(CLICommand cmd) { - String operation = cmd.getOperation().trim(); - processSettingChanges(cmd.getToken(), operation); - } - - void processSettingChanges(MIInterpreterExecConsole exec) { - String[] operations = exec.getParameters(); - if (operations != null && operations.length > 0) { - processSettingChanges(exec.getToken(), operations[0]); - } - } - - void processSettingChanges(int token, String operation) { - // Get the command name. - int indx = operation.indexOf(' '); - if (indx != -1) { - operation = operation.substring(0, indx).trim(); - } else { - operation = operation.trim(); - } - - // Check the type of command - - if (isSettingBreakpoint(operation) || - isSettingWatchpoint(operation) || - isChangeBreakpoint(operation) || - isDeletingBreakpoint(operation)) { - // We know something change, we just do not know what. - // So the easiest way is to let the top layer handle it. - session.fireEvent(new MIBreakpointChangedEvent(session, 0)); - } else if (isSettingSignal(operation)) { - // We do no know which signal let the upper layer find it. - session.fireEvent(new MISignalChangedEvent(session, "")); //$NON-NLS-1$ - } else if (isDetach(operation)) { - // if it was a "detach" command change the state. - session.getMIInferior().setDisconnected(); - MIEvent event = new MIDetachedEvent(session, token); - session.fireEvent(event); - } - } - - static int getSteppingOperationKind(String operation) { - int type = -1; - /* execution commands: n, next, s, step, si, stepi, u, until, finish, - c, continue, fg */ - if (operation.equals("n") || operation.equals("next")) { //$NON-NLS-1$ //$NON-NLS-2$ - type = MIRunningEvent.NEXT; - } else if (operation.equals("ni") || operation.equals("nexti")) { //$NON-NLS-1$ //$NON-NLS-2$ - type = MIRunningEvent.NEXTI; - } else if (operation.equals("s") || operation.equals("step")) { //$NON-NLS-1$ //$NON-NLS-2$ - type = MIRunningEvent.STEP; - } else if (operation.equals("si") || operation.equals("stepi")) { //$NON-NLS-1$ //$NON-NLS-2$ - type = MIRunningEvent.STEPI; - } else if (operation.equals("u") || //$NON-NLS-1$ - (operation.startsWith("unt") && "until".indexOf(operation) != -1)) { //$NON-NLS-1$ //$NON-NLS-2$ - type = MIRunningEvent.UNTIL; - } else if (operation.startsWith("fin") && "finish".indexOf(operation) != -1) { //$NON-NLS-1$ //$NON-NLS-2$ - type = MIRunningEvent.FINISH; - } else if (operation.equals("c") || operation.equals("fg") || //$NON-NLS-1$ //$NON-NLS-2$ - (operation.startsWith("cont") && "continue".indexOf(operation) != -1)) { //$NON-NLS-1$ //$NON-NLS-2$ - type = MIRunningEvent.CONTINUE; - } else if (operation.startsWith("sig") && "signal".indexOf(operation) != -1) { //$NON-NLS-1$ //$NON-NLS-2$ - type = MIRunningEvent.CONTINUE; - } else if (operation.startsWith("j") && "jump".indexOf(operation) != -1) { //$NON-NLS-1$ //$NON-NLS-2$ - type = MIRunningEvent.CONTINUE; - } else if (operation.equals("r") || operation.equals("run")) { //$NON-NLS-1$ //$NON-NLS-2$ - type = MIRunningEvent.CONTINUE; - } - return type; - } - - /** - * Return true if the operation is a stepping operation. - * - * @param operation - * @return - */ - public static boolean isSteppingOperation(String operation) { - int type = getSteppingOperationKind(operation); - return type != -1; - } - - boolean isSettingBreakpoint(String operation) { - boolean isbreak = false; - /* breakpoints: b, break, hbreak, tbreak, rbreak, thbreak */ - /* watchpoints: watch, rwatch, awatch, tbreak, rbreak, thbreak */ - if ((operation.startsWith("b") && "break".indexOf(operation) != -1) || //$NON-NLS-1$ //$NON-NLS-2$ - (operation.startsWith("tb") && "tbreak".indexOf(operation) != -1) || //$NON-NLS-1$ //$NON-NLS-2$ - (operation.startsWith("hb") && "hbreak".indexOf(operation) != -1) || //$NON-NLS-1$ //$NON-NLS-2$ - (operation.startsWith("thb") && "thbreak".indexOf(operation) != -1) || //$NON-NLS-1$ //$NON-NLS-2$ - (operation.startsWith("rb") && "rbreak".indexOf(operation) != -1)) { //$NON-NLS-1$ //$NON-NLS-2$ - isbreak = true; - } - return isbreak; - } - - boolean isSettingWatchpoint(String operation) { - boolean isWatch = false; - /* watchpoints: watch, rwatch, awatch, tbreak, rbreak, thbreak */ - if ((operation.startsWith("wa") && "watch".indexOf(operation) != -1) || //$NON-NLS-1$ //$NON-NLS-2$ - (operation.startsWith("rw") && "rwatch".indexOf(operation) != -1) || //$NON-NLS-1$ //$NON-NLS-2$ - (operation.startsWith("aw") && "awatch".indexOf(operation) != -1)) { //$NON-NLS-1$ //$NON-NLS-2$ - isWatch = true; - } - return isWatch; - } - - boolean isDeletingBreakpoint(String operation) { - boolean isDelete = false; - /* deleting breaks: clear, delete */ - if ((operation.startsWith("cl") && "clear".indexOf(operation) != -1) || //$NON-NLS-1$ //$NON-NLS-2$ - (operation.equals("d") || (operation.startsWith("del") && "delete".indexOf(operation) != -1))) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - isDelete = true; - } - return isDelete; - } - - boolean isChangeBreakpoint(String operation) { - boolean isChange = false; - /* changing breaks: enable, disable */ - if ((operation.equals("dis") || operation.equals("disa") || //$NON-NLS-1$ //$NON-NLS-2$ - (operation.startsWith("disa") && "disable".indexOf(operation) != -1)) || //$NON-NLS-1$ //$NON-NLS-2$ - (operation.equals("en") || (operation.startsWith("en") && "enable".indexOf(operation) != -1)) || //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - (operation.startsWith("ig") && "ignore".indexOf(operation) != -1) || //$NON-NLS-1$ //$NON-NLS-2$ - (operation.startsWith("cond") && "condition".indexOf(operation) != -1)) { //$NON-NLS-1$ //$NON-NLS-2$ - isChange = true; - } - return isChange; - } - - boolean isSettingSignal(String operation) { - boolean isChange = false; - /* changing signal: handle, signal */ - if (operation.startsWith("ha") && "handle".indexOf(operation) != -1) { //$NON-NLS-1$ //$NON-NLS-2$ - isChange = true; - } - return isChange; - } - - /** - * @param operation - * @return - */ - boolean isDetach(String operation) { - return (operation.startsWith("det") && "detach".indexOf(operation) != -1); //$NON-NLS-1$ //$NON-NLS-2$ - } - - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/CommandQueue.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/CommandQueue.java deleted file mode 100644 index df95b3fc45a..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/CommandQueue.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core; - -import org.eclipse.cdt.debug.mi.core.command.Command; - -/** - * Simple thread-safe Queue implemetation. - */ -public class CommandQueue extends Queue { - - - public CommandQueue() { - super(); - } - - public Command removeCommand(int id) { - //print("in removeCommand(" + id + ") - entering"); - synchronized (list) { - int size = list.size(); - for (int i = 0; i < size; i++) { - Command cmd = (Command)list.get(i); - int token = cmd.getToken(); - if (token == id) { - list.remove(cmd); - return cmd; - } - } - } - return null; - } - - public Command removeCommand() throws InterruptedException { - //print("in removeCommand() - entering"); - return (Command)removeItem(); - } - - public void addCommand(Command cmd) { - //print("in addCommand() - entering"); - addItem(cmd); - } - - public Command[] clearCommands() { - Object[] objs = clearItems(); - Command[] cmds = new Command[objs.length]; - System.arraycopy(objs, 0, cmds, 0, objs.length); - return cmds; - } - -// private static void print(String msg) { -// String name = Thread.currentThread().getName(); -// System.out.println(name + ": " + msg); -// } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/CoreProcess.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/CoreProcess.java deleted file mode 100644 index 55572103642..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/CoreProcess.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2002, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -/* - * CoreProcess - */ -public class CoreProcess extends Process { - - /* (non-Javadoc) - * @see java.lang.Process#exitValue() - */ - public int exitValue() { - return 0; - } - - /* (non-Javadoc) - * @see java.lang.Process#waitFor() - */ - public int waitFor() throws InterruptedException { - return 0; - } - - /* (non-Javadoc) - * @see java.lang.Process#destroy() - */ - public void destroy() { - } - - /* (non-Javadoc) - * @see java.lang.Process#getErrorStream() - */ - public InputStream getErrorStream() { - return new InputStream() { - public int read() throws IOException { - return -1; - } - }; - } - - /* (non-Javadoc) - * @see java.lang.Process#getInputStream() - */ - public InputStream getInputStream() { - return new InputStream() { - public int read() throws IOException { - return -1; - } - }; - } - - /* (non-Javadoc) - * @see java.lang.Process#getOutputStream() - */ - public OutputStream getOutputStream() { - return new OutputStream() { - public void write(int b) throws IOException { - } - }; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/EventThread.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/EventThread.java deleted file mode 100644 index ac432c45455..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/EventThread.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core; - -import org.eclipse.cdt.debug.mi.core.event.MIEvent; -import org.eclipse.cdt.debug.mi.core.event.MIStoppedEvent; - -/** - * Event Thread blocks on the event Queue, wakes up - * when events are available and notify all the observers. - */ -public class EventThread extends Thread { - - MISession session; - - public EventThread(MISession s) { - super("MI Event Thread"); //$NON-NLS-1$ - session = s; - } - - public void run() { - // Signal by the session of time to die. - while (session.getChannelOutputStream() != null) { - MIEvent event = null; - Queue eventQueue = session.getEventQueue(); - // removeItem() will block until an item is available. - try { - event = (MIEvent) eventQueue.removeItem(); - } catch (InterruptedException e) { - //e.printStackTrace(); - } - if (event instanceof MIStoppedEvent) { - processSuspendedEvent((MIStoppedEvent)event); - } - try { - if (event != null) { - session.notifyObservers(event); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - void processSuspendedEvent(MIStoppedEvent stopped) { - // give a chance also to the underlying inferior. - session.getMIInferior().update(); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/GDBTypeParser.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/GDBTypeParser.java deleted file mode 100644 index 7dc492a1e8d..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/GDBTypeParser.java +++ /dev/null @@ -1,580 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - * Matthias Spycher (matthias@coware.com) - bug 124966 - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core; - -import java.util.regex.Pattern; - -/** - * GDB Type Parser. - * The code was lifted from: The C Programming Language - * B. W. Kernighan and D. Ritchie - */ -public class GDBTypeParser { - - // GDB type parsing from whatis command - // declarator: type dcl - // type: (name)+ - // dcl: ('*' | '&')* direct-decl - // direct-dcl: '(' dcl ')' - // direct-dcl '(' ')' - // direct-dcl '[' integer ']' - // name: ([a-zA-z][0-9])+ - // integer ([0-9)+ - - final static int EOF = -1; - final static int NAME = 0; - final static int PARENS = 1; - final static int BRACKETS = 2; - - String line; - int index; - int tokenType; - String token; - String dataType; - String name; - GDBDerivedType gdbDerivedType; - GDBType genericType; - - public GDBType getGDBType() { - if (gdbDerivedType != null) { - return gdbDerivedType; - } - return genericType; - } - - public String getVariableName() { - return name; - } - - public GDBType parse(String s) { - // Sanity. - if (s == null) { - s = new String(); - } - s = Pattern.compile("\\bconst\\b").matcher(s).replaceAll(""); //$NON-NLS-1$//$NON-NLS-2$ - s = Pattern.compile("\\bvolatile\\b").matcher(s).replaceAll(""); //$NON-NLS-1$//$NON-NLS-2$ - s = s.trim(); - - // Initialize. - line = s; - index = 0; - tokenType = -1; - token = ""; //$NON-NLS-1$ - dataType = ""; //$NON-NLS-1$ - name = ""; //$NON-NLS-1$ - gdbDerivedType = null; - genericType = null; - - // Fetch the datatype. - while (getToken() == NAME) { - dataType += " " + token; //$NON-NLS-1$ - } - - // Hack for GDB, the typename can be something like - // class A : public B, C { ... } * - // We are only interested in "class A" - // Carefull for class A::data or class ns::A<ns::data> - int column = dataType.indexOf(':'); - while (column > 0) { - if ((column + 2) < dataType.length() && dataType.charAt(column + 1) == ':') { - column = dataType.indexOf(':', column+2); - continue; - } - dataType = dataType.substring(0, column); - break; - } - genericType = new GDBType(dataType); - - // Start the recursive parser. - dcl(tokenType); - return getGDBType(); - } - - public static String unParse (GDBType gdbType) { - - StringBuffer sb = new StringBuffer(); - // Fetch the datatype. - while (gdbType != null) { - GDBDerivedType derived = null; - int type = gdbType.getType(); - if (gdbType instanceof GDBDerivedType) { - derived = (GDBDerivedType)gdbType; - gdbType = derived.getChild(); - // respect the precedence of operators. - if (type == GDBType.FUNCTION) { - sb.append("()"); //$NON-NLS-1$ - } else if (type == GDBType.ARRAY) { - sb.append('[').append(derived.getDimension()).append(']'); - } else if (type == GDBType.POINTER) { - int childType = (gdbType != null) ? gdbType.getType() : GDBType.GENERIC; - if (childType == GDBType.POINTER || childType == GDBType.REFERENCE) { - sb.append('*'); - } else if (childType == GDBType.GENERIC) { - sb.insert(0, '*'); - } else { - sb.insert(0, "(*").append(')'); //$NON-NLS-1$ - } - } else if (type == GDBType.REFERENCE) { - int childType = (gdbType != null) ? gdbType.getType() : GDBType.GENERIC; - if (childType == GDBType.POINTER || childType == GDBType.REFERENCE) { - sb.append("&"); //$NON-NLS-1$ - } else if (childType == GDBType.GENERIC) { - sb.insert(0, '&'); - } else { - sb.insert(0, "(&").append(')'); //$NON-NLS-1$ - } - } - } else { - sb.insert(0, ' '); - sb.insert(0, gdbType.nameType); - gdbType = null; - } - } - return sb.toString().trim(); - - } - - public class GDBType { - public final static int GENERIC = 0; - public final static int POINTER = 1; - public final static int REFERENCE = 2; - public final static int ARRAY = 3; - public final static int FUNCTION = 4; - - String nameType; - int type; - - public GDBType(String n) { - this(n, 0); - } - - public GDBType(int t) { - this("", t); //$NON-NLS-1$ - } - - public GDBType(String n, int t) { - nameType = n; - type = t; - } - - public String toString() { - return unParse(this); - } - - public String verbose() { - return nameType; - } - - public int getType() { - return type; - } - - public String getTypeName() { - return nameType; - } - } - - public class GDBDerivedType extends GDBType { - int dimension; - GDBType child; - - public GDBDerivedType(GDBType c, int i) { - this(c, i, 0); - } - - public GDBDerivedType(GDBType c, int t, int dim) { - super(t); - setChild(c); - dimension = dim; - } - - public int getDimension() { - return dimension; - } - - public void setChild(GDBType c) { - child = c; - } - - public GDBType getChild() { - return child; - } - - public boolean hasChild() { - return child != null; - } - - public String verbose() { - StringBuffer sb = new StringBuffer(); - switch (getType()) { - case FUNCTION : - sb.append(" function returning " + (hasChild() ? child.verbose() : "")); //$NON-NLS-1$//$NON-NLS-2$ - break; - case ARRAY : - sb.append(" array[" + dimension + "]" + " of " + (hasChild() ? child.verbose() : "")); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - break; - case REFERENCE : - sb.append(" reference to " + (hasChild() ? child.verbose() : "")); //$NON-NLS-1$//$NON-NLS-2$ - break; - case POINTER : - sb.append(" pointer to " + (hasChild() ? child.verbose() : "")); //$NON-NLS-1$//$NON-NLS-2$ - break; - } - return sb.toString(); - } - } - - int getch() { - if (index >= line.length() || index < 0) { - return EOF; - } - return line.charAt(index++); - } - - void ungetch() { - if (index > 0) { - index--; - } - } - - // check if the character is an alphabet - boolean isCIdentifierStart(int c) { - if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_' || c == ':' || c == ',') { - return true; - } - return false; - } - - // check is the character is alpha numeric - // [a-zA-Z0-9] - // GDB hack accept ':' ',' part of the GDB hacks - // when doing ptype gdb returns "class A : public C { ..}" - boolean isCIdentifierPart(int c) { - if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_' || c == ':') { - return true; - } - return false; - } - - boolean isCSpace(int c) { - if (c == ' ' || c == '\t' || c == '\f' || c == '\n') { - return true; - } - return false; - } - - void insertingChild(int kind) { - insertingChild(kind, 0); - } - - void insertingChild(int kind, int d) { - if (gdbDerivedType == null) { - gdbDerivedType = new GDBDerivedType(genericType, kind, d); - } else { - GDBDerivedType dType = gdbDerivedType; - GDBType gdbType = gdbDerivedType.getChild(); - while (gdbType instanceof GDBDerivedType) { - dType = (GDBDerivedType)gdbType; - gdbType = dType.getChild(); - } - gdbType = new GDBDerivedType(gdbType, kind, d); - dType.setChild(gdbType); - } - } - - // method returns the next token - int getToken() { - token = ""; //$NON-NLS-1$ - - int c = getch(); - - // Skip over any space - while (isCSpace(c)) { - c = getch(); - } - - //char character = (char) c; - - if (c == '(') { - c = getch(); - if (c == ')') { - token = "()"; //$NON-NLS-1$ - tokenType = PARENS; - } else if (isCIdentifierStart(c)) { - int i = 0; - token += (char)c; - while (i == 0 && c != ')') { - if (c == EOF) { - // Unbalanced parantheses. - break; - } - c = getch(); - token += (char)c; - if (c == '(') { - ++i; - } else if (c == ')') { - --i; - } - } - tokenType = PARENS; - } else { - ungetch(); - tokenType = '('; - } - - - - } else if (c == '[') { - while ((c = getch()) != ']' && c != EOF) { - token += (char) c; - } - tokenType = BRACKETS; - } else if (isCIdentifierStart(c)) { - StringBuffer sb = new StringBuffer(); - sb.append((char) c); - while (isCIdentifierPart((c = getch())) && c != EOF) { - sb.append((char) c); - } - if (c == '<') { - // Swallow template args in types like "class foobar<A,B> : public C {..} *" - // FIXME: if the bracket is not terminate do we throw exception? - sb.append((char) c); - int count = 1; - do { - c = getch(); - if (c == '<') { - count++; - } else if (c == '>') { - count--; - } - if (c != ' ') { - sb.append((char)c); - } - } while (count > 0 && c != EOF); - } else if (c != EOF) { - ungetch(); - } - token = sb.toString(); - tokenType = NAME; - } else if (c == '{') { - // Swallow gdb sends things like "struct foobar {..} *" - // FIXME: if the bracket is not terminate do we throw exception? - int count = 1; - do { - c = getch(); - if (c == '{') { - count++; - } else if (c == '}') { - count--; - } - } while (count > 0 && c != EOF); - } else { - tokenType = c; - } - return tokenType; - } - - void dcl() { - dcl(getToken()); - } - - // parse a declarator - void dcl(int c) { - int nstar = 0; - int namp = 0; - if (c == '*') { - nstar++; - for (; getToken() == '*'; nstar++) { - } - } else if (c == '&') { - namp++; - for (; getToken() == '&'; namp++) { - } - } - dirdcl(); - while (nstar-- > 0) { - insertingChild(GDBType.POINTER); - } - while (namp-- > 0) { - insertingChild(GDBType.REFERENCE); - } - } - - // parse a direct declarator - void dirdcl() { - int type; - - if (tokenType == '(') { - dcl(); - if (tokenType != ')' /*&& name.length() > 0*/) { - // Do we throw an exception on unterminated parentheses - // It should have been handle by getToken() - return; - } - } else if (tokenType == NAME) { - // Useless we do not need the name of the variable - name = " " + token; //$NON-NLS-1$ - } else if (tokenType == PARENS) { - insertingChild(GDBType.FUNCTION); - } else if (tokenType == BRACKETS) { - int len = 0; - if (token.length() > 0) { - try { - len = Integer.parseInt(token); - } catch (NumberFormatException e) { - } - } - insertingChild(GDBType.ARRAY, len); - } else if (tokenType == '&') { - insertingChild(GDBType.REFERENCE); - } else { - // oops bad declaration ? - return; - } - - while ((type = getToken()) == PARENS || type == BRACKETS) { - if (type == PARENS) { - insertingChild(GDBType.FUNCTION); - } else { /* BRACKETS */ - int len = 0; - if (token.length() > 0) { - try { - len = Integer.parseInt(token); - } catch (NumberFormatException e) { - } - } - insertingChild(GDBType.ARRAY, len); - } - } - } - - public static void main(String[] args) { - - GDBTypeParser parser = new GDBTypeParser(); - - System.out.println("int *&"); //$NON-NLS-1$ - parser.parse("int *&"); //$NON-NLS-1$ - System.out.println(GDBTypeParser.unParse(parser.getGDBType())); - System.out.println(parser.getGDBType().verbose()); - System.out.println(); - - System.out.println("int (&rg)(int)"); //$NON-NLS-1$ - parser.parse("int (&rg)(int)"); //$NON-NLS-1$ - System.out.println(GDBTypeParser.unParse(parser.getGDBType())); - System.out.println(parser.getGDBType().verbose()); - System.out.println(); - - System.out.println("int (&ra)[3]"); //$NON-NLS-1$ - parser.parse("int (&rg)[3]"); //$NON-NLS-1$ - System.out.println(GDBTypeParser.unParse(parser.getGDBType())); - System.out.println(parser.getGDBType().verbose()); - System.out.println(); - - System.out.println("struct link { int i; int j; struct link * next;} *"); //$NON-NLS-1$ - parser.parse("struct link { int i; int j; struct link * next} *"); //$NON-NLS-1$ - System.out.println(GDBTypeParser.unParse(parser.getGDBType())); - System.out.println(parser.getGDBType().verbose()); - System.out.println(); - - System.out.println("class ns::link<8, ns::A> : public ns::B { int i; int j; struct link * next;} *"); //$NON-NLS-1$ - parser.parse("class ns::link<8, ns::A> : public ns::B { int i; int j; struct link * next;} *"); //$NON-NLS-1$ - System.out.println(GDBTypeParser.unParse(parser.getGDBType())); - System.out.println(parser.getGDBType().verbose()); - System.out.println(); - - System.out.println("char **argv"); //$NON-NLS-1$ - parser.parse("char **argv"); //$NON-NLS-1$ - System.out.println(GDBTypeParser.unParse(parser.getGDBType())); - System.out.println(parser.getGDBType().verbose()); - System.out.println(); - - System.out.println("int (*daytab)[13]"); //$NON-NLS-1$ - parser.parse("int (*daytab)[13]"); //$NON-NLS-1$ - System.out.println(GDBTypeParser.unParse(parser.getGDBType())); - System.out.println(parser.getGDBType().verbose()); - System.out.println(); - - System.out.println("int *daytab[13]"); //$NON-NLS-1$ - parser.parse("int *daytab[13]"); //$NON-NLS-1$ - System.out.println(GDBTypeParser.unParse(parser.getGDBType())); - System.out.println(parser.getGDBType().verbose()); - System.out.println(); - - System.out.println("void *comp()"); //$NON-NLS-1$ - parser.parse("void *comp()"); //$NON-NLS-1$ - System.out.println(GDBTypeParser.unParse(parser.getGDBType())); - System.out.println(parser.getGDBType().verbose()); - System.out.println(); - - System.out.println("void (*comp)()"); //$NON-NLS-1$ - parser.parse("void (*comp)()"); //$NON-NLS-1$ - System.out.println(GDBTypeParser.unParse(parser.getGDBType())); - System.out.println(parser.getGDBType().verbose()); - System.out.println(); - - System.out.println("int (*func[15])()"); //$NON-NLS-1$ - parser.parse("int (*func[15])()"); //$NON-NLS-1$ - System.out.println(GDBTypeParser.unParse(parser.getGDBType())); - System.out.println(parser.getGDBType().verbose()); - System.out.println(); - - System.out.println("char (*(*x())[])()"); //$NON-NLS-1$ - parser.parse("char (*(*x())[])()"); //$NON-NLS-1$ - System.out.println(GDBTypeParser.unParse(parser.getGDBType())); - System.out.println(parser.getGDBType().verbose()); - System.out.println(); - - System.out.println("char (*(*x[3])())[5]"); //$NON-NLS-1$ - parser.parse("char (*(*x[3])())[5]"); //$NON-NLS-1$ - System.out.println(GDBTypeParser.unParse(parser.getGDBType())); - System.out.println(parser.getGDBType().verbose()); - System.out.println(); - - System.out.println("char *[5]"); //$NON-NLS-1$ - parser.parse("char *[5]"); //$NON-NLS-1$ - System.out.println(GDBTypeParser.unParse(parser.getGDBType())); - System.out.println(parser.getGDBType().verbose()); - System.out.println(); - - System.out.println("int [2][3]"); //$NON-NLS-1$ - parser.parse("int [2][3]"); //$NON-NLS-1$ - System.out.println(GDBTypeParser.unParse(parser.getGDBType())); - System.out.println(parser.getGDBType().verbose()); - System.out.println(); - - System.out.println("int (int, char **)"); //$NON-NLS-1$ - parser.parse("int (int, char **)"); //$NON-NLS-1$ - System.out.println(GDBTypeParser.unParse(parser.getGDBType())); - System.out.println(parser.getGDBType().verbose()); - System.out.println(); - - System.out.println("int (int)"); //$NON-NLS-1$ - parser.parse("int (int)"); //$NON-NLS-1$ - System.out.println(GDBTypeParser.unParse(parser.getGDBType())); - System.out.println(parser.getGDBType().verbose()); - System.out.println(); - - System.out.println("int (void)"); //$NON-NLS-1$ - parser.parse("int (void)"); //$NON-NLS-1$ - System.out.println(GDBTypeParser.unParse(parser.getGDBType())); - System.out.println(parser.getGDBType().verbose()); - System.out.println(); - - System.out.println("int ()"); //$NON-NLS-1$ - parser.parse("int ()"); //$NON-NLS-1$ - System.out.println(GDBTypeParser.unParse(parser.getGDBType())); - System.out.println(parser.getGDBType().verbose()); - System.out.println(); - - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/IMITTY.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/IMITTY.java deleted file mode 100644 index 99e0d28132a..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/IMITTY.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core; - -import java.io.InputStream; -import java.io.OutputStream; - -/** - */ -public interface IMITTY { - - /** - * Returns the name of the slave to pass to gdb --tty command - * ex: --tty=/dev/pty/1 - * - * @return - */ - public String getSlaveName(); - - /** - * Returns the OutputStream of the Master. - * - * @return - */ - public OutputStream getOutputStream(); - - /** - * Returns the InputStream of the Master - * - * @return - */ - public InputStream getInputStream(); - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MIException.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MIException.java deleted file mode 100644 index 7ac50ce5c49..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MIException.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core; - -/** - * - * A checked exception representing a failure. - * - */ -public class MIException extends Exception { - /** - * - */ - private static final long serialVersionUID = 3257844402679724085L; - String log = ""; //$NON-NLS-1$ - - public MIException(String s) { - super(s); - } - - public MIException(String s, String l) { - super(s); - log = l; - } - - public String getLogMessage() { - return log; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MIFormat.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MIFormat.java deleted file mode 100644 index 0d118c392ef..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MIFormat.java +++ /dev/null @@ -1,107 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core; - -import java.math.BigInteger; - -/** - * Help class to specify formats. - */ -public final class MIFormat { - 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 final static int FLOAT = 10; - public final static int ADDRESS = 11; - public final static int INSTRUCTION = 12; - public final static int CHAR = 13; - public final static int STRING = 14; - public final static int UNSIGNED = 15; - - // no instanciation. - private MIFormat() { - } - - /** - * We are assuming that GDB will print the address in hex format - * like: - * 0xbfffe5f0 "hello" - * (int *) 0xbfffe2b8 - * - * @param buffer - * @return - */ - public static BigInteger decodeAdress(String buffer) { - int radix = 10; - int cursor = 0; - int offset = 0; - int len = buffer.length(); - - if ((offset = buffer.indexOf("0x")) != -1 || //$NON-NLS-1$ - (offset = buffer.indexOf("0X")) != -1) { //$NON-NLS-1$ - radix = 16; - cursor = offset + 2; - } - - while (cursor < len && Character.digit(buffer.charAt(cursor), radix) != -1) { - cursor++; - } - - String s = buffer.substring(offset, cursor); - return getBigInteger(s); - } - - public static BigInteger getBigInteger(String address) { - int index = 0; - int radix = 10; - boolean negative = false; - - // Handle zero length - address = address.trim(); - if (address.length() == 0) { - return BigInteger.ZERO; - } - - // Handle minus sign, if present - if (address.startsWith("-")) { //$NON-NLS-1$ - negative = true; - index++; - } - if (address.startsWith("0x", index) || address.startsWith("0X", index)) { //$NON-NLS-1$ //$NON-NLS-2$ - index += 2; - radix = 16; - } else if (address.startsWith("#", index)) { //$NON-NLS-1$ - index ++; - radix = 16; - } else if (address.startsWith("0", index) && address.length() > 1 + index) { //$NON-NLS-1$ - index ++; - radix = 8; - } - - if (index > 0) { - address = address.substring(index); - } - if (negative) { - address = "-" + address; //$NON-NLS-1$ - } - try { - return new BigInteger(address, radix); - } catch (NumberFormatException e) { - // ... - // What can we do ??? - } - return BigInteger.ZERO; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MIInferior.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MIInferior.java deleted file mode 100644 index 170228ded8c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MIInferior.java +++ /dev/null @@ -1,359 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - * Hewlett-Packard Development Company - fix for bug 109733 - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -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.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.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.CLIInfoProgramInfo; - -/** - */ -public class MIInferior extends Process { - - final static int SUSPENDED = 1; - final static int RUNNING = 2; - final static int TERMINATED = 4; - - boolean connected = false; - - boolean exitCodeKnown = false; - int exitCode = 0; - int state = 0; - - MISession session; - - OutputStream out; - InputStream in; - - PipedOutputStream inPiped; - - PipedInputStream err; - PipedOutputStream errPiped; - IMITTY tty; - - int inferiorPID; - - public MIInferior(MISession mi, IMITTY p) { - session = mi; - tty = p; - if (tty != null) { - out = tty.getOutputStream(); - in = tty.getInputStream(); - } - } - - /** - * @see java.lang.Process#getOutputStream() - */ - public OutputStream getOutputStream() { - if (out == null) { - out = new OutputStream() { - public void write(int b) throws IOException { - if (!isRunning()) { - throw new IOException(MIPlugin.getResourceString("src.MIInferior.target_is_suspended")); //$NON-NLS-1$ - } - OutputStream channel = session.getChannelOutputStream(); - if (channel == null) { - throw new IOException(MIPlugin.getResourceString("src.MIInferior.No_session")); //$NON-NLS-1$ - } - channel.write(b); - } - }; - } - return out; - } - - /** - * @see java.lang.Process#getInputStream() - */ - public InputStream getInputStream() { - if (in == null) { - try { - inPiped = new PipedOutputStream(); - in = new PipedInputStream(inPiped); - } catch (IOException e) { - } - } - return in; - } - - /** - * @see java.lang.Process#getErrorStream() - */ - public InputStream getErrorStream() { - // FIXME: We do not have any err stream from gdb/mi - // so this gdb err channel instead. - if (err == null) { - try { - errPiped = new PipedOutputStream(); - err = new PipedInputStream(errPiped); - } catch (IOException e) { - } - } - return err; - } - - public synchronized void waitForSync() throws InterruptedException { - while (state != TERMINATED) { - wait(); - } - } - - /** - * @see java.lang.Process#waitFor() - */ - public int waitFor() throws InterruptedException { - waitForSync(); - return exitValue(); - } - - /** - * @see java.lang.Process#exitValue() - */ - public int exitValue() { - if (isTerminated()) { - if (!session.isTerminated()) { - if (!exitCodeKnown) { - CommandFactory factory = session.getCommandFactory(); - MIGDBShowExitCode code = factory.createMIGDBShowExitCode(); - try { - session.postCommand(code); - MIGDBShowExitCodeInfo info = code.getMIGDBShowExitCodeInfo(); - exitCode = info.getCode(); - } catch (MIException e) { - // no rethrown. - } - exitCodeKnown = true; - } - } - return exitCode; - } - throw new IllegalThreadStateException(); - } - - /** - * @see java.lang.Process#destroy() - */ - public void destroy() { - try { - terminate(); - } catch (MIException e) { - // do nothing. - } - } - - public void terminate() throws MIException { - // An inferior will be destroy():interrupt and kill if - // - For attach session: - // the inferior was not disconnected yet (no need to try - // to kill a disconnected program). - // - For Program session: - // if the inferior was not terminated. - // - For PostMortem(Core): send event - // else noop - if ((session.isAttachSession() && isConnected()) || (session.isProgramSession() && !isTerminated())) { - // Try to interrupt the inferior, first. - if (isRunning()) { - interrupt(); - } - int token = 0; - if (isSuspended()) { - try { - CommandFactory factory = session.getCommandFactory(); - CLIExecAbort abort = factory.createCLIExecAbort(); - session.postCommand0(abort, -1); - // do not wait for the answer. - //abort.getMIInfo(); - token = abort.getToken(); - } catch (MIException e) { - // ignore the error - } - } - setTerminated(token, true); - } else if (session.isCoreSession() && !isTerminated()){ - setTerminated(); - } - } - - public void interrupt() throws MIException { - MIProcess gdb = session.getGDBProcess(); - // Check if they can handle the interrupt - // Try the exec-interrupt; this will be for "gdb --async" - CommandFactory factory = session.getCommandFactory(); - MIExecInterrupt interrupt = factory.createMIExecInterrupt(); - if (interrupt != null) { - try { - session.postCommand(interrupt); - // call getMIInfo() even if we discard the value; - interrupt.getMIInfo(); - // Allow (5 secs) for the interrupt to propagate. - synchronized(this) { - for (int i = 0;(state == RUNNING) && i < 5; i++) { - try { - wait(1000); - } catch (InterruptedException e) { - } - } - } - } catch (MIException e) { - } - } else if (gdb.canInterrupt(this)) { - gdb.interrupt(this); - } - - // If we've failed throw an exception up. - if (state == RUNNING) { - throw new MIException(MIPlugin.getResourceString("src.MIInferior.Failed_to_interrupt")); //$NON-NLS-1$ - } - } - - public boolean isSuspended() { - return state == SUSPENDED; - } - - public boolean isRunning() { - return state == RUNNING; - } - - public boolean isTerminated() { - return state == TERMINATED; - } - - public boolean isConnected() { - return connected; - } - - public synchronized void setConnected() { - connected = true; - } - - public synchronized void setDisconnected() { - connected = false; - } - - public synchronized void setSuspended() { - state = SUSPENDED; - notifyAll(); - } - - public synchronized void setRunning() { - state = RUNNING; - notifyAll(); - } - - public synchronized void setTerminated() { - setTerminated(0, true); - } - - synchronized void setTerminated(int token, boolean fireEvent) { - state = TERMINATED; - // Close the streams. - try { - if (inPiped != null) { - inPiped.close(); - inPiped = null; - } - } catch (IOException e) { - //e.printStackTrace(); - } - try { - if (errPiped != null) { - errPiped.close(); - errPiped = null; - } - } catch (IOException e) { - //e.printStackTrace(); - } - - // If tty is not null then we are using a master/slave terminal - // emulation close the master to notify the slave. - if (tty != null) { - if (in != null) { - try { - in.close(); - } catch (IOException e) { - //e.printStackTrace(); - } - in = null; - } - if (out != null) { - try { - out.close(); - } catch (IOException e) { - //e.printStackTrace(); - } - out = null; - } - } - if (fireEvent) { - session.fireEvent(new MIInferiorExitEvent(session, token)); - } - notifyAll(); - } - - public OutputStream getPipedOutputStream() { - return inPiped; - } - - public OutputStream getPipedErrorStream() { - return errPiped; - } - - public IMITTY getTTY() { - return tty; - } - - public void update() { - if (getInferiorPID() == 0) { - int pid = 0; - // Do not try this on attach session. - if (!isConnected()) { - // Try to discover the pid - CommandFactory factory = session.getCommandFactory(); - CLIInfoProgram prog = factory.createCLIInfoProgram(); - try { - RxThread rxThread = session.getRxThread(); - rxThread.setEnableConsole(false); - session.postCommand(prog); - CLIInfoProgramInfo info = prog.getMIInfoProgramInfo(); - pid = info.getPID(); - } catch (MIException e) { - // no rethrown. - } finally { - RxThread rxThread = session.getRxThread(); - rxThread.setEnableConsole(true); - } - } - // We fail permantely. - setInferiorPID((pid == 0) ? -1: pid); - } - } - - public void setInferiorPID(int pid) { - inferiorPID = pid; - } - - public int getInferiorPID() { - return inferiorPID; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MIProcess.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MIProcess.java deleted file mode 100644 index 998df6f4bc5..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MIProcess.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core; - -import java.io.InputStream; -import java.io.OutputStream; - -/** - * Check if we can interrupt the inferior. - * - */ -public interface MIProcess { - - - public abstract boolean canInterrupt(MIInferior inferior); - - public abstract void interrupt(MIInferior inferior); - - /* (non-Javadoc) - * @see java.lang.Process#destroy() - */ - public void destroy(); - - /* (non-Javadoc) - * @see java.lang.Process#exitValue() - */ - public int exitValue(); - - /* (non-Javadoc) - * @see java.lang.Process#getErrorStream() - */ - public InputStream getErrorStream(); - - /* (non-Javadoc) - * @see java.lang.Process#getInputStream() - */ - public InputStream getInputStream(); - - /* (non-Javadoc) - * @see java.lang.Process#getOutputStream() - */ - public OutputStream getOutputStream(); - - /* (non-Javadoc) - * @see java.lang.Process#waitFor() - */ - public int waitFor() throws InterruptedException; - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MISession.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MISession.java deleted file mode 100644 index 67489b30480..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MISession.java +++ /dev/null @@ -1,840 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - * Hewlett-Packard Development Company - fix for bug 109733 - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.PipedInputStream; -import java.io.PipedOutputStream; -import java.util.Observable; - -import org.eclipse.cdt.debug.mi.core.command.Command; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.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.command.MIVersion; -import org.eclipse.cdt.debug.mi.core.event.MIEvent; -import org.eclipse.cdt.debug.mi.core.event.MIGDBExitEvent; -import org.eclipse.cdt.debug.mi.core.output.MIGDBShowInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIParser; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; - -/** - * Represents a GDB/MI session. - * Note that on GNU/Linux the target stream is not - * preceded by the token '@' until this is fix, on GNU/Linux - * there a good change to confuse the parser. - */ -public class MISession extends Observable { - - /** - * Normal program debuging. - */ - public final static int PROGRAM = 0; - /** - * Attach to a running process debuging. - */ - public final static int ATTACH = 1; - /** - * PostMortem analysis. - */ - public final static int CORE = 2; - - boolean terminated; - boolean useInterpreterExecConsole; - boolean verboseMode = false; - - // hold the type of the session(post-mortem, attach etc ..) - int sessionType; - - Process sessionProcess; - MIProcess gdbProcess; - InputStream inChannel; - OutputStream outChannel; - - TxThread txThread; - RxThread rxThread; - EventThread eventThread; - - CommandQueue txQueue; - CommandQueue rxQueue; - Queue eventQueue; - - PipedInputStream miInConsolePipe; - PipedOutputStream miOutConsolePipe; - PipedInputStream miInLogPipe; - PipedOutputStream miOutLogPipe; - - - CommandFactory factory; - - MIParser parser; - - long cmdTimeout; - - MIInferior inferior; - - /** - * @param process - * @param tty - * @param type - * @param commandTimeout - * @param launchTimeout - * @param miVersion - * @param monitor - * @throws MIException - * @deprecated - */ - public MISession(MIProcess process, IMITTY tty, int type, int commandTimeout, int launchTimeout, String miVersion, IProgressMonitor monitor) throws MIException { - this(process, tty, type, new CommandFactory(miVersion), commandTimeout, launchTimeout, monitor); - } - - - /** - * Create the gdb session. Assume MIVersion 1 - * - * @deprecated use the other constructors with the MIVersion - * @param Process gdb Process. - * @param pty Terminal to use for the inferior. - * @param timeout time in milliseconds to wait for command response. - * @param type the type of debugin session. - * @deprecated - */ - public MISession(MIProcess process, IMITTY tty, int commandTimeout, int type, int launchTimeout) throws MIException { - this(process, tty, type, commandTimeout, launchTimeout, MIVersion.MI1, new NullProgressMonitor()); - if (useExecConsole()) { - // if exec console is present, assume MI2 supported - setCommandFactory(new CommandFactory(MIVersion.MI2)); - } - } - - /** - * Create the gdb session. - * - * @param type the type of debugging session. - * @param commandFactory the MI command factory - * @param Process gdb Process. - * @param pty Terminal to use for the inferior. - * @param timeout time in milliseconds to wait for command response. - * @deprecated - */ - public MISession(MIProcess process, IMITTY tty, int type, CommandFactory commandFactory, int commandTimeout, int launchTimeout, IProgressMonitor monitor) throws MIException { - gdbProcess = process; - inChannel = process.getInputStream(); - outChannel = process.getOutputStream(); - - factory = commandFactory; - cmdTimeout = commandTimeout; - - sessionType = type; - - parser = new MIParser(); - - inferior = new MIInferior(this, tty); - - txQueue = new CommandQueue(); - rxQueue = new CommandQueue(); - eventQueue = new Queue(); - - txThread = new TxThread(this); - rxThread = new RxThread(this); - eventThread = new EventThread(this); - - // initialize/setup - setup(launchTimeout, new NullProgressMonitor()); - } - - /** - * Constructor for MISession. Creates MI wrapper for the given gdb process. - * - * @param type the type of debugging session: <code>PROGRAM</code>, <code>ATTACH</code> or <code>CORE</code> - * @param commandFactory the set of gdb/mi commands supported by given gdb - * @param Process a gdb process - * @param pty terminal to use for the inferior. - * @param timeout time in milliseconds to wait for command response. - * - * @since 3.1 - */ - public MISession(MIProcess process, IMITTY tty, int type, CommandFactory commandFactory, int commandTimeout) throws MIException { - gdbProcess = process; - inChannel = process.getInputStream(); - outChannel = process.getOutputStream(); - - factory = commandFactory; - cmdTimeout = commandTimeout; - - sessionType = type; - - parser = new MIParser(); - - inferior = new MIInferior(this, tty); - - txQueue = new CommandQueue(); - rxQueue = new CommandQueue(); - eventQueue = new Queue(); - - txThread = new TxThread(this); - rxThread = new RxThread(this); - eventThread = new EventThread(this); - - setup(); - - txThread.start(); - rxThread.start(); - eventThread.start(); - } - - /** - * No need to pass a progress monitor and a launch timeout. - * @since 3.1 - */ - protected void setup() throws MIException { - // The Process may have terminated earlier because - // of bad arguments etc .. check this here and bail out. - try { - gdbProcess.exitValue(); - InputStream err = gdbProcess.getErrorStream(); - BufferedReader reader = new BufferedReader(new InputStreamReader(err)); - String line = null; - try { - line = reader.readLine(); - reader.close(); - } catch (Exception e) { - // the reader may throw a NPE. - } - if (line == null) { - line = MIPlugin.getResourceString("src.MISession.Process_Terminated"); //$NON-NLS-1$ - } - throw new MIException(line); - } catch (IllegalThreadStateException e) { - // Ok, it means the process is alive. - } - } - - /** - * Initializes the gdb session. - * @since 3.1 - */ - public void start() throws MIException { - try { - initialize(); - } catch (MIException exc) { - // Kill the Transmition thread. - if (txThread.isAlive()) { - txThread.interrupt(); - } - // Kill the Receiving Thread. - if (rxThread.isAlive()) { - rxThread.interrupt(); - } - // Kill the event Thread. - if (eventThread.isAlive()) { - eventThread.interrupt(); - } - // rethrow up the exception. - throw exc; - } - } - - /** - * @deprecated use <code>setup()</code> without parameters - */ - protected void setup(int launchTimeout, IProgressMonitor monitor) throws MIException { - // The Process may have terminated earlier because - // of bad arguments etc .. check this here and bail out. - try { - gdbProcess.exitValue(); - InputStream err = gdbProcess.getErrorStream(); - BufferedReader reader = new BufferedReader(new InputStreamReader(err)); - String line = null; - try { - line = reader.readLine(); - reader.close(); - } catch (Exception e) { - // the reader may throw a NPE. - } - if (line == null) { - line = MIPlugin.getResourceString("src.MISession.Process_Terminated"); //$NON-NLS-1$ - } - throw new MIException(line); - } catch (IllegalThreadStateException e) { - // Ok, it means the process is alive. - } - - if (monitor.isCanceled()) { - throw new MIException(MIPlugin.getResourceString("src.MISession.Process_Terminated")); //$NON-NLS-1$ - } - - txThread.start(); - rxThread.start(); - eventThread.start(); - - try { - if (monitor.isCanceled()) { - throw new MIException(MIPlugin.getResourceString("src.MISession.Process_Terminated")); //$NON-NLS-1$ - } - - initialize(launchTimeout, monitor); - } catch (MIException exc) { - // Kill the Transmition thread. - if (txThread.isAlive()) { - txThread.interrupt(); - } - // Kill the Receiving Thread. - if (rxThread.isAlive()) { - rxThread.interrupt(); - } - // Kill the event Thread. - if (eventThread.isAlive()) { - eventThread.interrupt(); - } - // rethrow up the exception. - throw exc; - } - } - - /** - * Turns off the "confirm" option of gdb. - * Sets witdth and height of gdb session to 0. - * @since 3.1 - */ - protected void initialize() throws MIException { - // Disable a certain number of irritations from gdb. - // Like confirmation and screen size. - MIGDBSet confirm = getCommandFactory().createMIGDBSet(new String[]{"confirm", "off"}); //$NON-NLS-1$ //$NON-NLS-2$ - postCommand(confirm); - confirm.getMIInfo(); - - MIGDBSet width = getCommandFactory().createMIGDBSet(new String[]{"width", "0"}); //$NON-NLS-1$ //$NON-NLS-2$ - postCommand(width); - width.getMIInfo(); - - MIGDBSet height = getCommandFactory().createMIGDBSet(new String[]{"height", "0"}); //$NON-NLS-1$ //$NON-NLS-2$ - postCommand(height); - height.getMIInfo(); - - useInterpreterExecConsole = canUseInterpreterExecConsole(); - - String prompt = getCLIPrompt(); - if (prompt != null) { - getMIParser().cliPrompt = prompt; - } - } - - /** - * @deprecated use <code>initialize()</code> without parameters - */ - protected void initialize(int launchTimeout, IProgressMonitor monitor) throws MIException { - // Disable a certain number of irritations from gdb. - // Like confirmation and screen size. - MIGDBSet confirm = getCommandFactory().createMIGDBSet(new String[]{"confirm", "off"}); //$NON-NLS-1$ //$NON-NLS-2$ - postCommand(confirm, launchTimeout); - confirm.getMIInfo(); - if (monitor.isCanceled()) { - throw new MIException(MIPlugin.getResourceString("src.MISession.Process_Terminated")); //$NON-NLS-1$ - } - - MIGDBSet width = getCommandFactory().createMIGDBSet(new String[]{"width", "0"}); //$NON-NLS-1$ //$NON-NLS-2$ - postCommand(width, launchTimeout); - width.getMIInfo(); - if (monitor.isCanceled()) { - throw new MIException(MIPlugin.getResourceString("src.MISession.Process_Terminated")); //$NON-NLS-1$ - } - - MIGDBSet height = getCommandFactory().createMIGDBSet(new String[]{"height", "0"}); //$NON-NLS-1$ //$NON-NLS-2$ - postCommand(height, launchTimeout); - height.getMIInfo(); - if (monitor.isCanceled()) { - throw new MIException(MIPlugin.getResourceString("src.MISession.Process_Terminated")); //$NON-NLS-1$ - } - - useInterpreterExecConsole = canUseInterpreterExecConsole(); - if (monitor.isCanceled()) { - throw new MIException(MIPlugin.getResourceString("src.MISession.Process_Terminated")); //$NON-NLS-1$ - } - - String prompt = getCLIPrompt(); - if (monitor.isCanceled()) { - throw new MIException(MIPlugin.getResourceString("src.MISession.Process_Terminated")); //$NON-NLS-1$ - } - if (prompt != null) { - getMIParser().cliPrompt = prompt; - } - } - - protected boolean canUseInterpreterExecConsole() { - // Try to discover if "-interpreter-exec" is supported. - try { - MIInterpreterExecConsole echo = getCommandFactory().createMIInterpreterExecConsole("echo"); //$NON-NLS-1$ - postCommand(echo); - echo.getMIInfo(); - return true; - } catch (MIException e) { - // - } - return false; - } - - protected String getCLIPrompt() throws MIException { - // Get GDB's prompt - MIGDBShowPrompt prompt = getCommandFactory().createMIGDBShowPrompt(); - postCommand(prompt); - MIGDBShowInfo infoPrompt = prompt.getMIGDBShowInfo(); - String value = infoPrompt.getValue(); - if (value != null && value.length() > 0) { - return value.trim(); - } - return null; - } - - /** - * get MI Console Stream. - * The parser will make available the MI console stream output. - */ - public InputStream getMIConsoleStream() { - if (miInConsolePipe == null) { - try { - miOutConsolePipe = new PipedOutputStream(); - miInConsolePipe = new PipedInputStream(miOutConsolePipe); - } catch (IOException e) { - } - } - return miInConsolePipe; - } - - /** - * get MI Console Stream. - * The parser will make available the MI console stream output. - */ - public InputStream getMILogStream() { - if (miInLogPipe == null) { - try { - miOutLogPipe = new PipedOutputStream(); - miInLogPipe = new PipedInputStream(miOutLogPipe); - } catch (IOException e) { - } - } - return miInLogPipe; - } - - /** - * For example the CDI/MI bridge uses the command - * factory to create MI commands this allow overloading. - */ - public CommandFactory getCommandFactory() { - return factory; - } - - /** - * Set a new factory to use for command. - */ - public void setCommandFactory(CommandFactory f) { - factory = f; - } - - /** - * Return the MI parser. - */ - public MIParser getMIParser() { - return parser; - } - - /** - * Reset the MI parser. - */ - public void setMIParser(MIParser p) { - parser = p; - } - - /** - * Set the type of session this is. - * Certain action will base on that, for example - * the inferior will not try to kill/destroy a - * attach session disconnected. - */ - public int getSessionType() { - return sessionType; - } - - public void setSessionType(int type) { - sessionType = type; - } - - public boolean useExecConsole() { - return useInterpreterExecConsole; - } - - public boolean inPrimaryPrompt() { - return rxThread.inPrimaryPrompt(); - } - - public boolean inSecondaryPrompt() { - return rxThread.inSecondaryPrompt(); - } - /** - * The debug session is a program being debug. - */ - public boolean isProgramSession() { - return sessionType == PROGRAM; - } - - /** - * The debug session is a program being attach to. - */ - public boolean isAttachSession() { - return sessionType == ATTACH; - } - - /** - * The debug session is a core being analysed. - */ - public boolean isCoreSession() { - return sessionType == CORE; - } - - /** - * Reset the default Command Timeout. - */ - public void setCommandTimeout(long timeout) { - cmdTimeout = timeout; - } - - /** - * Return the default Command Timeout, default 10 secs. - */ - public long getCommandTimeout() { - return cmdTimeout; - } - - /** - * equivalent to: - * postCommand(cmd, cmdTimeout) - */ - public void postCommand(Command cmd) throws MIException { - postCommand(cmd, cmdTimeout); - } - - /** - * Sends a command to gdb, and wait(timeout) for a response. - * if timeout < 0 the wait will be skipped. - * - */ - public void postCommand(Command cmd, long timeout) throws MIException { - - // Test if we are in a sane state. - if (!txThread.isAlive() || !rxThread.isAlive()) { - throw new MIException(MIPlugin.getResourceString("src.MISession.Thread_Terminated")); //$NON-NLS-1$ - } - - // Test if we are in the right state? - if (inferior.isRunning()) { - // REMINDER: if we support -exec-interrupt - // Let it throught: - if (!(cmd instanceof MIExecInterrupt)) { - throw new MIException(MIPlugin.getResourceString("src.MISession.Target_not_suspended")); //$NON-NLS-1$ - } - } - - 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$ - } - postCommand0(cmd, timeout); - } - - /** - * if timeout < 0 the operation will not try to way for - * answer from gdb. - * - * @param cmd - * @param timeout - * @throws MIException - */ - public synchronized void postCommand0(Command cmd, long timeout) throws MIException { - // TRACING: print the command; - if (MIPlugin.getDefault().isDebugging()) { - MIPlugin.getDefault().debugLog(cmd.toString()); - } - - if (isVerboseModeEnabled()) - writeToConsole(cmd.toString()); - - txQueue.addCommand(cmd); - - // do not wait around the answer. - if (timeout < 0) { - return; - } - // Wait for the response or timedout - synchronized (cmd) { - // RxThread will set the MIOutput on the cmd - // when the response arrive. - while (cmd.getMIOutput() == null) { - try { - cmd.wait(timeout); - if (cmd.getMIOutput() == null) { - throw new MIException(MIPlugin.getResourceString("src.MISession.Target_not_responding")); //$NON-NLS-1$ - } - } catch (InterruptedException e) { - } - } - } - } - - /** - * Return the inferior "Process". - */ - public MIInferior getMIInferior() { - return inferior; - } - - /** - * Set the inferior "Process". - */ - public void setMIInferior(MIInferior inferior) { - this.inferior = inferior; - } - - /** - * Return the "gdb" Process. - */ - public MIProcess getGDBProcess() { - return gdbProcess; - } - - /** - * Return a "fake" Process that will - * encapsulate the call input/output of gdb. - */ - public Process getSessionProcess() { - if (sessionProcess == null) { - sessionProcess = new SessionProcess(this); - } - return sessionProcess; - } - - /** - * Check if the gdb session is terminated. - */ - public boolean isTerminated() { - return terminated; - } - - /** - * Terminate the MISession. - */ - public void terminate() { - - // Sanity check. - if (isTerminated()) { - return; - } - - terminated = true; - - // Destroy any MI Inferior(Process) and streams. - inferior.destroy(); - - // {in,out}Channel is use as predicate/condition - // in the {RX,TX,Event}Thread to detect termination - // and bail out. So they are set to null. - InputStream inGDB = inChannel; - inChannel = null; - OutputStream outGDB = outChannel; - outChannel = null; - - // Although we will close the pipe(). It is cleaner - // to give a chance to gdb to cleanup. - // send the exit(-gdb-exit). But we only wait a maximum of 2 sec. - MIGDBExit exit = getCommandFactory().createMIGDBExit(); - try { - postCommand0(exit, 2000); - } catch (MIException e) { - //ignore any exception at this point. - } - - // Make sure gdb is killed. - // FIX: the destroy() must be call before closing gdb streams - // on windows if the order is not follow the close() will hang. - if (gdbProcess != null) { - gdbProcess.destroy(); - } - - // Close the input GDB prompt - try { - if (inGDB != null) - inGDB.close(); - } catch (IOException e) { - } - - // Close the output GDB prompt - try { - if (outGDB != null) - outGDB.close(); - } catch (IOException e) { - } - - // Destroy the MI console stream. - try { - miInConsolePipe = null; - if (miOutConsolePipe != null) { - miOutConsolePipe.close(); - } - } catch (IOException e) { - } - - // Destroy the MI log stream. - try { - miInLogPipe = null; - if (miOutLogPipe != null) { - miOutLogPipe.close(); - } - } catch (IOException e) { - } - - // Kill the Transmition thread. - try { - if (txThread.isAlive()) { - txThread.interrupt(); - txThread.join(cmdTimeout); - } - } catch (InterruptedException e) { - } - - // Kill the Receiving Thread. - try { - if (rxThread.isAlive()) { - rxThread.interrupt(); - rxThread.join(cmdTimeout); - } - } catch (InterruptedException e) { - } - - // Kill the event Thread ... if it is not us. - if (!eventThread.equals(Thread.currentThread())) { - // Kill the event Thread. - try { - if (eventThread.isAlive()) { - eventThread.interrupt(); - eventThread.join(cmdTimeout); - } - } catch (InterruptedException e) { - } - } - - // Tell the observers that the session is terminated - notifyObservers(new MIGDBExitEvent(this, 0)); - - // Should not be necessary but just to be safe. - deleteObservers(); - } - - /** - * Notify the observers of new MI OOB events. - */ - public void notifyObservers(Object arg) { - setChanged(); - super.notifyObservers(arg); - } - - OutputStream getConsolePipe() { - if (miOutConsolePipe == null) { - getMIConsoleStream(); - } - return miOutConsolePipe; - } - - OutputStream getLogPipe() { - if (miOutLogPipe == null) { - getMILogStream(); - } - return miOutLogPipe; - } - - CommandQueue getTxQueue() { - return txQueue; - } - - CommandQueue getRxQueue() { - return rxQueue; - } - - Queue getEventQueue() { - return eventQueue; - } - - public RxThread getRxThread() { - return rxThread; - } - - InputStream getChannelInputStream() { - return inChannel; - } - - OutputStream getChannelOutputStream() { - return outChannel; - } - - MIOutput parse(String buffer) { - return parser.parse(buffer); - } - - public void fireEvents(MIEvent[] events) { - if (events != null && events.length > 0) { - for (int i = 0; i < events.length; i++) { - fireEvent(events[i]); - } - } - } - - public void fireEvent(MIEvent event) { - if (event != null) { - getEventQueue().addItem(event); - } - } - - protected void writeToConsole(String text) { - OutputStream console = getConsolePipe(); - if (console != null) { - try { - console.write(text.getBytes()); - console.flush(); - } - catch(IOException e) { - } - } - } - - public void enableVerboseMode(boolean enabled) { - verboseMode = enabled; - } - - public boolean isVerboseModeEnabled() { - return verboseMode; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/Queue.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/Queue.java deleted file mode 100644 index 639d8b64842..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/Queue.java +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core; - -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; - -/** - * Simple thread-safe Queue implemetation. - */ -public class Queue { - - protected List list; - - public Queue() { - list = Collections.synchronizedList(new LinkedList()); - } - - public Object removeItem() throws InterruptedException { - //print("in removeItem() - entering"); - synchronized (list) { - while (list.isEmpty()) { - //print("in removeItem() - about to wait()"); - list.wait(); - //print("in removeItem() - done with wait()"); - } - - // extract the new first cmd - Object item = list.remove(0); - - //print("in removeItem() - leaving"); - return item; - } - } - - public void addItem(Object item) { - //print("in addItem() - entering"); - synchronized (list) { - // There will always be room to add to this List - // because it expands as needed. - list.add(item); - //print("in addItem - just added: '" + cmd + "'"); - - // After adding, notify any and all waiting - // threads that the list has changed. - list.notifyAll(); - //print("in addItem() - just notified"); - } - //print("in addItem() - leaving"); - } - - public Object[] clearItems() { - Object[] array; - synchronized (list) { - array = list.toArray(); - list.clear(); - } - return array; - } - - public boolean isEmpty() { - boolean empty; - synchronized (list) { - empty = list.isEmpty(); - } - return empty; - } - -// private static void print(String msg) { -// String name = Thread.currentThread().getName(); -// System.out.println(name + ": " + msg); -// } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/RxThread.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/RxThread.java deleted file mode 100644 index 6b5cd7de273..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/RxThread.java +++ /dev/null @@ -1,542 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - * Norbert Ploett, Siemens AG - fix for bug 119370 - * Hewlett-Packard Development Company - fix for bug 109733 (null check in setPrompt) - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.List; - -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.MIExecContinue; -import org.eclipse.cdt.debug.mi.core.command.MIExecFinish; -import org.eclipse.cdt.debug.mi.core.command.MIExecNext; -import org.eclipse.cdt.debug.mi.core.command.MIExecNextInstruction; -import org.eclipse.cdt.debug.mi.core.command.MIExecReturn; -import org.eclipse.cdt.debug.mi.core.command.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.MIInterpreterExecConsole; -import org.eclipse.cdt.debug.mi.core.event.MIBreakpointHitEvent; -import org.eclipse.cdt.debug.mi.core.event.MIErrorEvent; -import org.eclipse.cdt.debug.mi.core.event.MIEvent; -import org.eclipse.cdt.debug.mi.core.event.MIFunctionFinishedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIInferiorExitEvent; -import org.eclipse.cdt.debug.mi.core.event.MIInferiorSignalExitEvent; -import org.eclipse.cdt.debug.mi.core.event.MILocationReachedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIRunningEvent; -import org.eclipse.cdt.debug.mi.core.event.MISharedLibEvent; -import org.eclipse.cdt.debug.mi.core.event.MISignalEvent; -import org.eclipse.cdt.debug.mi.core.event.MISteppingRangeEvent; -import org.eclipse.cdt.debug.mi.core.event.MIStoppedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIWatchpointScopeEvent; -import org.eclipse.cdt.debug.mi.core.event.MIWatchpointTriggerEvent; -import org.eclipse.cdt.debug.mi.core.output.MIAsyncRecord; -import org.eclipse.cdt.debug.mi.core.output.MIConsoleStreamOutput; -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MILogStreamOutput; -import org.eclipse.cdt.debug.mi.core.output.MINotifyAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIOOBRecord; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIParser; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MIStatusAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIStreamRecord; -import org.eclipse.cdt.debug.mi.core.output.MITargetStreamOutput; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - -/** - * Receiving thread of gdb response output. - */ -public class RxThread extends Thread { - - final MISession session; - 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$ - session = s; - cli = new CLIProcessor(session); - oobList = new ArrayList(); - } - - /* - * Get the response, parse the output, dispatch for OOB - * search for the corresponding token in rxQueue for the ResultRecord. - */ - public void run() { - BufferedReader reader = new BufferedReader(new InputStreamReader(session.getChannelInputStream())); - try { - String line; - while ((line = reader.readLine()) != null) { - // TRACING: print the output. - if (MIPlugin.getDefault().isDebugging()) { - MIPlugin.getDefault().debugLog(line); - } - - if (session.isVerboseModeEnabled()) - session.writeToConsole(line + "\n"); //$NON-NLS-1$ - - setPrompt(line); - processMIOutput(line + "\n"); //$NON-NLS-1$ - } - } catch (IOException e) { - //e.printStackTrace(); - } - // This code should be executed when gdb been abruptly - // or unxepectedly killed. This is detected by checking - // if the channelInputStream is not null. In normal case - // session.terminate() will set the channelInputStream to null. - if (session.getChannelInputStream() != null) { - Runnable cleanup = new Runnable() { - public void run() { - // Change the state of the inferior. - session.getMIInferior().setTerminated(); - session.terminate(); - } - }; - Thread clean = new Thread(cleanup, "GDB Died"); //$NON-NLS-1$ - clean.setDaemon(true); - clean.start(); - } - // Clear the queue and notify any command waiting, we are going down. - CommandQueue rxQueue = session.getRxQueue(); - if (rxQueue != null) { - Command[] cmds = rxQueue.clearCommands(); - for (int i = 0; i < cmds.length; i++) { - synchronized (cmds[i]) { - cmds[i].notifyAll(); - } - } - } - } - - void setPrompt(String line) { - MIParser parser = session.getMIParser(); - prompt = 0; - // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=109733 - if (line == null || parser == null) - return; - line = line.trim(); - if (line.equals(parser.primaryPrompt)) { - prompt = 1; - } else if (line.equals(parser.secondaryPrompt)) { - prompt = 2; - } - } - - public boolean inPrimaryPrompt() { - return prompt == 1; - } - - public boolean inSecondaryPrompt() { - 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. - * Any OOBs are consider like event and dipatch to the - * listeners/observers in different thread. - */ - void processMIOutput(String buffer) { - MIOutput response = session.parse(buffer); - if (response != null) { - List list = new ArrayList(); - CommandQueue rxQueue = session.getRxQueue(); - - MIResultRecord rr = response.getMIResultRecord(); - if (rr != null) { - int id = rr.getToken(); - Command cmd = rxQueue.removeCommand(id); - - // Clear the accumulate oobList on each new Result Command - // response. - MIOOBRecord[] oobRecords = new MIOOBRecord[oobList.size()]; - oobList.toArray(oobRecords); - - // Check if the state changed. - String state = rr.getResultClass(); - if ("running".equals(state)) { //$NON-NLS-1$ - int type = 0; - // Check the type of command - // if it was a step instruction set state stepping - if (cmd instanceof MIExecNext) { - type = MIRunningEvent.NEXT; - } else if (cmd instanceof MIExecNextInstruction) { - type = MIRunningEvent.NEXTI; - } else if (cmd instanceof MIExecStep) { - type = MIRunningEvent.STEP; - } else if (cmd instanceof MIExecStepInstruction) { - type = MIRunningEvent.STEPI; - } else if (cmd instanceof MIExecUntil) { - type = MIRunningEvent.UNTIL; - } else if (cmd instanceof MIExecFinish) { - type = MIRunningEvent.FINISH; - } else if (cmd instanceof MIExecReturn) { - type = MIRunningEvent.RETURN; - } else if (cmd instanceof MIExecContinue) { - type = MIRunningEvent.CONTINUE; - } else { - type = MIRunningEvent.CONTINUE; - } - session.getMIInferior().setRunning(); - MIEvent event = new MIRunningEvent(session, id, type); - if (cmd != null && cmd.isQuiet()) - event.setPropagate(false); - list.add(event); - } else if ("exit".equals(state)) { //$NON-NLS-1$ - // No need to do anything, terminate() will. - session.getMIInferior().setTerminated(); - } else if ("connected".equals(state)) { //$NON-NLS-1$ - session.getMIInferior().setConnected(); - } else if ("error".equals(state)) { //$NON-NLS-1$ - if (session.getMIInferior().isRunning()) { - session.getMIInferior().setSuspended(); - MIEvent event = new MIErrorEvent(session, rr, oobRecords); - list.add(event); - } - } else if ("done".equals(state) && cmd instanceof CLICommand) { //$NON-NLS-1$ - // "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); - } - - // Set the accumulate console Stream - response.setMIOOBRecords(oobRecords); - - // 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) { - cli.processSettingChanges((CLICommand)cmd); - } else if (cmd instanceof MIInterpreterExecConsole) { - cli.processSettingChanges((MIInterpreterExecConsole)cmd); - } - - synchronized (cmd) { - cmd.setMIOutput(response); - cmd.notifyAll(); - } - } - - // Clear the accumulate oobList on each new Result Command response. - oobList.clear(); - - } else { - - // Process OOBs - MIOOBRecord[] oobs = response.getMIOOBRecords(); - for (int i = 0; i < oobs.length; i++) { - processMIOOBRecord(oobs[i], list); - } - } - - MIEvent[] events = (MIEvent[]) list.toArray(new MIEvent[list.size()]); - session.fireEvents(events); - } // if response != null - } - - /** - * Dispatch a thread to deal with the listeners. - */ - void processMIOOBRecord(MIOOBRecord oob, List list) { - if (oob instanceof MIAsyncRecord) { - processMIOOBRecord((MIAsyncRecord) oob, list); - oobList.clear(); - } else if (oob instanceof MIStreamRecord) { - processMIOOBRecord((MIStreamRecord) oob); - } - } - - void processMIOOBRecord(MIAsyncRecord async, List list) { - if (async instanceof MIExecAsyncOutput) { - MIExecAsyncOutput exec = (MIExecAsyncOutput) async; - // Change of state. - String state = exec.getAsyncClass(); - if ("stopped".equals(state)) { //$NON-NLS-1$ - MIResult[] results = exec.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue val = results[i].getMIValue(); - if (var.equals("reason")) { //$NON-NLS-1$ - if (val instanceof MIConst) { - String reason = ((MIConst) val).getString(); - MIEvent e = createEvent(reason, exec); - if (e != null) { - list.add(e); - } - } - } - } - - // GDB does not have reason when stopping on shared, hopefully - // this will be fix in newer version meanwhile, we will use a hack - // to cope. On most platform we can detect by looking at the - // console stream for phrase: - // ~"Stopped due to shared library event\n" - // - // Althought it is a _real_ bad idea to do this, we do not have - // any other alternatives. - if (list.isEmpty()) { - String[] logs = getStreamRecords(); - for (int i = 0; i < logs.length; i++) { - if (logs[i].equalsIgnoreCase("Stopped due to shared library event")) { //$NON-NLS-1$ - session.getMIInferior().setSuspended(); - MIEvent e = new MISharedLibEvent(session, exec); - list.add(e); - } - } - } - - // We were stopped for some unknown reason, for example - // GDB for temporary breakpoints will not send the - // "reason" ??? still fire a stopped event. - if (list.isEmpty()) { - session.getMIInferior().setSuspended(); - MIEvent e = new MIStoppedEvent(session, exec); - list.add(e); - } - } - } else if (async instanceof MIStatusAsyncOutput) { - // Nothing done .. but what about +download?? - } else if (async instanceof MINotifyAsyncOutput) { - // Nothing - } - } - - void processMIOOBRecord(MIStreamRecord stream) { - if (stream instanceof MIConsoleStreamOutput) { - OutputStream console = session.getConsolePipe(); - if (console != null) { - MIConsoleStreamOutput out = (MIConsoleStreamOutput) stream; - String str = out.getString(); - // Process the console stream too. - setPrompt(str); - if (str != null && isEnableConsole()) { - try { - console.write(str.getBytes()); - console.flush(); - } catch (IOException e) { - } - } - } - // Accumulate the Console Stream Output response for parsing. - // Some commands will put valuable info in the Console Stream. - oobList.add(stream); - } else if (stream instanceof MITargetStreamOutput) { - OutputStream target = session.getMIInferior().getPipedOutputStream(); - if (target != null) { - MITargetStreamOutput out = (MITargetStreamOutput) stream; - String str = out.getString(); - if (str != null) { - try { - target.write(str.getBytes()); - target.flush(); - } catch (IOException e) { - } - } - } - // Accumulate the Target Stream Output response for parsing. - // Some commands, e.g. 'monitor' will put valuable info in the Console Stream. - // This fixes bug 119370. - oobList.add(stream); - } else if (stream instanceof MILogStreamOutput) { - // This is meant for the gdb console. - OutputStream log = session.getLogPipe(); - if (log != null) { - MILogStreamOutput out = (MILogStreamOutput) stream; - String str = out.getString(); - if (str != null && isEnableConsole()) { - try { - log.write(str.getBytes()); - log.flush(); - } catch (IOException e) { - } - } - } - // Accumulate the Log Stream Output response for parsing. - // Some commands will put valuable info in the Log Stream. - oobList.add(stream); - } - } - - /** - * Check for any info that we can gather form the console. - */ - void processMIOOBRecord(MIResultRecord rr, List list) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("reason")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - String reason = ((MIConst) value).getString(); - MIEvent event = createEvent(reason, rr); - if (event != null) { - list.add(event); - } - } - } - } - // GDB does not have reason when stopping on shared, hopefully - // this will be fix in newer version meanwhile, we will use a hack - // to cope. On most platform we can detect this state by looking at the - // console stream for the phrase: - // ~"Stopped due to shared library event\n" - // - // Althought it is a _real_ bad idea to do this, we do not have - // any other alternatives. - if (list.isEmpty()) { - String[] logs = getStreamRecords(); - for (int i = 0; i < logs.length; i++) { - if (logs[i].equalsIgnoreCase("Stopped due to shared library event")) { //$NON-NLS-1$ - session.getMIInferior().setSuspended(); - MIEvent e = new MISharedLibEvent(session, rr); - list.add(e); - } - } - } - // We were stopped for some unknown reason, for example - // GDB for temporary breakpoints will not send the - // "reason" ??? still fire a stopped event. - if (list.isEmpty()) { - if (session.getMIInferior().isRunning()) { - session.getMIInferior().setSuspended(); - MIEvent event = new MIStoppedEvent(session, rr); - session.fireEvent(event); - } - } - } - - MIEvent createEvent(String reason, MIExecAsyncOutput exec) { - return createEvent(reason, null, exec); - } - - MIEvent createEvent(String reason, MIResultRecord rr) { - return createEvent(reason, rr, null); - } - - MIEvent createEvent(String reason, MIResultRecord rr, MIExecAsyncOutput exec) { - MIEvent event = null; - if ("breakpoint-hit".equals(reason)) { //$NON-NLS-1$ - if (exec != null) { - event = new MIBreakpointHitEvent(session, exec); - } else if (rr != null) { - event = new MIBreakpointHitEvent(session, rr); - } - session.getMIInferior().setSuspended(); - } else if ( - "watchpoint-trigger".equals(reason) //$NON-NLS-1$ - || "read-watchpoint-trigger".equals(reason) //$NON-NLS-1$ - || "access-watchpoint-trigger".equals(reason)) { //$NON-NLS-1$ - if (exec != null) { - event = new MIWatchpointTriggerEvent(session, exec); - } else if (rr != null) { - event = new MIWatchpointTriggerEvent(session, rr); - } - session.getMIInferior().setSuspended(); - } else if ("watchpoint-scope".equals(reason)) { //$NON-NLS-1$ - if (exec != null) { - event = new MIWatchpointScopeEvent(session, exec); - } else if (rr != null) { - event = new MIWatchpointScopeEvent(session, rr); - } - session.getMIInferior().setSuspended(); - } else if ("end-stepping-range".equals(reason)) { //$NON-NLS-1$ - if (exec != null) { - event = new MISteppingRangeEvent(session, exec); - } else if (rr != null) { - event = new MISteppingRangeEvent(session, rr); - } - session.getMIInferior().setSuspended(); - } else if ("signal-received".equals(reason)) { //$NON-NLS-1$ - if (exec != null) { - event = new MISignalEvent(session, exec); - } else if (rr != null) { - event = new MISignalEvent(session, rr); - } - session.getMIInferior().setSuspended(); - } else if ("location-reached".equals(reason)) { //$NON-NLS-1$ - if (exec != null) { - event = new MILocationReachedEvent(session, exec); - } else if (rr != null) { - event = new MILocationReachedEvent(session, rr); - } - session.getMIInferior().setSuspended(); - } else if ("function-finished".equals(reason)) { //$NON-NLS-1$ - if (exec != null) { - event = new MIFunctionFinishedEvent(session, exec); - } else if (rr != null) { - event = new MIFunctionFinishedEvent(session, rr); - } - session.getMIInferior().setSuspended(); - } else if ("exited-normally".equals(reason) || "exited".equals(reason)) { //$NON-NLS-1$ //$NON-NLS-2$ - if (exec != null) { - event = new MIInferiorExitEvent(session, exec); - } else if (rr != null) { - event = new MIInferiorExitEvent(session, rr); - } - session.getMIInferior().setTerminated(); - } else if ("exited-signalled".equals(reason)) { //$NON-NLS-1$ - if (exec != null) { - event = new MIInferiorSignalExitEvent(session, exec); - } else if (rr != null) { - event = new MIInferiorSignalExitEvent(session, rr); - } - session.getMIInferior().setTerminated(); - } else if ("shlib-event".equals(reason)) { //$NON-NLS-1$ - if (exec != null) { - event = new MISharedLibEvent(session, exec); - } else if (rr != null) { - event = new MISharedLibEvent(session, rr); - } - session.getMIInferior().setSuspended(); - } - return event; - } - - String[] getStreamRecords() { - List streamRecords = new ArrayList(); - MIOOBRecord[] oobRecords = (MIOOBRecord[]) oobList.toArray(new MIOOBRecord[0]); - for (int i = 0; i < oobRecords.length; i++) { - if (oobRecords[i] instanceof MIStreamRecord) { - String s = ((MIStreamRecord) oobRecords[i]).getString().trim(); - if (s != null && s.length() > 0) { - streamRecords.add(s); - } - } - } - return (String[]) streamRecords.toArray(new String[0]); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/SessionProcess.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/SessionProcess.java deleted file mode 100644 index 31407dc5f98..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/SessionProcess.java +++ /dev/null @@ -1,120 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core; - -import java.io.IOException; -import java.io.InputStream; -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.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.RawCommand; - -/** - */ -public class SessionProcess extends Process { - - MISession session; - OutputStream out; - - public SessionProcess(MISession s) { - session = s; - } - - /** - * @see java.lang.Process#destroy() - */ - public void destroy() { - session.terminate(); - } - - /** - * @see java.lang.Process#exitValue() - */ - public int exitValue() { - return session.getGDBProcess().exitValue(); - } - - /** - * @see java.lang.Process#getErrorStream() - */ - public InputStream getErrorStream() { - return session.getMILogStream(); - } - - /** - * @see java.lang.Process#getInputStream() - */ - public InputStream getInputStream() { - return session.getMIConsoleStream(); - } - - /** - * @see java.lang.Process#getOutputStream() - */ - public OutputStream getOutputStream() { - if (out == null) { - out = new OutputStream() { - StringBuffer buf = new StringBuffer(); - public void write(int b) throws IOException { - buf.append((char)b); - if (b == '\n') { - post(); - } - } - - // Encapsulate the string sent to gdb in a fake - // command and post it to the TxThread. - public void post() throws IOException { - // Throw away the newline. - String str = buf.toString().trim(); - buf.setLength(0); - Command cmd = null; - // 1- - // if We have the secondary prompt it means - // that GDB is waiting for more feedback, use a RawCommand - // 2- - // Do not use the interpreterexec for stepping operation - // the UI will fall out of step. - // 3- - // Normal Command Line Interface. - boolean secondary = session.inSecondaryPrompt(); - if (secondary) { - cmd = new RawCommand(str); - } else if (session.useExecConsole() && str.length() > 0 - && !CLIProcessor.isSteppingOperation(str)) { - CommandFactory factory = session.getCommandFactory(); - cmd = factory.createMIInterpreterExecConsole(str); - } else { - cmd = new CLICommand(str); - } - try { - // Do not wait around for the answer. - session.postCommand(cmd, -1); - } catch (MIException e) { - //e.printStackTrace(); - throw new IOException(e.getMessage()); - } - } - }; - } - return out; - } - - /** - * @see java.lang.Process#waitFor() - */ - public int waitFor() throws InterruptedException { - return session.getGDBProcess().waitFor(); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/TxThread.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/TxThread.java deleted file mode 100644 index 08e79ac1262..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/TxThread.java +++ /dev/null @@ -1,104 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core; - -import java.io.IOException; -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.RawCommand; - -/** - * Transmission command thread blocks on the command Queue - * and wake cmd are available and push them to gdb out channel. - */ -public class TxThread extends Thread { - - MISession session; - CLIProcessor cli; - - public TxThread(MISession s) { - super("MI TX Thread"); //$NON-NLS-1$ - session = s; - cli = new CLIProcessor(session); - } - - public void run () { - try { - - // signal by the session of time to die. - OutputStream out; - while ((out = session.getChannelOutputStream()) != null) { - Command cmd = null; - CommandQueue txQueue = session.getTxQueue(); - // removeCommand() will block until a command is available. - try { - cmd = txQueue.removeCommand(); - } catch (InterruptedException e) { - //e.printStackTrace(); - } - - if (cmd != null) { - String str = cmd.toString(); - // if string is empty consider as a noop - if (str.length() > 0) { - // Move to the RxQueue only if RxThread is alive. - Thread rx = session.getRxThread(); - if (rx != null && rx.isAlive() && !(cmd instanceof RawCommand)) { - CommandQueue rxQueue = session.getRxQueue(); - rxQueue.addCommand(cmd); - } else { - // The RxThread is not running - synchronized (cmd) { - cmd.notifyAll(); - } - } - - // Process the Command line to recognise patterns we may need to fire event. - if (cmd instanceof CLICommand) { - cli.processStateChanges((CLICommand)cmd); - } else if (cmd instanceof MIInterpreterExecConsole) { - cli.processStateChanges((MIInterpreterExecConsole)cmd); - } - - // shove in the pipe - if (out != null) { - out.write(str.getBytes()); - out.flush(); - } - } else { - // String is empty consider as a noop - synchronized (cmd) { - cmd.notifyAll(); - } - } - } - } - } catch (IOException e) { - //e.printStackTrace(); - } - - // Clear the queue and notify any command waiting, we are going down. - CommandQueue txQueue = session.getTxQueue(); - if (txQueue != null) { - Command[] cmds = txQueue.clearCommands(); - for (int i = 0; i < cmds.length; i++) { - synchronized (cmds[i]) { - cmds[i].notifyAll(); - } - } - } - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLICommand.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLICommand.java deleted file mode 100644 index c893408b73d..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLICommand.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - - - -/** - * Represents a CLI command. - */ -public class CLICommand extends Command -{ - - String operation = ""; //$NON-NLS-1$ - - public CLICommand(String oper) { - operation = oper; - } - - public void setOperation(String op) { - operation = op; - } - - public String getOperation() { - return operation; - } - - /** - * Returns the text representation of this command. - * - * @return the text representation of this command - */ - public String toString(){ - String str = getToken() + " " + operation; //$NON-NLS-1$ - if (str.endsWith("\n")) //$NON-NLS-1$ - return str; - return str + "\n"; //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIExecAbort.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIExecAbort.java deleted file mode 100644 index e8f8ba38711..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIExecAbort.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -exec-finish - * - * Asynchronous command. Resumes the execution of the inferior program - * until the current function is exited. Displays the results returned by - * the function. - * - */ -public class CLIExecAbort extends CLICommand -{ - public CLIExecAbort() { - super("kill"); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIHandle.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIHandle.java deleted file mode 100644 index 77f4167ab6b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIHandle.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - - - -/** - * - * handle SIGUSR1 nostop noignore - * - */ -public class CLIHandle extends CLICommand { - - public CLIHandle(String arg) { - super("handle " + arg); //$NON-NLS-1$ - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIInfoProgram.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIInfoProgram.java deleted file mode 100644 index f7daf62729b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIInfoProgram.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.CLIInfoProgramInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * info threads - * - */ -public class CLIInfoProgram extends CLICommand -{ - public CLIInfoProgram() { - super("info program"); //$NON-NLS-1$ - } - - public CLIInfoProgramInfo getMIInfoProgramInfo() throws MIException { - return (CLIInfoProgramInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new CLIInfoProgramInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIInfoSharedLibrary.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIInfoSharedLibrary.java deleted file mode 100644 index 238299be835..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIInfoSharedLibrary.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.CLIInfoSharedLibraryInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * info sharedlibrary - * - */ -public class CLIInfoSharedLibrary extends CLICommand -{ - public CLIInfoSharedLibrary() { - super("info sharedlibrary"); //$NON-NLS-1$ - } - - public CLIInfoSharedLibraryInfo getMIInfoSharedLibraryInfo() throws MIException { - return (CLIInfoSharedLibraryInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new CLIInfoSharedLibraryInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIInfoSignals.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIInfoSignals.java deleted file mode 100644 index e0cf445bbf4..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIInfoSignals.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.CLIInfoSignalsInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * info threads - * - */ -public class CLIInfoSignals extends CLICommand -{ - public CLIInfoSignals() { - super("info signals"); //$NON-NLS-1$ - } - - public CLIInfoSignals(String name) { - super("info signal " + name); //$NON-NLS-1$ - } - - public CLIInfoSignalsInfo getMIInfoSignalsInfo() throws MIException { - return (CLIInfoSignalsInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new CLIInfoSignalsInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIInfoThreads.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIInfoThreads.java deleted file mode 100644 index 97f54527b52..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIInfoThreads.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.CLIInfoThreadsInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * info threads - * - */ -public class CLIInfoThreads extends CLICommand -{ - public CLIInfoThreads() { - super("info threads"); //$NON-NLS-1$ - } - - public CLIInfoThreadsInfo getMIInfoThreadsInfo() throws MIException { - return (CLIInfoThreadsInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new CLIInfoThreadsInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIJump.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIJump.java deleted file mode 100644 index f86ff186145..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIJump.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; - - -/** - * - * jump LINESPEC - * - */ -public class CLIJump extends CLICommand { - - MIOutput out; - - public CLIJump(String loc) { - super("jump " + loc); //$NON-NLS-1$ - } - - /** - * This is a CLI command contraly to - * the -exec-continue or -exec-run - * it does not return so we have to fake - * a return value. We return "^running" - */ - public MIOutput getMIOutput() { - if (out == null) { - out = new MIOutput(); - MIResultRecord rr = new MIResultRecord(); - rr.setToken(getToken()); - rr.setResultClass(MIResultRecord.RUNNING); - out.setMIResultRecord(rr); - } - return out; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIPType.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIPType.java deleted file mode 100644 index 70aca7a1d77..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIPType.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.CLIPTypeInfo; - -/** - * - * ptype type - * - */ -public class CLIPType extends CLICommand -{ - public CLIPType(String var) { - super("ptype " + var); //$NON-NLS-1$ - } - - public CLIPTypeInfo getMIPtypeInfo() throws MIException { - return (CLIPTypeInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new CLIPTypeInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLISharedLibrary.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLISharedLibrary.java deleted file mode 100644 index 0e0c769a6e3..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLISharedLibrary.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - - - -/** - * - * sharedlibrary filename - * - */ -public class CLISharedLibrary extends CLICommand { - - public CLISharedLibrary() { - super("sharedlibrary"); //$NON-NLS-1$ - } - - public CLISharedLibrary(String name) { - super("sharedlibrary " + name); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLISignal.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLISignal.java deleted file mode 100644 index 516ff7558f8..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLISignal.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; - - - -/** - * - * signal SIGUSR1 - * - */ -public class CLISignal extends CLICommand { - - MIOutput out; - - public CLISignal(String arg) { - super("signal " + arg); //$NON-NLS-1$ - } - - /** - * This is a CLI command contraly to - * the -exec-continue or -exec-run - * it does not return so we have to fake - * a return value. We return "^running" - */ - public MIOutput getMIOutput() { - if (out == null) { - out = new MIOutput(); - MIResultRecord rr = new MIResultRecord(); - rr.setToken(getToken()); - rr.setResultClass(MIResultRecord.RUNNING); - out.setMIResultRecord(rr); - } - return out; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLITargetAttach.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLITargetAttach.java deleted file mode 100644 index c49ac888d4f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLITargetAttach.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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 CLITargetAttach extends CLICommand -{ - public CLITargetAttach(int pid) { - super("attach " + Integer.toString(pid)); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIWhatis.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIWhatis.java deleted file mode 100644 index 79aefcdfc21..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CLIWhatis.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.CLIWhatisInfo; - -/** - * - * whatis type - * - */ -public class CLIWhatis extends CLICommand -{ - public CLIWhatis(String var) { - super("whatis " + var); //$NON-NLS-1$ - } - - public CLIWhatisInfo getMIWhatisInfo() throws MIException { - return (CLIWhatisInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new CLIWhatisInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/Command.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/Command.java deleted file mode 100644 index 57bbac729e1..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/Command.java +++ /dev/null @@ -1,115 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.MILogStreamOutput; -import org.eclipse.cdt.debug.mi.core.output.MIOOBRecord; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIStreamRecord; - -/** - * A base class for all mi requests. - */ -public abstract class Command -{ - private static int globalCounter; - - int token = 0; - MIOutput output; - boolean quiet = false; - - /** - * A global counter for all command, the token - * will be use to identify uniquely a command. - * Unless the value wraps around which is unlikely. - */ - private static synchronized int getUniqToken() { - int count = ++globalCounter; - // If we ever wrap around. - if (count <= 0) { - count = globalCounter = 1; - } - return count; - } - - /** - * Returns the identifier of this request. - * - * @return the identifier of this request - */ - public int getToken() { - if (token == 0) { - token = getUniqToken(); - } - return token; - } - -// public void setToken(int token) { -// this.token = token; -// } - - public MIOutput getMIOutput() { - return output; - } - - public void setMIOutput(MIOutput mi) { - output = mi; - } - - /** - * Parse the MIOutput generate after posting the command. - */ - public MIInfo getMIInfo () throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } - - /** - * throw an MIException. - */ - protected void throwMIException (MIInfo info, MIOutput out) throws MIException { - String mesg = info.getErrorMsg().trim(); - StringBuffer sb = new StringBuffer(); - MIOOBRecord[] oobs = out.getMIOOBRecords(); - for (int i = 0; i < oobs.length; i++) { - if (oobs[i] instanceof MILogStreamOutput) { - MIStreamRecord o = (MIStreamRecord) oobs[i]; - String s = o.getString(); - if (!s.trim().equalsIgnoreCase(mesg)) { - sb.append(s); - } - } - } - String details = sb.toString(); - if (details.trim().length() == 0) { - details = mesg; - } - throw new MIException(mesg, details); - } - - public boolean isQuiet() { - return this.quiet; - } - - public void setQuiet( boolean quiet ) { - this.quiet = quiet; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java deleted file mode 100644 index 7934b9a8e1f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java +++ /dev/null @@ -1,425 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - - -/** - * Factory to create GDB commands. - */ -public class CommandFactory { - - String fMIVersion; - - protected CommandFactory() { - } - - public CommandFactory(String miVersion) { - fMIVersion = miVersion; - } - - public void setMIVersion(String miVersion) { - fMIVersion = miVersion; - } - - public String getMIVersion() { - return fMIVersion; - } - - public MIBreakAfter createMIBreakAfter(int brknum, int count) { - return new MIBreakAfter(getMIVersion(), brknum, count); - } - - public MIBreakCondition createMIBreakCondition (int brknum, String expr) { - return new MIBreakCondition(getMIVersion(), brknum, expr); - } - - public MIBreakDelete createMIBreakDelete (int[] brknum) { - return new MIBreakDelete(getMIVersion(), brknum); - } - - public MIBreakDisable createMIBreakDisable(int[] brknum) { - return new MIBreakDisable(getMIVersion(), brknum); - } - - public MIBreakEnable createMIBreakEnable(int[] brknum) { - return new MIBreakEnable(getMIVersion(), brknum); - } - - public MIBreakInsert createMIBreakInsert(boolean isTemporary, boolean isHardware, - String condition, int ignoreCount, String line, int tid) { - return new MIBreakInsert(getMIVersion(), isTemporary, isHardware, condition, ignoreCount, line, tid); - } - - public MIBreakInsert createMIBreakInsert(String func) { - return new MIBreakInsert(getMIVersion(), func); - } - - public MIBreakList createMIBreakList() { - return new MIBreakList(getMIVersion()); - } - - public MIBreakWatch createMIBreakWatch(boolean access, boolean read, String expression) { - return new MIBreakWatch(getMIVersion(), access, read, expression); - } - - public MIDataDisassemble createMIDataDisassemble(String start, String end, boolean mixed) { - return new MIDataDisassemble(getMIVersion(), start, end, mixed); - } - - public MIDataDisassemble createMIDataDisassemble(String file, int linenum, int lines, boolean mixed) { - return new MIDataDisassemble(getMIVersion(), file, linenum, lines, mixed); - } - - public MIDataEvaluateExpression createMIDataEvaluateExpression(String expression) { - return new MIDataEvaluateExpression(getMIVersion(), expression); - } - - public MIDataListChangedRegisters createMIDataListChangedRegisters() { - return new MIDataListChangedRegisters(getMIVersion()); - } - - public MIDataListRegisterNames createMIDataListRegisterNames() { - return new MIDataListRegisterNames(getMIVersion()); - } - - public MIDataListRegisterNames createMIDataListRegisterNames(int[] regnos) { - return new MIDataListRegisterNames(getMIVersion(), regnos); - } - - public MIDataListRegisterValues createMIDataListRegisterValues(int fmt, int[] regnos) { - return new MIDataListRegisterValues(getMIVersion(), fmt, regnos); - } - - public MIDataWriteRegisterValues createMIDataWriteRegisterValues(int fmt, int[] regnos, String[] 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(getMIVersion(), offset, address, wordFormat, wordSize, - rows, cols, asChar); - } - - public MIDataWriteMemory createMIDataWriteMemory(long offset, String address, - int wordFormat, int wordSize, - String value) { - return new MIDataWriteMemory(getMIVersion(), offset, address, wordFormat, wordSize, value); - } - - public MIEnvironmentCD createMIEnvironmentCD(String pathdir) { - return new MIEnvironmentCD(getMIVersion(), pathdir); - } - - public MIEnvironmentDirectory createMIEnvironmentDirectory(boolean reset, String[] pathdirs) { - return new MIEnvironmentDirectory(getMIVersion(), reset, pathdirs); - } - - public MIEnvironmentPath createMIEnvironmentPath(String[] paths) { - return new MIEnvironmentPath(getMIVersion(), paths); - } - - public MIEnvironmentPWD createMIEnvironmentPWD() { - return new MIEnvironmentPWD(getMIVersion()); - } - - /** - * @param params - * @return - */ - public MIGDBSetEnvironment createMIGDBSetEnvironment(String[] params) { - return new MIGDBSetEnvironment(getMIVersion(), params); - } - - public CLIExecAbort createCLIExecAbort() { - return new CLIExecAbort(); - } - - public MIExecArguments createMIExecArguments(String[] args) { - return new MIExecArguments(getMIVersion(), args); - } - - public MIExecContinue createMIExecContinue() { - return new MIExecContinue(getMIVersion()); - } - - public MIExecFinish createMIExecFinish() { - return new MIExecFinish(getMIVersion()); - } - - public MIExecInterrupt createMIExecInterrupt() { - // return null here to signal that we do not support - // -exec-interrupt and to use to drop a signal to gdb - // instead via the MIProcess class - return null; - } - - public MIExecNext createMIExecNext(int count) { - return new MIExecNext(getMIVersion(), count); - } - - public MIExecNextInstruction createMIExecNextInstruction(int count) { - return new MIExecNextInstruction(getMIVersion(), count); - } - - public MIExecReturn createMIExecReturn() { - return new MIExecReturn(getMIVersion()); - } - - public MIExecReturn createMIExecReturn(String arg) { - return new MIExecReturn(getMIVersion(), arg); - } - - public MIExecRun createMIExecRun(String[] args) { - return new MIExecRun(getMIVersion(), args); - } - - public MIExecStep createMIExecStep(int count) { - return new MIExecStep(getMIVersion(), count); - } - - public MIExecStepInstruction createMIExecStepInstruction(int count) { - return new MIExecStepInstruction(getMIVersion(), count); - } - - public MIExecUntil createMIExecUntil(String location) { - return new MIExecUntil(getMIVersion(), location); - } - - public CLIJump createCLIJump(String location) { - return new CLIJump(location); - } - - public MIFileExecFile createMIFileExecFile(String file) { - return new MIFileExecFile(getMIVersion(), file); - } - - public MIFileSymbolFile createMIFileSymbolFile(String file) { - return new MIFileSymbolFile(getMIVersion(), file); - } - - public MIGDBExit createMIGDBExit() { - return new MIGDBExit(getMIVersion()); - } - - public MIGDBSet createMIGDBSet(String[] params) { - return new MIGDBSet(getMIVersion(), params); - } - - public MIGDBSetAutoSolib createMIGDBSetAutoSolib(boolean set) { - return new MIGDBSetAutoSolib(getMIVersion(), set); - } - - public MIGDBSetStopOnSolibEvents createMIGDBSetStopOnSolibEvents(boolean set) { - return new MIGDBSetStopOnSolibEvents(getMIVersion(), set); - } - - public MIGDBSetSolibSearchPath createMIGDBSetSolibSearchPath(String[] params) { - return new MIGDBSetSolibSearchPath(getMIVersion(), params); - } - - public MIGDBSetBreakpointPending createMIGDBSetBreakpointPending(boolean set) { - return new MIGDBSetBreakpointPending(getMIVersion(), set); - } - - public MIGDBShow createMIGDBShow(String[] params) { - return new MIGDBShow(getMIVersion(), params); - } - - public MIGDBShowPrompt createMIGDBShowPrompt() { - return new MIGDBShowPrompt(getMIVersion()); - } - - public MIGDBShowExitCode createMIGDBShowExitCode() { - return new MIGDBShowExitCode(getMIVersion()); - } - - public MIGDBShowDirectories createMIGDBShowDirectories() { - return new MIGDBShowDirectories(getMIVersion()); - } - - public MIGDBShowSolibSearchPath createMIGDBShowSolibSearchPath() { - return new MIGDBShowSolibSearchPath(getMIVersion()); - } - - public MIGDBShowAddressSize createMIGDBShowAddressSize() { - return new MIGDBShowAddressSize(getMIVersion()); - } - - public MIGDBShowEndian createMIGDBShowEndian() { - return new MIGDBShowEndian(getMIVersion()); - } - - public MIStackInfoDepth createMIStackInfoDepth() { - return new MIStackInfoDepth(getMIVersion()); - } - - public MIStackInfoDepth createMIStackInfoDepth(int depth) { - return new MIStackInfoDepth(getMIVersion(), depth); - } - - public MIStackListArguments createMIStackListArguments(boolean showValue) { - return new MIStackListArguments(getMIVersion(), showValue); - } - - public MIStackListArguments createMIStackListArguments(boolean showValue, int lowFrame, int highFrame) { - return new MIStackListArguments(getMIVersion(), showValue, lowFrame, highFrame); - } - - public MIStackListFrames createMIStackListFrames() { - return new MIStackListFrames(getMIVersion()); - } - - public MIStackListFrames createMIStackListFrames(int lowFrame, int highFrame) { - return new MIStackListFrames(getMIVersion(), lowFrame, highFrame); - } - - public MIStackListLocals createMIStackListLocals(boolean showValues) { - return new MIStackListLocals(getMIVersion(), showValues); - } - - public MIStackSelectFrame createMIStackSelectFrame(int frameNum) { - return new MIStackSelectFrame(getMIVersion(), frameNum); - } - - public CLITargetAttach createCLITargetAttach(int pid) { - return new CLITargetAttach(pid); - } - - public MITargetDetach createMITargetDetach() { - return new MITargetDetach(getMIVersion()); - } - - public MITargetDownload createMITargetDownload(String file) { - return new MITargetDownload(getMIVersion(), file); - } - - public MITargetSelect createMITargetSelect(String[] params) { - return new MITargetSelect(getMIVersion(), params); - } - - public MIThreadListIds createMIThreadListIds() { - return new MIThreadListIds(getMIVersion()); - } - - public CLIInfoThreads createCLIInfoThreads() { - return new CLIInfoThreads(); - } - - public MIThreadSelect createMIThreadSelect(int threadNum) { - return new MIThreadSelect(getMIVersion(), threadNum); - } - - public CLIInfoSharedLibrary createCLIInfoSharedLibrary() { - return new CLIInfoSharedLibrary(); - } - - public CLISharedLibrary createCLISharedLibrary() { - return new CLISharedLibrary(); - } - - public CLISharedLibrary createCLISharedLibrary(String name) { - return new CLISharedLibrary(name); - } - - public CLIWhatis createCLIWhatis(String name) { - return new CLIWhatis(name); - } - - public CLIInfoSignals createCLIInfoSignals() { - return new CLIInfoSignals(); - } - - public CLIInfoSignals createCLIInfoSignals(String name) { - return new CLIInfoSignals(name); - } - - public CLIHandle createCLIHandle(String arg) { - return new CLIHandle(arg); - } - - public CLISignal createCLISignal(String arg) { - return new CLISignal(arg); - } - - public CLIPType createCLIPType(String name) { - return new CLIPType(name); - } - - public CLIInfoProgram createCLIInfoProgram() { - return new CLIInfoProgram(); - } - - public MIVarCreate createMIVarCreate(String expression) { - return new MIVarCreate(getMIVersion(), expression); - } - - public MIVarCreate createMIVarCreate(String name, String frameAddr, String expression) { - return new MIVarCreate(getMIVersion(), name, frameAddr, expression); - } - - public MIVarDelete createMIVarDelete(String name) { - return new MIVarDelete(getMIVersion(), name); - } - - public MIVarSetFormat createMIVarSetFormat(String name, int format) { - return new MIVarSetFormat(getMIVersion(), name, format); - } - - public MIVarShowFormat createMIVarShowFormat(String name) { - return new MIVarShowFormat(getMIVersion(), name); - } - - public MIVarInfoNumChildren createMIVarInfoNumChildren(String name) { - return new MIVarInfoNumChildren(getMIVersion(), name); - } - - public MIVarListChildren createMIVarListChildren(String name) { - return new MIVarListChildren(getMIVersion(), name); - } - - public MIVarInfoType createMIVarInfoType(String name) { - return new MIVarInfoType(getMIVersion(), name); - } - - public MIVarInfoExpression createMIVarInfoExpression(String name) { - return new MIVarInfoExpression(getMIVersion(), name); - } - - public MIVarShowAttributes createMIVarShowAttributes(String name) { - return new MIVarShowAttributes(getMIVersion(), name); - } - - public MIVarEvaluateExpression createMIVarEvaluateExpression(String name) { - return new MIVarEvaluateExpression(getMIVersion(), name); - } - - public MIVarAssign createMIVarAssign(String name, String expr) { - return new MIVarAssign(getMIVersion(), name, expr); - } - - public MIVarUpdate createMIVarUpdate() { - return new MIVarUpdate(getMIVersion()); - } - - public MIVarUpdate createMIVarUpdate(String name) { - return new MIVarUpdate(getMIVersion(), name); - } - - public MIInterpreterExecConsole createMIInterpreterExecConsole(String cmd) { - return new MIInterpreterExecConsole(getMIVersion(), cmd); - } - - public MIGDBSetNewConsole createMIGDBSetNewConsole() { - return new MIGDBSetNewConsole(getMIVersion()); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakAfter.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakAfter.java deleted file mode 100644 index 781dea80b15..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakAfter.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - - - -/** - * - * -break-after NUMBER COUNT - * The breakpoint number NUMBER is not in effect until it has been hit - * COUNT times. - * - * Result: - * ^done - * - */ -public class MIBreakAfter extends MICommand -{ - public MIBreakAfter(String miVersion, int brknum, int count) { - super(miVersion, "-break-after",new String[]{Integer.toString(brknum), //$NON-NLS-1$ - Integer.toString(count)}); - - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakCondition.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakCondition.java deleted file mode 100644 index 898e681d19c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakCondition.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * - * -break-condition NUMBER EXPR - * - * Breakpoint NUMBER will stop the program only if the condition in - * EXPR is true. The condition becomes part of the `-break-list' output - * Result: - * ^done - */ -public class MIBreakCondition extends MICommand { - public MIBreakCondition(String miVersion, int brknum, String expr) { - super(miVersion, "-break-condition", new String[] { Integer.toString(brknum), expr }); //$NON-NLS-1$ - } - - /** - * Do not do any munging on the string i.e. quoting spaces - * etc .. doing this will break the command -break-condition. - */ - protected String parametersToString() { - String[] parameters = getParameters(); - StringBuffer buffer = new StringBuffer(); - for (int i = 0; i < parameters.length; i++) { - buffer.append(' ').append(parameters[i]); - } - return buffer.toString().trim(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakDelete.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakDelete.java deleted file mode 100644 index 1df2f8608b2..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakDelete.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -break-delete ( BREAKPOINT )+ - * - * Delete the breakpoint(s) whose number(s) are specified in the - * argument list. This is obviously reflected in the breakpoint list. - * - * Result: - * ^done - * - */ -public class MIBreakDelete extends MICommand -{ - 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++) { - brkids[i] = Integer.toString(array[i]); - } - setParameters(brkids); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakDisable.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakDisable.java deleted file mode 100644 index 7962b3f9620..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakDisable.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -break-disable ( BREAKPOINT )+ - * - * Disable the named BREAKPOINT(s). The field `enabled' in the break - * list is now set to `n' for the named BREAKPOINT(s). - * - * Result: - * ^done - */ -public class MIBreakDisable extends MICommand -{ - 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++) { - brkids[i] = Integer.toString(array[i]); - } - setParameters(brkids); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakEnable.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakEnable.java deleted file mode 100644 index 8ddc4c2e291..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakEnable.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -break-enable ( BREAKPOINT )+ - * - * Enable (previously disabled) BREAKPOINT(s). - * - * Result: - * ^done - */ -public class MIBreakEnable extends MICommand -{ - 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++) { - brkids[i] = Integer.toString(array[i]); - } - setParameters(brkids); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakInsert.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakInsert.java deleted file mode 100644 index c337fc791ef..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakInsert.java +++ /dev/null @@ -1,137 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIBreakInsertInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -break-insert [ -t ] [ -h ] [ -r ] - * [ -c CONDITION ] [ -i IGNORE-COUNT ] - * [ -p THREAD ] [ LINE | ADDR ] - * - * If specified, LINE, can be one of: - * - * * function - * - * * filename:linenum - * - * * filename:function - * - * * *address - * - * The possible optional parameters of this command are: - * - * `-t' - * Insert a tempoary breakpoint. - * - * `-h' - * Insert a hardware breakpoint. - * - * `-c CONDITION' - * Make the breakpoint conditional on CONDITION. - * - * `-i IGNORE-COUNT' - * Initialize the IGNORE-COUNT. - * - * `-r' - * - * Insert a regular breakpoint in all the functions whose names match - * the given regular expression. Other flags are not applicable to - * regular expresson. - * - * The result is in the form: - * - * ^done,bkptno="NUMBER",func="FUNCNAME", - * file="FILENAME",line="LINENO" - * - */ -public class MIBreakInsert extends MICommand -{ - public MIBreakInsert(String miVersion, String func) { - this(miVersion, false, false, null, 0, func, 0); - } - - public MIBreakInsert(String miVersion, boolean isTemporary, boolean isHardware, - String condition, int ignoreCount, String line, int tid) { - super(miVersion, "-break-insert"); //$NON-NLS-1$ - - int i = 0; - if (isTemporary) { - i++; - } - if (isHardware) { - i++; - } - if (condition != null && condition.length() > 0) { - i += 2; - } - if (ignoreCount > 0) { - i += 2; - } - if (tid > 0) { - i += 2; - } - String[] opts = new String[i]; - - i = 0; - if (isTemporary) { - opts[i] = "-t"; //$NON-NLS-1$ - i++; - } - if (isHardware) { - opts[i] = "-h"; //$NON-NLS-1$ - i++; - } - if (condition != null && condition.length() > 0) { - opts[i] = "-c"; //$NON-NLS-1$ - i++; - opts[i] = condition; - i++; - } - if (ignoreCount > 0) { - opts[i] = "-i"; //$NON-NLS-1$ - i++; - opts[i] = Integer.toString(ignoreCount); - i++; - } - if (tid > 0) { - opts[i] = "-p"; //$NON-NLS-1$ - i++; - opts[i] = Integer.toString(tid); - } - - if (opts.length > 0) { - setOptions(opts); - } - setParameters(new String[]{line}); - } - - public MIBreakInsertInfo getMIBreakInsertInfo() throws MIException { - return (MIBreakInsertInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIBreakInsertInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakList.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakList.java deleted file mode 100644 index 54aa279b5e6..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakList.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIBreakListInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -break-list - * - * Displays the list of inserted breakpoints, showing the following - * fields: - * - * `Number' - * number of the breakpoint - * - * `Type' - * type of the breakpoint: `breakpoint' or `watchpoint' - * - * `Disposition' - * should the breakpoint be deleted or disabled when it is hit: `keep' - * or `nokeep' - * - * `Enabled' - * is the breakpoint enabled or no: `y' or `n' - * - * `Address' - * memory location at which the breakpoint is set - * - * `What' - * logical location of the breakpoint, expressed by function name, - * - * `Times' - * number of times the breakpoint has been hit - * - * If there are no breakpoints or watchpoints, the `BreakpointTable' - * `body' field is an empty list. - * - */ -public class MIBreakList extends MICommand -{ - public MIBreakList (String miVersion) { - super(miVersion, "-break-list"); //$NON-NLS-1$ - } - - public MIBreakListInfo getMIBreakListInfo() throws MIException { - return (MIBreakListInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIBreakListInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakWatch.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakWatch.java deleted file mode 100644 index b35de309305..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakWatch.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIBreakWatchInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -break-watch [ -a | -r ] - * - * Create a watchpoint. With the `-a' option it will create an - * "access" watchpoint, i.e. a watchpoint that triggers either on a read - * from or on a write to the memory location. With the `-r' option, the - * watchpoint created is a "read" watchpoint, i.e. it will trigger only - * when the memory location is accessed for reading. Without either of - * the options, the watchpoint created is a regular watchpoint, i.e. it - * will trigger when the memory location is accessed for writing. - * - */ -public class MIBreakWatch extends MICommand -{ - 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$ - } else if (read) { - opts = new String[] {"-r"}; //$NON-NLS-1$ - } - if (opts != null) { - setOptions(opts); - } - setParameters(new String[]{expr}); - } - - public MIBreakWatchInfo getMIBreakWatchInfo() throws MIException { - return (MIBreakWatchInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIBreakWatchInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MICommand.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MICommand.java deleted file mode 100644 index 395090c49af..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MICommand.java +++ /dev/null @@ -1,207 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * Represents a MI command. - */ -public class MICommand extends Command { - final static String[] empty = new String[0]; - String[] fOptions = empty; - String[] fParameters = empty; - String fOperation = new String(); - String fMIVersion; - - public MICommand(String miVersion, String oper) { - this(miVersion, oper, empty); - } - - public MICommand(String miVersion, String oper, String[] params) { - this(miVersion, oper, empty, params); - } - - public MICommand(String miVersion, String oper, String[] opt, String[] params) { - fMIVersion = miVersion; - fOperation = oper; - fOptions = opt; - fParameters = 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 MIVersion.MI1.equalsIgnoreCase(fMIVersion); - } - - /** - * whether the MI version is "mi2" - * @return - */ - public boolean isMI2() { - return MIVersion.MI2.equalsIgnoreCase(fMIVersion); - } - - /** - * Returns the operation of this command. - * - * @return the operation of this command - */ - public String getOperation() { - return fOperation; - } - - protected void setOperation(String op) { - fOperation = op; - } - - /** - * 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 fOptions; - } - - public void setOptions(String[] opt) { - fOptions = opt; - } - - /** - * 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 fParameters; - } - - public void setParameters(String[] p) { - fParameters = p; - } - - protected String optionsToString() { - String[] options = getOptions(); - StringBuffer sb = new StringBuffer(); - if (options != null && options.length > 0) { - for (int i = 0; i < options.length; i++) { - String option = options[i]; - // If the option argument contains " or \ it must be escaped - if (option.indexOf('"') != -1 || option.indexOf('\\') != -1) { - StringBuffer buf = new StringBuffer(); - for (int j = 0; j < option.length(); j++) { - char c = option.charAt(j); - if (c == '"' || c == '\\') { - buf.append('\\'); - } - buf.append(c); - } - option = buf.toString(); - } - - // If the option contains a space according to - // GDB/MI spec we must surround it with double quotes. - if (option.indexOf('\t') != -1 || option.indexOf(' ') != -1) { - sb.append(' ').append('"').append(option).append('"'); - } else { - sb.append(' ').append(option); - } - } - } - return sb.toString().trim(); - } - - protected String parametersToString() { - String[] parameters = getParameters(); - String[] options = getOptions(); - StringBuffer buffer = new StringBuffer(); - if (parameters != null && parameters.length > 0) { - // According to GDB/MI spec - // Add a "--" separator if any parameters start with "-" - if (options != null && options.length > 0) { - for (int i = 0; i < parameters.length; i++) { - if (parameters[i].startsWith("-")) { //$NON-NLS-1$ - buffer.append('-').append('-'); - break; - } - } - } - - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < parameters.length; i++) { - // We need to escape the double quotes and the backslash. - sb.setLength(0); - String param = parameters[i]; - for (int j = 0; j < param.length(); j++) { - char c = param.charAt(j); - if (c == '"' || c == '\\') { - sb.append('\\'); - } - sb.append(c); - } - - // If the string contains spaces instead of escaping - // surround the parameter with double quotes. - if (containsWhitespace(param)) { - sb.insert(0, '"'); - sb.append('"'); - } - buffer.append(' ').append(sb); - } - } - return buffer.toString().trim(); - } - - public String toString() { - StringBuffer command = new StringBuffer(getToken() + getOperation()); - String opt = optionsToString(); - if (opt.length() > 0) { - command.append(' ').append(opt); - } - String p = parametersToString(); - if (p.length() > 0) { - command.append(' ').append(p); - } - command.append('\n'); - return command.toString(); - } - - protected boolean containsWhitespace(String s) { - for (int i = 0; i < s.length(); i++) { - if (Character.isWhitespace(s.charAt(i))) { - return true; - } - } - return false; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataDisassemble.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataDisassemble.java deleted file mode 100644 index e112576e753..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataDisassemble.java +++ /dev/null @@ -1,123 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIDataDisassembleInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -data-disassemble - * [ -s START-ADDR -e END-ADDR ] - * | [ -f FILENAME -l LINENUM [ -n LINES ] ] - * -- MODE - * - *Where: - * - *`START-ADDR' - * is the beginning address (or `$pc') - * - *`END-ADDR' - * is the end address - * - *`FILENAME' - * is the name of the file to disassemble - * - *`LINENUM' - * is the line number to disassemble around - * - *`LINES' - * is the the number of disassembly lines to be produced. If it is - * -1, the whole function will be disassembled, in case no END-ADDR is - * specified. If END-ADDR is specified as a non-zero value, and - * LINES is lower than the number of disassembly lines between - * START-ADDR and END-ADDR, only LINES lines are displayed; if LINES - * is higher than the number of lines between START-ADDR and - * END-ADDR, only the lines up to END-ADDR are displayed. - * - *`MODE' - * is either 0 (meaning only disassembly) or 1 (meaning mixed source - * and disassembly). - * - *Result - *...... - * - * The output for each instruction is composed of four fields: - * - * * Address - * - * * Func-name - * - * * Offset - * - * * Instruction - * - * Note that whatever included in the instruction field, is not - *manipulated directely by GDB/MI, i.e. it is not possible to adjust its - *format. - * - * - */ -public class MIDataDisassemble extends MICommand -{ - 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) { - mixed = "1"; //$NON-NLS-1$ - } - setParameters(new String[]{mixed}); - } - - 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$ - if (mode) { - mixed = "1"; //$NON-NLS-1$ - } - setParameters(new String[]{mixed}); - } - - public MIDataDisassembleInfo getMIDataDisassembleInfo() throws MIException { - return (MIDataDisassembleInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIDataDisassembleInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } - - /* - * GDB the -data-disassemble uses "--" as a separator wit only the MODE - * So override the MICommand - */ - protected String parametersToString() { - String[] parameters = getParameters(); - if (parameters != null && parameters.length > 0) { - return "-- " + parameters[0]; //$NON-NLS-1$ - } - return new String(); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataEvaluateExpression.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataEvaluateExpression.java deleted file mode 100644 index 69a58b38e30..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataEvaluateExpression.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIDataEvaluateExpressionInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -data-evaluate-expression EXPR - * - * Evaluate EXPR as an expression. The expression could contain an - *inferior function call. The function call will execute synchronously. - *If the expression contains spaces, it must be enclosed in double quotes. - * - */ -public class MIDataEvaluateExpression extends MICommand -{ - public MIDataEvaluateExpression(String miVersion, String expr) { - super(miVersion, "-data-evaluate-expression", new String[]{expr}); //$NON-NLS-1$ - } - - public MIDataEvaluateExpressionInfo getMIDataEvaluateExpressionInfo() throws MIException { - return (MIDataEvaluateExpressionInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIDataEvaluateExpressionInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataListChangedRegisters.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataListChangedRegisters.java deleted file mode 100644 index 08408f43ba2..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataListChangedRegisters.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIDataListChangedRegistersInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -data-list-changed-registers - * - * Display a list of the registers that have changed. - * - */ -public class MIDataListChangedRegisters extends MICommand -{ - public MIDataListChangedRegisters(String miVersion) { - super(miVersion, "-data-list-changed-registers" ); //$NON-NLS-1$ - } - - public MIDataListChangedRegistersInfo getMIDataListChangedRegistersInfo() throws MIException { - return (MIDataListChangedRegistersInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIDataListChangedRegistersInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataListRegisterNames.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataListRegisterNames.java deleted file mode 100644 index 44c9d53afe0..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataListRegisterNames.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIDataListRegisterNamesInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -data-list-register-names [ ( REGNO )+ ] - * - * Show a list of register names for the current target. If no - * arguments are given, it shows a list of the names of all the registers. - * If integer numbers are given as arguments, it will print a list of the - * names of the registers corresponding to the arguments. To ensure - * consistency between a register name and its number, the output list may - * include empty register names. - * - */ -public class MIDataListRegisterNames extends MICommand -{ - public MIDataListRegisterNames(String miVersion) { - super(miVersion, "-data-list-register-names"); //$NON-NLS-1$ - } - - 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++) { - array[i] = Integer.toString(regnos[i]); - } - setParameters(array); - } - } - - public MIDataListRegisterNamesInfo getMIDataListRegisterNamesInfo() throws MIException { - return (MIDataListRegisterNamesInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIDataListRegisterNamesInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataListRegisterValues.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataListRegisterValues.java deleted file mode 100644 index 2a255572c69..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataListRegisterValues.java +++ /dev/null @@ -1,94 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MIFormat; -import org.eclipse.cdt.debug.mi.core.output.MIDataListRegisterValuesInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -data-list-register-values FMT [ ( REGNO )*] - * - * Display the registers' contents. FMT is the format according to - * which the registers' contents are to be returned, followed by an - * optional list of numbers specifying the registers to display. A - * missing list of numbers indicates that the contents of all the - * registers must be returned. - * - */ -public class MIDataListRegisterValues extends MICommand -{ - public MIDataListRegisterValues(String miVersion, int fmt) { - this(miVersion, fmt, null); - } - - 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) { - case MIFormat.NATURAL: - format = "N"; //$NON-NLS-1$ - break; - - case MIFormat.RAW: - format = "r"; //$NON-NLS-1$ - break; - - case MIFormat.DECIMAL: - format = "d"; //$NON-NLS-1$ - break; - - case MIFormat.BINARY: - format = "t"; //$NON-NLS-1$ - break; - - case MIFormat.OCTAL: - format = "o"; //$NON-NLS-1$ - break; - - case MIFormat.HEXADECIMAL: - default: - format = "x"; //$NON-NLS-1$ - break; - } - - setOptions(new String[]{format}); - - if (regnos != null && regnos.length > 0) { - String[] array = new String[regnos.length]; - for (int i = 0; i < regnos.length; i++) { - array[i] = Integer.toString(regnos[i]); - } - setParameters(array); - } - } - - public MIDataListRegisterValuesInfo getMIDataListRegisterValuesInfo() throws MIException { - return (MIDataListRegisterValuesInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIDataListRegisterValuesInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataReadMemory.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataReadMemory.java deleted file mode 100644 index 26edb1590ec..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataReadMemory.java +++ /dev/null @@ -1,153 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MIFormat; -import org.eclipse.cdt.debug.mi.core.output.MIDataReadMemoryInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -data-read-memory [ -o BYTE-OFFSET ] - * ADDRESS WORD-FORMAT WORD-SIZE - * NR-ROWS NR-COLS [ ASCHAR ] - * - * where: - * - * `ADDRESS' - * An expression specifying the address of the first memory word to be - * read. Complex expressions containing embedded white space should - * be quoted using the C convention. - * - * `WORD-FORMAT' - * The format to be used to print the memory words. The notation is - * the same as for GDB's `print' command (*note Output formats: - * Output Formats.). - * - * `WORD-SIZE' - * The size of each memory word in bytes. - * - * `NR-ROWS' - * The number of rows in the output table. - * - * `NR-COLS' - * The number of columns in the output table. - * - * `ASCHAR' - * If present, indicates that each row should include an ASCII dump. - * The value of ASCHAR is used as a padding character when a byte is - * not a member of the printable ASCII character set (printable ASCII - * characters are those whose code is between 32 and 126, - * inclusively). - * - * `BYTE-OFFSET' - * - * - */ -public class MIDataReadMemory extends MICommand { - - public MIDataReadMemory( - String miVersion, - long offset, - String address, - int wordFormat, - int wordSize, - int rows, - int cols, - Character asChar) { - super(miVersion, "-data-read-memory"); //$NON-NLS-1$ - if (offset != 0) { - setOptions(new String[] { "-o", Long.toString(offset)}); //$NON-NLS-1$ - } - - String format = "x"; //$NON-NLS-1$ - switch (wordFormat) { - case MIFormat.UNSIGNED : - format = "u"; //$NON-NLS-1$ - break; - - case MIFormat.FLOAT : - format = "f"; //$NON-NLS-1$ - break; - - case MIFormat.ADDRESS : - format = "a"; //$NON-NLS-1$ - break; - - case MIFormat.INSTRUCTION : - format = "i"; //$NON-NLS-1$ - break; - - case MIFormat.CHAR : - format = "c"; //$NON-NLS-1$ - break; - - case MIFormat.STRING : - format = "s"; //$NON-NLS-1$ - break; - - case MIFormat.DECIMAL : - format = "d"; //$NON-NLS-1$ - break; - - case MIFormat.BINARY : - format = "t"; //$NON-NLS-1$ - break; - - case MIFormat.OCTAL : - format = "o"; //$NON-NLS-1$ - break; - - case MIFormat.HEXADECIMAL : - default : - format = "x"; //$NON-NLS-1$ - break; - } - - if (asChar == null) { - setParameters( - new String[] { - address, - format, - Integer.toString(wordSize), - Integer.toString(rows), - Integer.toString(cols)}); - } else { - setParameters( - new String[] { - address, - format, - Integer.toString(wordSize), - Integer.toString(rows), - Integer.toString(cols), - asChar.toString()}); - } - } - - public MIDataReadMemoryInfo getMIDataReadMemoryInfo() throws MIException { - return (MIDataReadMemoryInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIDataReadMemoryInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataWriteMemory.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataWriteMemory.java deleted file mode 100644 index cbb75c377a6..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataWriteMemory.java +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIFormat; - -/** - * - * -data-write-memory [-o COLUMN_OFFSET] ADDR FORMAT WORD-SIZE VALUE."); - * - * where: - * - * DATA-MEMORY-WRITE: - * - * COLUMN_OFFSET: optional argument. Must be preceeded by '-o'. The - * offset from the beginning of the memory grid row where the cell to - * be written is. - * ADDR: start address of the row in the memory grid where the memory - * cell is, if OFFSET_COLUMN is specified. Otherwise, the address of - * the location to write to. - * FORMAT: a char indicating format for the ``word''. See - * the ``x'' command. - * WORD_SIZE: size of each ``word''; 1,2,4, or 8 bytes - * VALUE: value to be written into the memory address. - * - * Writes VALUE into ADDR + (COLUMN_OFFSET * WORD_SIZE). - * - * Prints nothing. - * - */ -public class MIDataWriteMemory extends MICommand { - - public MIDataWriteMemory(String miVersion, long offset, String address, int wordFormat, int wordSize, - String value) { - - super (miVersion, "-data-write-memory"); //$NON-NLS-1$ - - if (offset != 0) { - setOptions(new String[] { "-o", Long.toString(offset)}); //$NON-NLS-1$ - } - - String format = "x"; //$NON-NLS-1$ - switch (wordFormat) { - case MIFormat.UNSIGNED : - format = "u"; //$NON-NLS-1$ - break; - - case MIFormat.FLOAT : - format = "f"; //$NON-NLS-1$ - break; - - case MIFormat.ADDRESS : - format = "a"; //$NON-NLS-1$ - break; - - case MIFormat.INSTRUCTION : - format = "i"; //$NON-NLS-1$ - break; - - case MIFormat.CHAR : - format = "c"; //$NON-NLS-1$ - break; - - case MIFormat.STRING : - format = "s"; //$NON-NLS-1$ - break; - - case MIFormat.DECIMAL : - format = "d"; //$NON-NLS-1$ - break; - - case MIFormat.BINARY : - format = "t"; //$NON-NLS-1$ - break; - - case MIFormat.OCTAL : - format = "o"; //$NON-NLS-1$ - break; - - case MIFormat.HEXADECIMAL : - default : - format = "x"; //$NON-NLS-1$ - break; - } - - setParameters(new String[] {address, format, Integer.toString(wordSize), value}); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataWriteRegisterValues.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataWriteRegisterValues.java deleted file mode 100644 index f9c9a813f52..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataWriteRegisterValues.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.debug.mi.core.MIFormat; - -/** - * - * Write given values into registers. The registers and values are - * given as pairs. The corresponding MI command is - * -data-write-register-values <format> [<regnum1> <value1>...<regnumN> <valueN>] - * - */ -public class MIDataWriteRegisterValues extends MICommand { - - 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) { - case MIFormat.NATURAL: - format = "N"; //$NON-NLS-1$ - break; - - case MIFormat.RAW: - format = "r"; //$NON-NLS-1$ - break; - - case MIFormat.DECIMAL: - format = "d"; //$NON-NLS-1$ - break; - - case MIFormat.BINARY: - format = "t"; //$NON-NLS-1$ - break; - - case MIFormat.OCTAL: - format = "o"; //$NON-NLS-1$ - break; - - case MIFormat.HEXADECIMAL: - default: - format = "x"; //$NON-NLS-1$ - break; - } - - setOptions(new String[]{format}); - - if (regnos != null && values != null) { - List aList = new ArrayList(regnos.length); - for (int i = 0; i < regnos.length && i < values.length; i++) { - aList.add(Integer.toString(regnos[i])); - aList.add(values[i]); - } - String[] array = (String[])aList.toArray(new String[0]); - setParameters(array); - } - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentCD.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentCD.java deleted file mode 100644 index 878eda88b63..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentCD.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * - * -environment-cd PATHDIR - * - * Set GDB's working directory. - * - * - */ -public class MIEnvironmentCD extends MICommand -{ - public MIEnvironmentCD(String miVersion, String path) { - super(miVersion, "-environment-cd", new String[]{path}); //$NON-NLS-1$ - } - - /** - * !@*^%^$( sigh ... gdb for this command does not make any interpretation - * So we must past the command verbatim without any changes. - * (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.MICommand#parametersToString() - */ - protected String parametersToString() { - String[] parameters = getParameters(); - if (parameters != null && parameters.length == 1) { - return parameters[0]; - } - return super.parametersToString(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentDirectory.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentDirectory.java deleted file mode 100644 index f91b751412f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentDirectory.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -environment-directory PATHDIR - * - * Add directory PATHDIR to beginning of search path for source files. - * - */ -public class MIEnvironmentDirectory extends MICommand -{ - 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$ - } - } - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentPWD.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentPWD.java deleted file mode 100644 index 2d18cf1a721..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentPWD.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIEnvironmentPWDInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -environment-pwd - * - * Show the current working directory. - * - */ -public class MIEnvironmentPWD extends MICommand -{ - public MIEnvironmentPWD(String miVersion) { - super(miVersion, "-environment-pwd"); //$NON-NLS-1$ - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIEnvironmentPWDInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentPath.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentPath.java deleted file mode 100644 index 6417c2299cb..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentPath.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -environment-path ( PATHDIR )+ - * - * Add directories PATHDIR to beginning of search path for object files. - * - */ -public class MIEnvironmentPath extends MICommand -{ - public MIEnvironmentPath(String miVersion, String[] paths) { - super(miVersion, "-environment-path", paths); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecArguments.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecArguments.java deleted file mode 100644 index b92ac6141dd..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecArguments.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -exec-arguments ARGS - * - * Set the inferior program arguments, to be used in the next - * `-exec-run'. - * - */ -public class MIExecArguments extends MICommand -{ - public MIExecArguments(String miVersion, String[] args) { - super(miVersion, "-exec-arguments", args); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecContinue.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecContinue.java deleted file mode 100644 index 083b20f132d..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecContinue.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -exec-continue - * - * Asynchronous command. Resumes the execution of the inferior program - * until a breakpoint is encountered, or until the inferior exits. - * - */ -public class MIExecContinue extends MICommand -{ - public MIExecContinue(String miVersion) { - super(miVersion, "-exec-continue"); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecFinish.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecFinish.java deleted file mode 100644 index dd5f2c48398..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecFinish.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -exec-finish - * - * Asynchronous command. Resumes the execution of the inferior program - * until the current function is exited. Displays the results returned by - * the function. - * - */ -public class MIExecFinish extends MICommand -{ - public MIExecFinish(String miVersion) { - super(miVersion, "-exec-finish"); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecInterrupt.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecInterrupt.java deleted file mode 100644 index 1e0702de0bc..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecInterrupt.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -exec-interrupt - * - * Asynchronous command. Interrupts the background execution of the - * target. Note how the token associated with the stop message is the one - * for the execution command that has been interrupted. The token for the - * interrupt itself only appears in the `^done' output. If the user is - * trying to interrupt a non-running program, an error message will be - * printed. - * - */ -public class MIExecInterrupt extends MICommand -{ - public MIExecInterrupt(String miVersion) { - super(miVersion, "-exec-interrupt"); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecNext.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecNext.java deleted file mode 100644 index bf2cca380dd..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecNext.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -exec-next - * - * Asynchronous command. Resumes execution of the inferior program, - * stopping when the beginning of the next source line is reached. - * - */ -public class MIExecNext extends MICommand -{ - public MIExecNext(String miVersion) { - super(miVersion, "-exec-next"); //$NON-NLS-1$ - } - - public MIExecNext(String miVersion, int count) { - super(miVersion, "-exec-next", new String[] { Integer.toString(count) }); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecNextInstruction.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecNextInstruction.java deleted file mode 100644 index 9939966b04e..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecNextInstruction.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -exec-next-instruction - * - * Asynchronous command. Executes one machine instruction. If the - * instruction is a function call continues until the function returns. If - * the program stops at an instruction in the middle of a source line, the - * address will be printed as well. - * - */ -public class MIExecNextInstruction extends MICommand -{ - public MIExecNextInstruction(String miVersion) { - super(miVersion, "-exec-next-instruction"); //$NON-NLS-1$ - } - - public MIExecNextInstruction(String miVersion, int count) { - super(miVersion, "-exec-next-instruction", new String[] { Integer.toString(count) }); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecReturn.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecReturn.java deleted file mode 100644 index b44432892fe..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecReturn.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -exec-return - * - * Makes current function return immediately. Doesn't execute the - * inferior. Displays the new current frame. - * - */ -public class MIExecReturn extends MICommand -{ - public MIExecReturn(String miVersion) { - super(miVersion, "-exec-return"); //$NON-NLS-1$ - } - - public MIExecReturn(String miVersion, String arg) { - super(miVersion, "-exec-run", new String[] { arg }); //$NON-NLS-1$ - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecRun.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecRun.java deleted file mode 100644 index 1ac92773191..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecRun.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -exec-run - * - * Asynchronous command. Starts execution of the inferior from the - * beginning. The inferior executes until either a breakpoint is - * encountered or the program exits. - * - */ -public class MIExecRun extends MICommand -{ - public MIExecRun(String miVersion) { - super(miVersion, "-exec-run"); //$NON-NLS-1$ - } - - public MIExecRun(String miVersion, String[] args) { - super(miVersion, "-exec-run", args); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecStep.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecStep.java deleted file mode 100644 index 86d2fb9372a..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecStep.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -exec-step - * - * Asynchronous command. Resumes execution of the inferior program, - * stopping when the beginning of the next source line is reached, if the - * next source line is not a function call. If it is, stop at the first - * instruction of the called function. - * - */ -public class MIExecStep extends MICommand -{ - public MIExecStep(String miVersion) { - super(miVersion, "-exec-step"); //$NON-NLS-1$ - } - - public MIExecStep(String miVersion, int count) { - super(miVersion, "-exec-step", new String[] { Integer.toString(count) }); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecStepInstruction.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecStepInstruction.java deleted file mode 100644 index ee4a6927c08..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecStepInstruction.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - - - -/** - * - * -exec-step-instruction - - * Asynchronous command. Resumes the inferior which executes one - * machine instruction. The output, once GDB has stopped, will vary - * depending on whether we have stopped in the middle of a source line or - * not. In the former case, the address at which the program stopped will - * be printed as well. - * - */ -public class MIExecStepInstruction extends MICommand -{ - public MIExecStepInstruction(String miVersion) { - super(miVersion, "-exec-step-instruction"); //$NON-NLS-1$ - } - - public MIExecStepInstruction(String miVersion, int count) { - super(miVersion, "-exec-step-instruction", new String[] { Integer.toString(count) }); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecUntil.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecUntil.java deleted file mode 100644 index 9bce50ab927..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIExecUntil.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -exec-until [ LOCATION ] - * - * Asynchronous command. Executes the inferior until the LOCATION - * specified in the argument is reached. If there is no argument, the - * inferior executes until a source line greater than the current one is - * reached. The reason for stopping in this case will be - * `location-reached'. - * - */ -public class MIExecUntil extends MICommand -{ - public MIExecUntil(String miVersion) { - super(miVersion, "-exec-until"); //$NON-NLS-1$ - } - - public MIExecUntil(String miVersion, String loc) { - super(miVersion, "-exec-until", new String[]{loc}); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIFileExecFile.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIFileExecFile.java deleted file mode 100644 index 7983656133d..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIFileExecFile.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -file-exec-file FILE - * - * Specify the executable file to be debugged. Unlike - * `-file-exec-and-symbols', the symbol table is _not_ read from this - * file. If used without argument, GDB clears the information about the - * executable file. No output is produced, except a completion - * notification. - * - */ -public class MIFileExecFile extends MICommand -{ - public MIFileExecFile(String miVersion, String file) { - super(miVersion, "-file-exec-file", new String[]{file}); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIFileSymbolFile.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIFileSymbolFile.java deleted file mode 100644 index cc3ef957711..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIFileSymbolFile.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -file-symbol-file FILE - * - * Read symbol table info from the specified FILE argument. When used - * without arguments, clears GDB's symbol table info. No output is - * produced, except for a completion notification. - * - */ -public class MIFileSymbolFile extends MICommand -{ - public MIFileSymbolFile(String miVersion, String file) { - super(miVersion, "-file-symbol-file", new String[]{file}); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBExit.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBExit.java deleted file mode 100644 index 44a682687f6..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBExit.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -gdb-exit - * - * Exit GDB immediately. - * - */ -public class MIGDBExit extends MICommand -{ - public MIGDBExit(String miVersion) { - super(miVersion, "-gdb-exit"); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSet.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSet.java deleted file mode 100644 index ee8daaad5b0..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSet.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -gdb-set - * - * Set an internal GDB variable. - * - */ -public class MIGDBSet extends MICommand -{ - public MIGDBSet(String miVersion, String[] params) { - super(miVersion, "-gdb-set", params); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSetAutoSolib.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSetAutoSolib.java deleted file mode 100644 index 807ebf63d59..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSetAutoSolib.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -gdb-set - * - * Set an internal GDB variable. - * - */ -public class MIGDBSetAutoSolib extends MIGDBSet { - 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$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSetBreakpointPending.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSetBreakpointPending.java deleted file mode 100644 index 6d2843a8601..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSetBreakpointPending.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 QnX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Qnx Software Systems - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * MIGDBSetBreakpointPending - * - */ -public class MIGDBSetBreakpointPending extends MIGDBSet { - - public MIGDBSetBreakpointPending(String miVersion, boolean set) { - super(miVersion, new String[] {"breakpoint", "pending", (set) ? "on" : "off"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSetEnvironment.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSetEnvironment.java deleted file mode 100644 index 87bae6b83a7..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSetEnvironment.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -gdb-set - * - * Set an internal GDB variable. - * - */ -public class MIGDBSetEnvironment extends MIGDBSet { - - 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$ - System.arraycopy(paths, 0, newPaths, 1, paths.length); - setParameters(newPaths); - } - - /** - * According to the help.: - * Set environment variable value to give the program. - * Arguments are VAR VALUE where VAR is variable name and VALUE is value. - * VALUES of environment variables are uninterpreted strings. - * This does not affect the program until the next "run" command. - * - * So pass the strings raw without interpretation. - */ - protected String parametersToString() { - String[] parameters = getParameters(); - StringBuffer buffer = new StringBuffer(); - if (parameters != null) { - for (int i = 0; i < parameters.length; i++) { - buffer.append(' ').append(parameters[i]); - } - } - return buffer.toString().trim(); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSetNewConsole.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSetNewConsole.java deleted file mode 100644 index cfb74d4fc55..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSetNewConsole.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.eclipse.cdt.debug.mi.core.command; - -public class MIGDBSetNewConsole extends MIGDBSet { - - public MIGDBSetNewConsole(String miVersion) { - super(miVersion, new String[] {"new-console"}); //$NON-NLS-1$ - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSetSolibSearchPath.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSetSolibSearchPath.java deleted file mode 100644 index f47fdabaaa0..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSetSolibSearchPath.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -gdb-set - * - * Set an internal GDB variable. - * - */ -public class MIGDBSetSolibSearchPath extends MIGDBSet { - 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(); - for (int i = 0; i < paths.length; i++) { - if (buffer.length() == 0) { - buffer.append(paths[i]); - } else { - buffer.append(sep).append(paths[i]); - } - } - String[] p = new String [] {"solib-search-path", buffer.toString()}; //$NON-NLS-1$ - setParameters(p); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSetStopOnSolibEvents.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSetStopOnSolibEvents.java deleted file mode 100644 index d52a128bee2..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSetStopOnSolibEvents.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -gdb-set stop-on-solib-events - * - * Set an internal GDB variable. - * - */ -public class MIGDBSetStopOnSolibEvents extends MIGDBSet { - - 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$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShow.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShow.java deleted file mode 100644 index 8bbf07d91ec..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShow.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIGDBShowInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -gdb-show - * - * Show the current value of a GDB variable. - * - */ -public class MIGDBShow extends MICommand { - public MIGDBShow(String miVersion, String[] params) { - super(miVersion, "-gdb-show", params); //$NON-NLS-1$ - } - - public MIGDBShowInfo getMIGDBShowInfo() throws MIException { - return (MIGDBShowInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIGDBShowInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShowAddressSize.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShowAddressSize.java deleted file mode 100644 index 0d61c5491ca..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShowAddressSize.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIGDBShowAddressSizeInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - */ -public class MIGDBShowAddressSize extends MIGDBShow { - - public MIGDBShowAddressSize (String miVersion) { - super(miVersion, new String[] { "remoteaddresssize" }); //$NON-NLS-1$ - } - - public MIInfo getMIInfo() throws MIException { - MIGDBShowAddressSizeInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIGDBShowAddressSizeInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShowDirectories.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShowDirectories.java deleted file mode 100644 index 20da64e6873..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShowDirectories.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIGDBShowDirectoriesInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -gdb-show directories - * - * Show the current value of a GDB variable(directories). - * - */ -public class MIGDBShowDirectories extends MIGDBShow { - public MIGDBShowDirectories(String miVersion) { - super(miVersion, new String[] { "directories" }); //$NON-NLS-1$ - } - - public MIGDBShowDirectoriesInfo getMIGDBShowDirectoriesInfo() throws MIException { - return (MIGDBShowDirectoriesInfo)getMIInfo(); - } - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIGDBShowDirectoriesInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShowEndian.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShowEndian.java deleted file mode 100644 index d207d834dce..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShowEndian.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.MIGDBShowEndianInfo; - -public class MIGDBShowEndian extends MIGDBShow { - - public MIGDBShowEndian(String miVersion) { - super(miVersion, new String[] {"endian"}); //$NON-NLS-1$ - } - - public MIGDBShowEndianInfo getMIShowEndianInfo() throws MIException { - return (MIGDBShowEndianInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIGDBShowEndianInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShowExitCode.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShowExitCode.java deleted file mode 100644 index d2e68e99693..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShowExitCode.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIGDBShowExitCodeInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - *-data-evaluate-expression $_exitcode - * ^done,value="10" - * - * Show the current value of a $_exitcode - * - */ -public class MIGDBShowExitCode extends MIDataEvaluateExpression { - - public MIGDBShowExitCode(String miVersion) { - super(miVersion, "$_exitcode"); //$NON-NLS-1$ - } - - public MIGDBShowExitCodeInfo getMIGDBShowExitCodeInfo() throws MIException { - return (MIGDBShowExitCodeInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIGDBShowExitCodeInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShowPrompt.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShowPrompt.java deleted file mode 100644 index b30c23e1726..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShowPrompt.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * -gdb-show prompt - */ -public class MIGDBShowPrompt extends MIGDBShow { - - /** - * @param params - */ - public MIGDBShowPrompt(String miVersion) { - super(miVersion, new String[] { "prompt" }); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShowSolibSearchPath.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShowSolibSearchPath.java deleted file mode 100644 index f44efbb5739..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBShowSolibSearchPath.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -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.MIOutput; - -/** - * - * -gdb-show directories - * - * Show the current value of a GDB variable(directories). - * - */ -public class MIGDBShowSolibSearchPath extends MIGDBShow { - public MIGDBShowSolibSearchPath(String miVersion) { - super(miVersion, new String[] { "solib-search-path" }); //$NON-NLS-1$ - } - - public MIGDBShowSolibSearchPathInfo getMIGDBShowSolibSearchPathInfo() throws MIException { - return (MIGDBShowSolibSearchPathInfo)getMIInfo(); - } - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIGDBShowSolibSearchPathInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIInterpreterExec.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIInterpreterExec.java deleted file mode 100644 index a1d0c6859a1..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIInterpreterExec.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2002, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * MIInterpreterExec - * - * -interpreter-exec - * - * -interpreter-exec interpreter command - * - * Execute the specified command in the given interpreter. - * - * -interpreter-exec console "break main" - * &"During symbol reading, couldn't parse type; debugger out of date?.\n" - * &"During symbol reading, bad structure-type format.\n" - * ~"Breakpoint 1 at 0x8074fc6: file ../../src/gdb/main.c, line 743.\n" - * ^done - * - */ -public class MIInterpreterExec extends MICommand { - - /** - * @param oper - */ - public MIInterpreterExec(String miVersion, String interpreter, String cmd) { - super(miVersion, "-interpreter-exec", new String[]{interpreter}, new String[] {cmd}); //$NON-NLS-1$ - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIInterpreterExecConsole.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIInterpreterExecConsole.java deleted file mode 100644 index f13bfc19d11..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIInterpreterExecConsole.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2002, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * MIInterpreterExecConsole - */ -public class MIInterpreterExecConsole extends MIInterpreterExec { - - /** - * @param interpreter - * @param cmd - */ - public MIInterpreterExecConsole(String miVersion, String cmd) { - super(miVersion, "console", cmd); //$NON-NLS-1$ - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIStackInfoDepth.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIStackInfoDepth.java deleted file mode 100644 index 8bb1bc5c61e..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIStackInfoDepth.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.MIStackInfoDepthInfo; - -/** - * - * -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(String miVersion) { - super(miVersion, "-stack-info-depth"); //$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 { - return (MIStackInfoDepthInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIStackInfoDepthInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIStackListArguments.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIStackListArguments.java deleted file mode 100644 index e44848574ec..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIStackListArguments.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.MIStackListArgumentsInfo; - -/** - * - * -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(String miVersion, boolean showValues) { - super(miVersion, "-stack-list-arguments"); //$NON-NLS-1$ - if (showValues) { - setParameters(new String[]{"1"}); //$NON-NLS-1$ - } else { - setParameters(new String[]{"0"}); //$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$ - } else { - params[0] = "0"; //$NON-NLS-1$ - } - params[1] = Integer.toString(low); - params[2] = Integer.toString(high); - setParameters(params); - } - - public MIStackListArgumentsInfo getMIStackListArgumentsInfo() throws MIException { - return (MIStackListArgumentsInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIStackListArgumentsInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIStackListFrames.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIStackListFrames.java deleted file mode 100644 index 701f9aeb67c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIStackListFrames.java +++ /dev/null @@ -1,78 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.MIStackListFramesInfo; - -/** - * - * -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. - * - * `FULLNAME' - * Absolute file name of the source file where the function lives. - * @since gdb 6.4 - * - * `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(String miVersion) { - super(miVersion, "-stack-list-frames"); //$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)}); - } - - public MIStackListFramesInfo getMIStackListFramesInfo() throws MIException { - return (MIStackListFramesInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIStackListFramesInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIStackListLocals.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIStackListLocals.java deleted file mode 100644 index f4136a0e5f6..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIStackListLocals.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.MIStackListLocalsInfo; - -/** - * - * -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(String miVersion, boolean printValues) { - super(miVersion, "-stack-list-locals"); //$NON-NLS-1$ - if (printValues) { - setParameters(new String[]{"1"}); //$NON-NLS-1$ - } else { - setParameters(new String[]{"0"}); //$NON-NLS-1$ - } - } - - public MIStackListLocalsInfo getMIStackListLocalsInfo() throws MIException { - return (MIStackListLocalsInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIStackListLocalsInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIStackSelectFrame.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIStackSelectFrame.java deleted file mode 100644 index dcd993762d7..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIStackSelectFrame.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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(String miVersion, int frameNum) { - super(miVersion, "-stack-select-frame", new String[]{Integer.toString(frameNum)}); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MITargetDetach.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MITargetDetach.java deleted file mode 100644 index 757c80197c9..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MITargetDetach.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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(String miVersion) { - super(miVersion, "-target-detach"); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MITargetDownload.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MITargetDownload.java deleted file mode 100644 index 972e4d1bec5..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MITargetDownload.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2002, 2005 RedHat Inc and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * RedHat Inc - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -target-download - * - * Load the executable to the remote target. This command takes no args. - * - * - * Loads the executable onto the remote target. It prints out an - * update message every half second, which includes the fields: - * - * +download,{section=".text",section-size="6668",total-size="9880"} - * +download,{section=".text",section-sent="512",section-size="6668", - * total-sent="512",total-size="9880"} - * - */ -public class MITargetDownload extends MICommand { - - public MITargetDownload(String miVersion) { - super(miVersion, "-target-download"); //$NON-NLS-1$ - } - - public MITargetDownload(String miVersion, String file) { - super(miVersion, "-target-download", new String[] { file }); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MITargetSelect.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MITargetSelect.java deleted file mode 100644 index b31d99e8e8c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MITargetSelect.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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 miVersion, String[] params) { - super(miVersion, "-target-select", params); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIThreadListIds.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIThreadListIds.java deleted file mode 100644 index 0835fce8fc8..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIThreadListIds.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.MIThreadListIdsInfo; - -/** - * - * -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(String miVersion) { - super(miVersion, "-thread-list-ids"); //$NON-NLS-1$ - } - - public MIThreadListIdsInfo getMIThreadListIdsInfo() throws MIException { - return (MIThreadListIdsInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIThreadListIdsInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIThreadSelect.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIThreadSelect.java deleted file mode 100644 index fdfdf63939e..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIThreadSelect.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.MIThreadSelectInfo; - -/** - * - * -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(String miVersion, int threadNum) { - super(miVersion, "-thread-select", new String[]{Integer.toString(threadNum)}); //$NON-NLS-1$ - } - - public MIThreadSelectInfo getMIThreadSelectInfo() throws MIException { - return (MIThreadSelectInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIThreadSelectInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarAssign.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarAssign.java deleted file mode 100644 index e70796833c8..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarAssign.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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 miVersion, String name, String expression) { - super(miVersion, "-var-assign", new String[]{name, expression}); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarCreate.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarCreate.java deleted file mode 100644 index 4660b81ee98..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarCreate.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.MIVarCreateInfo; - -/** - * - * -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 miVersion, String expression) { - this(miVersion, "-", "*", expression); //$NON-NLS-1$ //$NON-NLS-2$ - } - - public MIVarCreate(String miVersion, String name, String expression) { - this(miVersion, name, "*", 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 { - return (MIVarCreateInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIVarCreateInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarDelete.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarDelete.java deleted file mode 100644 index 4db2ad8be1a..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarDelete.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.MIVarDeleteInfo; - -/** - * - * -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 miVersion, String name) { - super(miVersion, "-var-delete", new String[]{name}); //$NON-NLS-1$ - } - - public MIVarDeleteInfo getMIVarDeleteInfo() throws MIException { - return (MIVarDeleteInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIVarDeleteInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarEvaluateExpression.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarEvaluateExpression.java deleted file mode 100644 index 9ee716f4aed..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarEvaluateExpression.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.MIVarEvaluateExpressionInfo; - -/** - * - * -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 miVersion, String expression) { - super(miVersion, "-var-evaluate-expression", new String[] { expression }); //$NON-NLS-1$ - } - - public MIVarEvaluateExpressionInfo getMIVarEvaluateExpressionInfo() - throws MIException { - return (MIVarEvaluateExpressionInfo) getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIVarEvaluateExpressionInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarInfoExpression.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarInfoExpression.java deleted file mode 100644 index cc3d1638593..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarInfoExpression.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.MIVarInfoExpressionInfo; - -/** - * - * -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 miVersion, String name) { - super(miVersion, "-var-info-expression", new String[]{name}); //$NON-NLS-1$ - } - - public MIVarInfoExpressionInfo getMIVarInfoExpressionInfo() throws MIException { - return (MIVarInfoExpressionInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIVarInfoExpressionInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarInfoNumChildren.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarInfoNumChildren.java deleted file mode 100644 index 4148217d673..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarInfoNumChildren.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.MIVarInfoNumChildrenInfo; - -/** - * - * -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 miVersion, String name) { - super(miVersion, "-var-info-num-children", new String[]{name}); //$NON-NLS-1$ - } - - public MIVarInfoNumChildrenInfo getMIVarInfoNumChildrenInfo() throws MIException { - return (MIVarInfoNumChildrenInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIVarInfoNumChildrenInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarInfoType.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarInfoType.java deleted file mode 100644 index 2c0d88b9791..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarInfoType.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.MIVarInfoTypeInfo; - -/** - * - * -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 miVersion, String name) { - super(miVersion, "-var-info-type", new String[]{name}); //$NON-NLS-1$ - } - - public MIVarInfoTypeInfo getMIVarInfoTypeInfo() throws MIException { - return (MIVarInfoTypeInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIVarInfoTypeInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarListChildren.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarListChildren.java deleted file mode 100644 index d347adee021..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarListChildren.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.MIVarListChildrenInfo; - -/** - * - * -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 miVersion, String name) { - super(miVersion, "-var-list-children", new String[]{name}); //$NON-NLS-1$ - } - - public MIVarListChildrenInfo getMIVarListChildrenInfo() throws MIException { - return (MIVarListChildrenInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIVarListChildrenInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarSetFormat.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarSetFormat.java deleted file mode 100644 index c7961ed880f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarSetFormat.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIFormat; - -/** - * - * -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 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: - format = "natural"; //$NON-NLS-1$ - break; - case MIFormat.DECIMAL: - format = "decimal"; //$NON-NLS-1$ - break; - case MIFormat.BINARY: - format = "binary"; //$NON-NLS-1$ - break; - case MIFormat.OCTAL: - format = "octal"; //$NON-NLS-1$ - break; - /* - case MIFormat.HEXADECIMAL: - case MIFormat.RAW: - default: - format = "hexadecimal"; - break; - */ - } - setParameters(new String[]{name, format}); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarShowAttributes.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarShowAttributes.java deleted file mode 100644 index 09e7e22a39e..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarShowAttributes.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.MIVarShowAttributesInfo; - -/** - * - * -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 miVersion, String name) { - super(miVersion, "-var-show-attributes", new String[]{name}); //$NON-NLS-1$ - } - - public MIVarShowAttributesInfo getMIVarShowAttributesInfo() throws MIException { - return (MIVarShowAttributesInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIVarShowAttributesInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarShowFormat.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarShowFormat.java deleted file mode 100644 index 04d84be20ea..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarShowFormat.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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 miVersion, String name) { - super(miVersion, "-var-show-format", new String[]{name}); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarUpdate.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarUpdate.java deleted file mode 100644 index b4614f0bba1..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVarUpdate.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -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.MIVarUpdateInfo; - -/** - * - * -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(String miVersion) { - this(miVersion, "*"); //$NON-NLS-1$ - } - - public MIVarUpdate(String miVersion, String name) { - super(miVersion, "-var-update", new String[] { name }); //$NON-NLS-1$ - } - - public MIVarUpdateInfo getMIVarUpdateInfo() throws MIException { - return (MIVarUpdateInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIVarUpdateInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVersion.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVersion.java deleted file mode 100644 index 3100be3bc93..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIVersion.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * TODO: Make this an enum type. - * MI Version constants. - */ -public class MIVersion { - - public static final String MI1 = "mi1"; //$NON-NLS-1$ - public static final String MI2 = "mi2"; //$NON-NLS-1$ - public static final String MI3 = "mi3"; //$NON-NLS-1$ - - public static int compare(String v1, String v2) { - return v1.compareToIgnoreCase(v2); - } - - public static boolean equals(String v1, String v2) { - return v1.equalsIgnoreCase(v2); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/RawCommand.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/RawCommand.java deleted file mode 100644 index 63af4eb7cee..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/RawCommand.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - */ -public class RawCommand extends Command { - - String fRaw; - - public RawCommand(String operation) { - fRaw = operation; - } - - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ - public String toString() { - if (fRaw == null) { - fRaw = "\n"; //$NON-NLS-1$; - } else if (! fRaw.endsWith("\n")) { //$NON-NLS-1$ - fRaw += "\n"; //$NON-NLS-1$ - } - return fRaw; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.Command#getMIOutput() - */ - public MIOutput getMIOutput() { - return new MIOutput(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/CommandFactoriesMessages.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/CommandFactoriesMessages.java deleted file mode 100644 index dae1a690b32..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/CommandFactoriesMessages.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.command.factories; - -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -public class CommandFactoriesMessages { - - private static final String BUNDLE_NAME = "org.eclipse.cdt.debug.mi.core.command.factories.CommandFactoriesMessages"; //$NON-NLS-1$ - - private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME ); - - private CommandFactoriesMessages() { - } - - public static String getString( String key ) { - try { - return RESOURCE_BUNDLE.getString( key ); - } - catch( MissingResourceException e ) { - return '!' + key + '!'; - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/CommandFactoriesMessages.properties b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/CommandFactoriesMessages.properties deleted file mode 100644 index 51b73c66f9b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/CommandFactoriesMessages.properties +++ /dev/null @@ -1,11 +0,0 @@ -############################################################################### -# Copyright (c) 2006 QNX Software Systems and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# QNX Software Systems - initial API and implementation -############################################################################### -CommandFactoryDescriptor.0=Error instantiating command factory. diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/CommandFactoryDescriptor.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/CommandFactoryDescriptor.java deleted file mode 100644 index 548607817d8..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/CommandFactoryDescriptor.java +++ /dev/null @@ -1,136 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.command.factories; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.StringTokenizer; -import org.eclipse.cdt.debug.mi.core.MIPlugin; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - -/** - * A command factory descriptor wrappers a configuration - * element for a <code>commandFactory</code> extension. - */ -public class CommandFactoryDescriptor { - - private final static String IDENTIFIER = "id"; //$NON-NLS-1$ - private final static String CLASS = "class"; //$NON-NLS-1$ - private final static String NAME = "name"; //$NON-NLS-1$ - private final static String DEBUGGER_ID = "debuggerID"; //$NON-NLS-1$ - private final static String MI_VERSIONS = "miVersions"; //$NON-NLS-1$ - private final static String DESCRIPTION = "description"; //$NON-NLS-1$ - private final static String PLATFORMS = "platforms"; //$NON-NLS-1$ - - /** - * The configuration element of the extension. - */ - private IConfigurationElement fElement; - - /** - * The set of the platforms supported by this command factory. - */ - private Set fPlatforms; - - /** - * The mi levels supported by this command factory. - */ - private String[] fMIVersions = new String[0]; - - /** - * Constructor for CommandFactoryDescriptor. - */ - protected CommandFactoryDescriptor( IConfigurationElement element ) { - fElement = element; - } - - protected IConfigurationElement getConfigurationElement() { - return fElement; - } - - public String getIdentifier() { - return getConfigurationElement().getAttribute( IDENTIFIER ); - } - - public String getName() { - return getConfigurationElement().getAttribute( NAME ); - } - - public String getDebuggerIdentifier() { - return getConfigurationElement().getAttribute( DEBUGGER_ID ); - } - - public String[] getMIVersions() { - if ( fMIVersions.length == 0 ) { - String miVersions = getConfigurationElement().getAttribute( MI_VERSIONS ); - if ( miVersions == null || miVersions.trim().length() == 0 ) - miVersions = "mi"; //$NON-NLS-1$ - StringTokenizer tokenizer = new StringTokenizer( miVersions, "," ); //$NON-NLS-1$ - List list = new ArrayList( tokenizer.countTokens() ); - while( tokenizer.hasMoreTokens() ) { - list.add( tokenizer.nextToken().trim() ); - } - fMIVersions = (String[])list.toArray( new String[list.size()] ); - } - return fMIVersions; - } - - public String getDescription() { - String desc = getConfigurationElement().getAttribute( DESCRIPTION ); - if ( isEmpty( desc ) ) { - desc =""; //$NON-NLS-1$ - } - return desc; - } - - protected Set getSupportedPlatforms() { - if ( fPlatforms == null ) { - String platforms = getConfigurationElement().getAttribute( PLATFORMS ); - if ( platforms == null ) { - return new HashSet( 0 ); - } - StringTokenizer tokenizer = new StringTokenizer( platforms, "," ); //$NON-NLS-1$ - fPlatforms = new HashSet( tokenizer.countTokens() ); - while( tokenizer.hasMoreTokens() ) { - fPlatforms.add( tokenizer.nextToken().trim() ); - } - } - return fPlatforms; - } - - public boolean supportsPlatform( String platform ) { - Set all = getSupportedPlatforms(); - return all.isEmpty() || all.contains( "*" ) || all.contains( platform ); //$NON-NLS-1$ - } - - public String[] getSupportedPlatformList() { - Set platforms = getSupportedPlatforms(); - return (String[])platforms.toArray( new String[platforms.size()] ); - } - - public CommandFactory getCommandFactory() throws CoreException { - Object clazz = getConfigurationElement().createExecutableExtension( CLASS ); - if ( clazz instanceof CommandFactory ) { - return (CommandFactory)clazz; - } - throw new CoreException( new Status( IStatus.ERROR, MIPlugin.getUniqueIdentifier(), -1, CommandFactoriesMessages.getString( "CommandFactoryDescriptor.0" ), null ) ); //$NON-NLS-1$ - } - - private boolean isEmpty( String str ) { - return ( str == null || str.trim().length() == 0 ); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/CommandFactoryManager.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/CommandFactoryManager.java deleted file mode 100644 index ed119fef20d..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/CommandFactoryManager.java +++ /dev/null @@ -1,85 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.command.factories; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import org.eclipse.cdt.debug.mi.core.MIPlugin; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.Platform; - -/** - * Manages command factories. - */ -public class CommandFactoryManager { - - private List fDescriptors = null; - - public CommandFactoryDescriptor[] getDescriptors() { - List factories = getDescriptorList(); - return (CommandFactoryDescriptor[])factories.toArray( new CommandFactoryDescriptor[factories.size()] ); - } - - public CommandFactoryDescriptor getDefaultDescriptor( String debuggerID ) { - // TODO: temporary - CommandFactoryDescriptor[] descriptors = getDescriptors( debuggerID ); - return descriptors[0]; - } - - public CommandFactoryDescriptor[] getDescriptors( String debuggerID ) { - String platform = Platform.getOS(); - List all = getDescriptorList(); - ArrayList list = new ArrayList( all.size() ); - Iterator it = all.iterator(); - while( it.hasNext() ) { - CommandFactoryDescriptor desc = (CommandFactoryDescriptor)it.next(); - if ( desc.getDebuggerIdentifier().equals( debuggerID ) && desc.supportsPlatform( platform ) ) { - list.add( desc ); - } - } - return (CommandFactoryDescriptor[])list.toArray( new CommandFactoryDescriptor[list.size()] ); - } - - public CommandFactory getCommandFactory( String factoryID ) throws CoreException { - List all = getDescriptorList(); - Iterator it = all.iterator(); - while( it.hasNext() ) { - CommandFactoryDescriptor desc = (CommandFactoryDescriptor)it.next(); - if ( desc.getIdentifier().equals( factoryID ) ) { - return desc.getCommandFactory(); - } - } - return null; - } - - private List getDescriptorList() { - if ( fDescriptors == null ) - initializeDescriptorList(); - return fDescriptors; - } - - private synchronized void initializeDescriptorList() { - if ( fDescriptors == null ) { - IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint( MIPlugin.getUniqueIdentifier(), MIPlugin.EXTENSION_POINT_COMMAND_FACTORIES ); - IConfigurationElement[] infos = extensionPoint.getConfigurationElements(); - fDescriptors = new ArrayList( infos.length ); - for( int i = 0; i < infos.length; i++ ) { - IConfigurationElement configurationElement = infos[i]; - CommandFactoryDescriptor factory = new CommandFactoryDescriptor( configurationElement ); - fDescriptors.add( factory ); - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/StandardCommandFactory.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/StandardCommandFactory.java deleted file mode 100644 index 13341aeb516..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/StandardCommandFactory.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.command.factories; - -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; - -/** - * The "standard" command factory. - */ -public class StandardCommandFactory extends CommandFactory { - - /** - * Constructor for StandardCommandFactory. - */ - public StandardCommandFactory() { - super(); - } - - /** - * Constructor for StandardCommandFactory. - */ - public StandardCommandFactory( String miVersion ) { - super( miVersion ); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/linux/LinuxCLIInfoSharedLibrary.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/linux/LinuxCLIInfoSharedLibrary.java deleted file mode 100644 index f1de8a84a84..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/linux/LinuxCLIInfoSharedLibrary.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.command.factories.linux; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.command.CLIInfoSharedLibrary; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * Linux version of "info shared library". - */ -public class LinuxCLIInfoSharedLibrary extends CLIInfoSharedLibrary { - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.CLIInfoSharedLibrary#getMIInfo() - */ - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if ( out != null ) { - info = new LinuxCLIInfoSharedLibraryInfo( out ); - if ( info.isError() ) { - throwMIException( info, out ); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/linux/LinuxCLIInfoSharedLibraryInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/linux/LinuxCLIInfoSharedLibraryInfo.java deleted file mode 100644 index 4f5f2f58649..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/linux/LinuxCLIInfoSharedLibraryInfo.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.command.factories.linux; - -import java.util.List; -import org.eclipse.cdt.debug.mi.core.output.CLIInfoSharedLibraryInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIShared; - -/** - * Linux specific parser of the "info shared" output. - */ -public class LinuxCLIInfoSharedLibraryInfo extends CLIInfoSharedLibraryInfo { - - /** - * Constructor for LinuxCLIInfoSharedLibraryInfo. - */ - public LinuxCLIInfoSharedLibraryInfo( MIOutput out ) { - super( out ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.output.CLIInfoSharedLibraryInfo#parseShared(java.lang.String, java.util.List) - */ - protected void parseShared( String str, List aList ) { - if ( str.length() > 0 && !str.startsWith( "From" ) ) { //$NON-NLS-1$ - // Pass the header - int index = -1; - String from = ""; //$NON-NLS-1$ - String to = ""; //$NON-NLS-1$ - boolean syms = false; - String name = ""; //$NON-NLS-1$ - for( int i = 0; (index = str.lastIndexOf( ' ' )) != -1 || i <= 3; i++ ) { - if ( index == -1 ) { - index = 0; - } - String sub = str.substring( index ).trim(); - // move to previous column - str = str.substring( 0, index ).trim(); - switch( i ) { - case 0: - name = sub; - break; - case 1: - if ( sub.equalsIgnoreCase( "Yes" ) ) { //$NON-NLS-1$ - syms = true; - } - break; - case 2: // second column is "To" - to = sub; - break; - case 3: // first column is "From" - from = sub; - break; - } - } - if ( name.length() > 0 ) { - MIShared s = new MIShared( from, to, syms, name ); - aList.add( s ); - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/linux/StandardLinuxCommandFactory.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/linux/StandardLinuxCommandFactory.java deleted file mode 100644 index cc42b57e251..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/linux/StandardLinuxCommandFactory.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.command.factories.linux; - -import org.eclipse.cdt.debug.mi.core.command.CLIInfoSharedLibrary; -import org.eclipse.cdt.debug.mi.core.command.MIGDBSetNewConsole; -import org.eclipse.cdt.debug.mi.core.command.factories.StandardCommandFactory; - -/** - * Command factory for the standard gdb/mi protocol for Linux. - */ -public class StandardLinuxCommandFactory extends StandardCommandFactory { - - /** - * Constructor for StandardLinuxCommandFactory. - */ - public StandardLinuxCommandFactory() { - super(); - } - - /** - * Constructor for StandardLinuxCommandFactory. - */ - public StandardLinuxCommandFactory( String miVersion ) { - super( miVersion ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.CommandFactory#createCLIInfoSharedLibrary() - */ - public CLIInfoSharedLibrary createCLIInfoSharedLibrary() { - return new LinuxCLIInfoSharedLibrary(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.CommandFactory#createMIGDBSetNewConsole() - */ - public MIGDBSetNewConsole createMIGDBSetNewConsole() { - // Suppress "set new-console" - returns error on Linux - return new MIGDBSetNewConsole( getMIVersion() ) { - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.MICommand#getOperation() - */ - public String getOperation() { - return ""; //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.MICommand#getOptions() - */ - public String[] getOptions() { - return new String[0]; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.MICommand#getParameters() - */ - public String[] getParameters() { - return new String[0]; - } - }; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/macos/MacOSMIEnvironmentCD.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/macos/MacOSMIEnvironmentCD.java deleted file mode 100644 index b9905acb40b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/macos/MacOSMIEnvironmentCD.java +++ /dev/null @@ -1,30 +0,0 @@ -/********************************************************************** - * Copyright (c) 2006 Nokia and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nokia - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.debug.mi.core.command.factories.macos; - -import org.eclipse.cdt.debug.mi.core.command.MIEnvironmentCD; - -public class MacOSMIEnvironmentCD extends MIEnvironmentCD { - - public MacOSMIEnvironmentCD(String miVersion, String path) { - super(miVersion, path); - this.setOperation("cd");//$NON-NLS-1$ - } - - protected String parametersToString() { - String[] parameters = getParameters(); - if (parameters != null && parameters.length == 1) { - return '"' + parameters[0] + '"'; - } - return super.parametersToString(); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/macos/StandardMacOSCommandFactory.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/macos/StandardMacOSCommandFactory.java deleted file mode 100644 index c4d3c6b0842..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/macos/StandardMacOSCommandFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/********************************************************************** - * Copyright (c) 2006 Nokia and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nokia - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.debug.mi.core.command.factories.macos; - -import org.eclipse.cdt.debug.mi.core.command.MIEnvironmentCD; -import org.eclipse.cdt.debug.mi.core.command.factories.StandardCommandFactory; - -public class StandardMacOSCommandFactory extends StandardCommandFactory { - - /** - * Constructor for StandardMacOSCommandFactory. - */ - public StandardMacOSCommandFactory() { - super(); - } - - /** - * Constructor for StandardMacOSCommandFactory. - */ - public StandardMacOSCommandFactory( String miVersion ) { - super( miVersion ); - } - - public MIEnvironmentCD createMIEnvironmentCD(String pathdir) { - return new MacOSMIEnvironmentCD(getMIVersion(), pathdir); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/CygwinCommandFactory.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/CygwinCommandFactory.java deleted file mode 100644 index 2244472aad4..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/CygwinCommandFactory.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.command.factories.win32; - -import org.eclipse.cdt.debug.mi.core.command.MIEnvironmentDirectory; - -/** - * Command factory for the gdb/mi protocol for CygWin environment. - */ -public class CygwinCommandFactory extends StandardWinCommandFactory { - - /** - * Constructor for CygwinCommandFactory. - */ - public CygwinCommandFactory() { - super(); - } - - /** - * Constructor for CygwinCommandFactory. - */ - public CygwinCommandFactory( String miVersion ) { - super( miVersion ); - } - - public MIEnvironmentDirectory createMIEnvironmentDirectory(boolean reset, String[] pathdirs) { - return new CygwinMIEnvironmentDirectory( getMIVersion(), reset, pathdirs ); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/CygwinMIEnvironmentCD.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/CygwinMIEnvironmentCD.java deleted file mode 100644 index 97d67dfb5ea..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/CygwinMIEnvironmentCD.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2002, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command.factories.win32; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import org.eclipse.cdt.core.CommandLauncher; -import org.eclipse.core.runtime.Path; - -/** - * CygwinMIEnvironmentCD - */ -public class CygwinMIEnvironmentCD extends WinMIEnvironmentCD { - - CygwinMIEnvironmentCD( String miVersion, String path ) { - super( miVersion, path ); - // Use the cygpath utility to convert the path - CommandLauncher launcher = new CommandLauncher(); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - ByteArrayOutputStream err = new ByteArrayOutputStream(); - String newPath = null; - launcher.execute( new Path( "cygpath" ), //$NON-NLS-1$ - new String[]{ "-u", path }, //$NON-NLS-1$ - new String[0], new Path( "." ) ); //$NON-NLS-1$ - if ( launcher.waitAndRead( out, err ) == CommandLauncher.OK ) { - newPath = out.toString(); - if ( newPath != null ) { - newPath = newPath.trim(); - if ( newPath.length() > 0 ) { - path = newPath; - } - } - } - try { - out.close(); - err.close(); - } - catch( IOException e ) { - // ignore. - } - setParameters( new String[]{ path } ); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/CygwinMIEnvironmentDirectory.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/CygwinMIEnvironmentDirectory.java deleted file mode 100644 index 09572ac54fd..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/CygwinMIEnvironmentDirectory.java +++ /dev/null @@ -1,99 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2002, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.command.factories.win32; - -import java.io.ByteArrayOutputStream; -import java.util.StringTokenizer; - -import org.eclipse.cdt.core.CommandLauncher; -import org.eclipse.cdt.debug.mi.core.command.MIEnvironmentDirectory; -import org.eclipse.core.runtime.Path; - -/** - * Cygwin implementation of the MIEnvironmentDirectory command. In the cygwin - * environment, the paths are DOS paths and need to be converted to cygwin - * style paths before passing them to gdb. - */ -public class CygwinMIEnvironmentDirectory extends MIEnvironmentDirectory { - - final static private int BUFFER_SIZE = 1000; - - /** - * To prevent to call "cygpath" for each folder (see //bugs.eclipse.org/bugs/show_bug.cgi?id=107202) - * we use the "-p" option of "cygpath". - * We can not convert the whole path in one shot because the size of the spawner's buffer is limited to 2049, - * so we divide the path's folders into groups. - */ - CygwinMIEnvironmentDirectory(String miVersion, boolean reset, String[] paths) { - super(miVersion, reset, paths); - - String[] newpaths = new String[paths.length]; - int index = 0; - while(index < paths.length) { - int length = 0; - StringBuffer sb = new StringBuffer(BUFFER_SIZE); - for (int i = index; i < paths.length; i++) { - if (length + paths[i].length() < BUFFER_SIZE) { - length += paths[i].length(); - newpaths[i] = paths[i]; - sb.append(paths[i]).append(';'); - ++length; - } - else { - convertPath(sb, newpaths, index); - index = i; - break; - } - if (i == paths.length - 1) { - convertPath(sb, newpaths, index); - index = paths.length; - break; - } - } - } - setParameters(newpaths); - } - - /** - * Converts a path to the cygwin path and stores the resulting - * folders into the given array starting from <code>index</code>. - */ - private void convertPath(StringBuffer sb, String[] paths, int index) { - if (sb.charAt(sb.length() - 1) == ';') - sb.deleteCharAt(sb.length() - 1); - String result = convertPath0(sb.toString()); - StringTokenizer st = new StringTokenizer(result, ":"); //$NON-NLS-1$ - int j = index; - while(st.hasMoreTokens()) { - if (j >= paths.length) - break; - paths[j++] = st.nextToken(); - } - } - - /** - * Converts a windows type path into the cygwin type path using "cygpath" - * with the "-p" option. - */ - private String convertPath0(String path) { - String result = path; - CommandLauncher launcher = new CommandLauncher(); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - launcher.execute( - new Path("cygpath"), //$NON-NLS-1$ - new String[] { "-p", "-u", path }, //$NON-NLS-1$ //$NON-NLS-2$ - new String[0], - new Path(".")); //$NON-NLS-1$ - if (launcher.waitAndRead(out, out) == CommandLauncher.OK) - result = out.toString().trim(); - return result; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/StandardWinCommandFactory.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/StandardWinCommandFactory.java deleted file mode 100644 index 2b8134075e9..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/StandardWinCommandFactory.java +++ /dev/null @@ -1,142 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.command.factories.win32; - -import org.eclipse.cdt.debug.mi.core.command.CLIInfoSharedLibrary; -import org.eclipse.cdt.debug.mi.core.command.MIEnvironmentCD; -import org.eclipse.cdt.debug.mi.core.command.MIGDBSetAutoSolib; -import org.eclipse.cdt.debug.mi.core.command.MIGDBSetSolibSearchPath; -import org.eclipse.cdt.debug.mi.core.command.MIGDBShowSolibSearchPath; -import org.eclipse.cdt.debug.mi.core.command.factories.StandardCommandFactory; - -/** - * Command factory for the standard gdb/mi protocol for Windows. - */ -public class StandardWinCommandFactory extends StandardCommandFactory { - - /** - * Constructor for StandardWinCommandFactory. - */ - public StandardWinCommandFactory() { - super(); - } - - /** - * Constructor for StandardWinCommandFactory. - */ - public StandardWinCommandFactory( String miVersion ) { - super( miVersion ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.CommandFactory#createMIEnvironmentCD(java.lang.String) - */ - public MIEnvironmentCD createMIEnvironmentCD( String pathdir ) { - return new WinMIEnvironmentCD( getMIVersion(), pathdir ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.CommandFactory#createCLIInfoSharedLibrary() - */ - public CLIInfoSharedLibrary createCLIInfoSharedLibrary() { - return new WinCLIInfoSharedLibrary(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.CommandFactory#createMIGDBSetAutoSolib(boolean) - */ - public MIGDBSetAutoSolib createMIGDBSetAutoSolib( boolean set ) { - // Suppress "set auto-solib" - returns error on Windows - return new MIGDBSetAutoSolib( getMIVersion(), true ) { - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.MICommand#getOperation() - */ - public String getOperation() { - return ""; //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.MICommand#getOptions() - */ - public String[] getOptions() { - return new String[0]; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.MICommand#getParameters() - */ - public String[] getParameters() { - return new String[0]; - } - }; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.CommandFactory#createMIGDBShowSolibSearchPath() - */ - public MIGDBShowSolibSearchPath createMIGDBShowSolibSearchPath() { - // Suppress "show solib-search-path" - returns error on Windows - return new MIGDBShowSolibSearchPath( getMIVersion() ) { - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.MICommand#getOperation() - */ - public String getOperation() { - return ""; //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.MICommand#getOptions() - */ - public String[] getOptions() { - return new String[0]; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.MICommand#getParameters() - */ - public String[] getParameters() { - return new String[0]; - } - }; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.CommandFactory#createMIGDBSetSolibSearchPath(java.lang.String[]) - */ - public MIGDBSetSolibSearchPath createMIGDBSetSolibSearchPath( String[] params ) { - // Suppress "set solib-search-path" - returns error on Windows - return new MIGDBSetSolibSearchPath( getMIVersion(), params ) { - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.MICommand#getOperation() - */ - public String getOperation() { - return ""; //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.MICommand#getOptions() - */ - public String[] getOptions() { - return new String[0]; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.MICommand#getParameters() - */ - public String[] getParameters() { - return new String[0]; - } - }; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/WinCLIInfoSharedLibrary.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/WinCLIInfoSharedLibrary.java deleted file mode 100644 index 0025c734d1a..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/WinCLIInfoSharedLibrary.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.command.factories.win32; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.command.CLIInfoSharedLibrary; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * Windows version of "info shared library". - */ -public class WinCLIInfoSharedLibrary extends CLIInfoSharedLibrary { - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.CLIInfoSharedLibrary#getMIInfo() - */ - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if ( out != null ) { - info = new WinCLIInfoSharedLibraryInfo( out ); - if ( info.isError() ) { - throwMIException( info, out ); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/WinCLIInfoSharedLibraryInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/WinCLIInfoSharedLibraryInfo.java deleted file mode 100644 index 53ee5ef1802..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/WinCLIInfoSharedLibraryInfo.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.command.factories.win32; - -import java.util.List; -import org.eclipse.cdt.debug.mi.core.output.CLIInfoSharedLibraryInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIShared; - -/** - * Windows specific parser of the "info shared" output. - */ -public class WinCLIInfoSharedLibraryInfo extends CLIInfoSharedLibraryInfo { - - public WinCLIInfoSharedLibraryInfo( MIOutput out ) { - super( out ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.output.CLIInfoSharedLibraryInfo#parseShared(java.lang.String, java.util.List) - */ - protected void parseShared( String str, List aList ) { - // skip the header (DLL Name) - if ( !str.startsWith( "DLL" ) ) { //$NON-NLS-1$ - String from = ""; //$NON-NLS-1$ - String to = ""; //$NON-NLS-1$ - boolean syms = true; - int index = str.lastIndexOf( ' ' ); - if ( index > 0 ) { - String sub = str.substring( index ).trim(); - // Go figure they do not print the "0x" to indicate hexadecimal!! - if ( !sub.startsWith( "0x" ) ) { //$NON-NLS-1$ - sub = "0x" + sub; //$NON-NLS-1$ - } - from = sub; - str = str.substring( 0, index ).trim(); - } - MIShared s = new MIShared( from, to, syms, str.trim() ); - aList.add( s ); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/WinMIEnvironmentCD.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/WinMIEnvironmentCD.java deleted file mode 100644 index b1bc4b04c7e..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/WinMIEnvironmentCD.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.command.factories.win32; - -import org.eclipse.cdt.debug.mi.core.command.MIEnvironmentCD; - -/** - * Comment for . - */ -public class WinMIEnvironmentCD extends MIEnvironmentCD { - - public WinMIEnvironmentCD( String miVersion, String path ) { - super( miVersion, path ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.core.command.MICommand#parametersToString() - */ - protected String parametersToString() { - String[] params = getParameters(); - if ( params != null && params.length == 1 ) { - StringBuffer sb = new StringBuffer(); - // We need to escape the double quotes and the backslash. - String param = params[0]; - for( int j = 0; j < param.length(); j++ ) { - char c = param.charAt( j ); - if ( c == '"' || c == '\\' ) { - sb.append( '\\' ); - } - sb.append( c ); - } - // If the string contains spaces instead of escaping - // surround the parameter with double quotes. - if ( containsWhitespace( param ) ) { - sb.insert( 0, '"' ); - sb.append( '"' ); - } - return sb.toString().trim(); - } - return super.parametersToString(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIBreakpointChangedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIBreakpointChangedEvent.java deleted file mode 100644 index ded3a06ac81..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIBreakpointChangedEvent.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; - - - -/** - * - */ -public class MIBreakpointChangedEvent extends MIChangedEvent { - - int no; - - public MIBreakpointChangedEvent(MISession source, int number) { - this(source, 0, number); - } - - public MIBreakpointChangedEvent(MISession source, int id, int number) { - super(source, id); - no = number; - } - - public int getNumber() { - return no; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIBreakpointCreatedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIBreakpointCreatedEvent.java deleted file mode 100644 index d9a43d0a20c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIBreakpointCreatedEvent.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; - - - -/** - * - */ -public class MIBreakpointCreatedEvent extends MICreatedEvent { - - int no; - - public MIBreakpointCreatedEvent(MISession source, int number) { - this(source, 0, number); - } - - public MIBreakpointCreatedEvent(MISession source, int id, int number) { - super(source, id); - no = number; - } - - public int getNumber() { - return no; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIBreakpointDeletedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIBreakpointDeletedEvent.java deleted file mode 100644 index 224a21be73d..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIBreakpointDeletedEvent.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; - - - -/** - * - */ -public class MIBreakpointDeletedEvent extends MIDestroyedEvent { - - int no; - - public MIBreakpointDeletedEvent(MISession source, int number) { - this(source, 0, number); - } - - public MIBreakpointDeletedEvent(MISession source, int id, int number) { - super(source, id); - no = number; - } - - public int getNumber() { - return no; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIBreakpointHitEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIBreakpointHitEvent.java deleted file mode 100644 index 61f688fce88..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIBreakpointHitEvent.java +++ /dev/null @@ -1,94 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIFrame; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MITuple; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - -/** - * ^stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x08048468",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbffff18c"}],file="hello.c",line="4"} - * - */ -public class MIBreakpointHitEvent extends MIStoppedEvent { - - int bkptno; - MIFrame frame; - - public MIBreakpointHitEvent(MISession source, MIExecAsyncOutput record) { - super(source, record); - parse(); - } - - public MIBreakpointHitEvent(MISession source, MIResultRecord record) { - super(source, record); - parse(); - } - - public int getNumber() { - return bkptno; - } - - public MIFrame getMIFrame() { - return frame; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("number=").append(bkptno).append('\n'); //$NON-NLS-1$ - buffer.append("thread-id=").append(getThreadId()).append('\n'); //$NON-NLS-1$ - buffer.append(frame.toString()); - return buffer.toString(); - } - - void parse () { - MIResult[] results = null; - MIExecAsyncOutput exec = getMIExecAsyncOutput(); - MIResultRecord rr = getMIResultRecord(); - if (exec != null) { - results = exec.getMIResults(); - } else if (rr != null) { - results = rr.getMIResults(); - } - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; //$NON-NLS-1$ - if (value != null && value instanceof MIConst) { - str = ((MIConst)value).getString(); - } - - if (var.equals("bkptno")) { //$NON-NLS-1$ - try { - bkptno = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } else if (var.equals("thread-id")) { //$NON-NLS-1$ - try { - int id = Integer.parseInt(str.trim()); - setThreadId(id); - } catch (NumberFormatException e) { - } - } else if (var.equals("frame")) { //$NON-NLS-1$ - if (value instanceof MITuple) { - frame = new MIFrame((MITuple)value); - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIChangedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIChangedEvent.java deleted file mode 100644 index c7d886a93a5..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIChangedEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; - - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public abstract class MIChangedEvent extends MIEvent { - public MIChangedEvent(MISession source, int id) { - super(source, id); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MICreatedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MICreatedEvent.java deleted file mode 100644 index 00c7e7036dc..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MICreatedEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; - - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public abstract class MICreatedEvent extends MIEvent { - public MICreatedEvent(MISession source, int id) { - super(source, id); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIDestroyedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIDestroyedEvent.java deleted file mode 100644 index 2f52bbfacbd..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIDestroyedEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; - - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public abstract class MIDestroyedEvent extends MIEvent { - public MIDestroyedEvent(MISession source, int id) { - super(source, id); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIDetachedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIDetachedEvent.java deleted file mode 100644 index 47f83bac5c7..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIDetachedEvent.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; - - - -/** - * - * ^running - */ -public class MIDetachedEvent extends MIDestroyedEvent { - - public MIDetachedEvent(MISession source, int token) { - super(source, token); - } - - public String toString() { - return "Detached"; //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIErrorEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIErrorEvent.java deleted file mode 100644 index 2555e00cebf..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIErrorEvent.java +++ /dev/null @@ -1,80 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MILogStreamOutput; -import org.eclipse.cdt.debug.mi.core.output.MIOOBRecord; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MIStreamRecord; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - - - -/** - * (gdb) - * &"warning: Cannot insert breakpoint 2:\n" - * &"Cannot access memory at address 0x8020a3\n" - * 30^error,msg=3D"Cannot access memory at address 0x8020a3"=20 - */ -public class MIErrorEvent extends MIStoppedEvent { - - String msg = ""; //$NON-NLS-1$ - String log = ""; //$NON-NLS-1$ - MIOOBRecord[] oobs; - - public MIErrorEvent(MISession source, MIResultRecord rr, MIOOBRecord[] o) { - super(source, rr); - oobs = o; - parse(); - } - - public String getMessage() { - return msg; - } - - public String getLogMessage() { - return log; - } - - void parse () { - MIResultRecord rr = getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; //$NON-NLS-1$ - if (value instanceof MIConst) { - str = ((MIConst)value).getString(); - } - - if (var.equals("msg")) { //$NON-NLS-1$ - msg = str; - } - } - } - if (oobs != null) { - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < oobs.length; i++) { - if (oobs[i] instanceof MILogStreamOutput) { - MIStreamRecord o = (MIStreamRecord)oobs[i]; - sb.append(o.getString()); - } - } - log = sb.toString(); - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIEvent.java deleted file mode 100644 index f6501093d47..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIEvent.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import java.util.EventObject; - -import org.eclipse.cdt.debug.mi.core.MISession; - -/** - */ -public abstract class MIEvent extends EventObject { - - int token; - boolean propagate = true; - - public MIEvent(MISession session, int token) { - super(session); - this.token = token; - } - - public int getToken() { - return token; - } - - public MISession getMISession() { - return (MISession)getSource(); - } - - public boolean propagate() { - return propagate; - } - - public void setPropagate( boolean propagate ) { - this.propagate = propagate; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIFunctionFinishedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIFunctionFinishedEvent.java deleted file mode 100644 index 035cd3d9443..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIFunctionFinishedEvent.java +++ /dev/null @@ -1,106 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIFrame; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MITuple; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - -/** - * *stopped,reason="function-finished",thread-id="0",frame={addr="0x0804855a",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbffff18c"}],file="hello.c",line="17"},gdb-result-var="$1",return-value="10" - */ -public class MIFunctionFinishedEvent extends MIStoppedEvent { - - String gdbResult = ""; //$NON-NLS-1$ - String returnValue = ""; //$NON-NLS-1$ - String returnType = ""; //$NON-NLS-1$ - - public MIFunctionFinishedEvent(MISession source, MIExecAsyncOutput async) { - super(source, async); - parse(); - } - - public MIFunctionFinishedEvent(MISession source, MIResultRecord record) { - super(source, record); - parse(); - } - - public String getGDBResultVar() { - return gdbResult; - } - - public String getReturnValue() { - return returnValue; - } - - public String getReturnType() { - return returnType; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("gdb-result-var=" + gdbResult + "\n"); //$NON-NLS-1$//$NON-NLS-2$ - buffer.append("return-value=" + returnValue + "\n"); //$NON-NLS-1$//$NON-NLS-2$ - buffer.append("return-type=" + returnType + "\n"); //$NON-NLS-1$//$NON-NLS-2$ - buffer.append("thread-id=").append(getThreadId()).append('\n'); //$NON-NLS-1$ - MIFrame f = getFrame(); - if (f != null) { - buffer.append(f.toString()); - } - return buffer.toString(); - } - - void parse () { - MIExecAsyncOutput exec = getMIExecAsyncOutput(); - MIResultRecord rr = getMIResultRecord(); - - MIResult[] results = null; - if (exec != null) { - results = exec.getMIResults(); - } else if (rr != null) { - results = rr.getMIResults(); - } - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; //$NON-NLS-1$ - if (value instanceof MIConst) { - str = ((MIConst)value).getString(); - } - - if (var.equals("gdb-result-var")) { //$NON-NLS-1$ - gdbResult = str; - } else if (var.equals("return-value")) { //$NON-NLS-1$ - returnValue = str; - } else if (var.equals("return-type")) { //$NON-NLS-1$ - returnType = str; - } else if (var.equals("thread-id")) { //$NON-NLS-1$ - try { - int id = Integer.parseInt(str.trim()); - setThreadId(id); - } catch (NumberFormatException e) { - } - } else if (var.equals("frame")) { //$NON-NLS-1$ - if (value instanceof MITuple) { - MIFrame f = new MIFrame((MITuple)value); - setFrame(f); - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIGDBExitEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIGDBExitEvent.java deleted file mode 100644 index acd34f57fdd..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIGDBExitEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; - - - -/** - * Gdb Session terminated. - */ -public class MIGDBExitEvent extends MIDestroyedEvent { - - public MIGDBExitEvent(MISession source, int token) { - super(source, token); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIInferiorCreatedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIInferiorCreatedEvent.java deleted file mode 100644 index 59f8fbd7a64..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIInferiorCreatedEvent.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2002, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; - -/** - * MIInferiorCreatedEvent - */ -public class MIInferiorCreatedEvent extends MICreatedEvent { - - /** - * @param source - * @param id - */ - public MIInferiorCreatedEvent(MISession source, int id) { - super(source, id); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIInferiorExitEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIInferiorExitEvent.java deleted file mode 100644 index 5b7abbc63ff..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIInferiorExitEvent.java +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - - - -/** - * *stopped,reason="exited-normally" - * *stopped,reason="exited",exit-code="04" - * ^done,reason="exited",exit-code="04" - * - */ -public class MIInferiorExitEvent extends MIDestroyedEvent { - - int code = 0; - - MIExecAsyncOutput exec = null; - MIResultRecord rr = null; - - public MIInferiorExitEvent(MISession source, int token) { - super(source, token); - } - - public MIInferiorExitEvent(MISession source, MIExecAsyncOutput async) { - super(source, async.getToken()); - exec = async; - parse(); - } - - public MIInferiorExitEvent(MISession source, MIResultRecord record) { - super(source, record.getToken()); - rr = record; - parse(); - } - - public int getExitCode() { - return code; - } - - void parse () { - MIResult[] results = null; - if (exec != null) { - results = exec.getMIResults(); - } else if (rr != null) { - results = rr.getMIResults(); - } - - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; //$NON-NLS-1$ - if (value instanceof MIConst) { - str = ((MIConst)value).getString(); - } - - if (var.equals("exit-code")) { //$NON-NLS-1$ - try { - code = Integer.decode(str.trim()).intValue(); - } catch (NumberFormatException e) { - } - } - } - } - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIInferiorSignalExitEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIInferiorSignalExitEvent.java deleted file mode 100644 index 906699ea0af..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIInferiorSignalExitEvent.java +++ /dev/null @@ -1,85 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - -/** - * signal 2 - * "signal 2\n" - * ^done,reason="exited-signalled",signal-name="SIGINT",signal-meaning="Interrupt" - * - */ -public class MIInferiorSignalExitEvent extends MIDestroyedEvent { - - String sigName = ""; //$NON-NLS-1$ - String sigMeaning = ""; //$NON-NLS-1$ - - MIExecAsyncOutput exec = null; - MIResultRecord rr = null; - - public MIInferiorSignalExitEvent(MISession source, MIExecAsyncOutput async) { - super(source, async.getToken()); - exec = async; - parse(); - } - - public MIInferiorSignalExitEvent(MISession source, MIResultRecord record) { - super(source, record.getToken()); - rr = record; - parse(); - } - - public String getName() { - return sigName; - } - - public String getMeaning() { - return sigMeaning; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("signal-name=" + sigName + "\n"); //$NON-NLS-1$//$NON-NLS-2$ - buffer.append("signal-meaning=" + sigMeaning + "\n"); //$NON-NLS-1$//$NON-NLS-2$ - return buffer.toString(); - } - - void parse () { - MIResult[] results = null; - if (exec != null) { - results = exec.getMIResults(); - } else if (rr != null) { - results = rr.getMIResults(); - } - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; //$NON-NLS-1$ - if (value instanceof MIConst) { - str = ((MIConst)value).getString(); - } - - if (var.equals("signal-name")) { //$NON-NLS-1$ - sigName = str; - } else if (var.equals("signal-meaning")) { //$NON-NLS-1$ - sigMeaning = str; - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MILocationReachedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MILocationReachedEvent.java deleted file mode 100644 index 79540d9a84c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MILocationReachedEvent.java +++ /dev/null @@ -1,81 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIFrame; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MITuple; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - -/** - * *stopped,reason="location-reached",thread-id="0",frame={addr="0x0804858e",func="main2",args=[],file="hello.c",line="27"} - */ -public class MILocationReachedEvent extends MIStoppedEvent { - - public MILocationReachedEvent(MISession source, MIExecAsyncOutput async) { - super(source, async); - parse(); - } - - public MILocationReachedEvent(MISession source, MIResultRecord record) { - super(source, record); - parse(); - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("thread-id=").append(getThreadId()).append('\n'); //$NON-NLS-1$ - MIFrame f = getFrame(); - if (f != null) { - buffer.append(f.toString()); - } - return buffer.toString(); - } - - void parse () { - MIResult[] results = null; - MIExecAsyncOutput exec = getMIExecAsyncOutput(); - MIResultRecord rr = getMIResultRecord(); - - if (exec != null) { - results = exec.getMIResults(); - } else if (rr != null) { - results = rr.getMIResults(); - } - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; //$NON-NLS-1$ - if (value instanceof MIConst) { - str = ((MIConst)value).getString(); - } - - if (var.equals("thread-id")) { //$NON-NLS-1$ - try { - int id = Integer.parseInt(str.trim()); - setThreadId(id); - } catch (NumberFormatException e) { - } - } else if (var.equals("frame")) { //$NON-NLS-1$ - if (value instanceof MITuple) { - MIFrame f = new MIFrame((MITuple)value); - setFrame(f); - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIMemoryChangedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIMemoryChangedEvent.java deleted file mode 100644 index 32142332237..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIMemoryChangedEvent.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import java.math.BigInteger; - -import org.eclipse.cdt.debug.mi.core.MISession; - -/** - * This can not be detected yet by gdb/mi. - * - */ -public class MIMemoryChangedEvent extends MIChangedEvent { - - BigInteger[] addresses; - - public MIMemoryChangedEvent(MISession source, BigInteger[] addrs) { - this(source, 0, addrs); - } - - public MIMemoryChangedEvent(MISession source, int token, BigInteger[] addrs) { - super(source, token); - addresses = addrs; - } - - public BigInteger[] getAddresses() { - return addresses; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIMemoryCreatedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIMemoryCreatedEvent.java deleted file mode 100644 index 2cf2db807e5..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIMemoryCreatedEvent.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import java.math.BigInteger; - -import org.eclipse.cdt.debug.mi.core.MISession; - - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public class MIMemoryCreatedEvent extends MICreatedEvent { - - BigInteger address; - long totalBytes; - - public MIMemoryCreatedEvent(MISession source, BigInteger addr, long total) { - this(source, 0, addr, total); - } - - public MIMemoryCreatedEvent(MISession source, int token, BigInteger addr, long total) { - super(source, token); - address = addr; - totalBytes = total; - } - - public BigInteger getAddress() { - return address; - } - - public long getLength() { - return totalBytes; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIRegisterChangedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIRegisterChangedEvent.java deleted file mode 100644 index 1d9bf6eb34a..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIRegisterChangedEvent.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; - - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public class MIRegisterChangedEvent extends MIChangedEvent { - - String regName; - int regno; - - public MIRegisterChangedEvent(MISession source, int token, String name, int no) { - super(source, token); - regName = name; - regno = no; - } - - public String getName() { - return regName; - } - - public int getNumber() { - return regno; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIRegisterCreatedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIRegisterCreatedEvent.java deleted file mode 100644 index 580fd44ba34..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIRegisterCreatedEvent.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; - - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public class MIRegisterCreatedEvent extends MICreatedEvent { - - String regName; - int regno; - - public MIRegisterCreatedEvent(MISession source, String name, int number) { - this(source, 0, name, number); - } - - public MIRegisterCreatedEvent(MISession source, int token, String name, int number) { - super(source, token); - regName = name; - regno = number; - } - - public String getName() { - return regName; - } - - public int getNumber() { - return regno; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIRunningEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIRunningEvent.java deleted file mode 100644 index 545af972c1c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIRunningEvent.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; - - - -/** - * - * ^running - */ -public class MIRunningEvent extends MIEvent { - - public static final int CONTINUE = 0; - public static final int NEXT = 1; - public static final int NEXTI = 2; - public static final int STEP = 3; - public static final int STEPI = 4; - public static final int FINISH = 5; - public static final int UNTIL = 6; - public static final int RETURN = 7; - - int type; - - public MIRunningEvent(MISession source, int token, int t) { - super(source, token); - type = t; - } - - public int getType() { - return type; - } - - public String toString() { - return "Running"; //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MISharedLibChangedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MISharedLibChangedEvent.java deleted file mode 100644 index 91a487fc998..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MISharedLibChangedEvent.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; - - - -/** - * - */ -public class MISharedLibChangedEvent extends MIChangedEvent { - - String filename; - - public MISharedLibChangedEvent(MISession source, String name) { - this(source, 0, name); - } - - public MISharedLibChangedEvent(MISession source, int id, String name) { - super(source, id); - filename = name; - } - - public String getName() { - return filename; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MISharedLibCreatedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MISharedLibCreatedEvent.java deleted file mode 100644 index e2c8aff21ab..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MISharedLibCreatedEvent.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; - - - -/** - * - */ -public class MISharedLibCreatedEvent extends MICreatedEvent { - - String filename; - - public MISharedLibCreatedEvent(MISession source, String name) { - this(source, 0, name); - } - - public MISharedLibCreatedEvent(MISession source, int id, String name) { - super(source, id); - filename = name; - } - - public String getName() { - return filename; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MISharedLibEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MISharedLibEvent.java deleted file mode 100644 index 30cca3c4656..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MISharedLibEvent.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; - - - -/** - * - */ -public class MISharedLibEvent extends MIStoppedEvent { - - public MISharedLibEvent(MISession source, MIExecAsyncOutput async) { - super(source, async); - parse(); - } - - public MISharedLibEvent(MISession source, MIResultRecord record) { - super(source, record); - parse(); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MISharedLibUnloadedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MISharedLibUnloadedEvent.java deleted file mode 100644 index 5e8f4384beb..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MISharedLibUnloadedEvent.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; - -/** - * - */ -public class MISharedLibUnloadedEvent extends MIDestroyedEvent { - - String filename; - - public MISharedLibUnloadedEvent(MISession source, String name) { - this(source, 0, name); - } - - public MISharedLibUnloadedEvent(MISession source, int id, String name) { - super(source, id); - filename = name; - } - - public String getName() { - return filename; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MISignalChangedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MISignalChangedEvent.java deleted file mode 100644 index 190e0c2211b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MISignalChangedEvent.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; - - - -/** - * - */ -public class MISignalChangedEvent extends MIChangedEvent { - - String name; - - public MISignalChangedEvent(MISession source, String n) { - this(source, 0, n); - } - - public MISignalChangedEvent(MISession source, int id, String n) { - super(source, id); - name = n; - } - - public String getName() { - return name; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MISignalEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MISignalEvent.java deleted file mode 100644 index 08d0c001343..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MISignalEvent.java +++ /dev/null @@ -1,99 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIFrame; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MITuple; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - -/** - * *stopped,reason="signal-received",signal-name="SIGINT",signal-meaning="Interrupt",thread-id="0",frame={addr="0x400e18e1",func="__libc_nanosleep",args=[],file="__libc_nanosleep",line="-1"} - * - */ -public class MISignalEvent extends MIStoppedEvent { - - String sigName = ""; //$NON-NLS-1$ - String sigMeaning = ""; //$NON-NLS-1$ - - public MISignalEvent(MISession source, MIExecAsyncOutput async) { - super(source, async); - parse(); - } - - public MISignalEvent(MISession source, MIResultRecord record) { - super(source, record); - parse(); - } - - public String getName() { - return sigName; - } - - public String getMeaning() { - return sigMeaning; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("signal-name=" + sigName + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ - buffer.append("signal-meaning=" + sigMeaning + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ - buffer.append("thread-id=").append(getThreadId()).append('\n'); //$NON-NLS-1$ - MIFrame f = getFrame(); - if (f != null) { - buffer.append(f.toString()); - } - return buffer.toString(); - } - - void parse () { - MIExecAsyncOutput exec = getMIExecAsyncOutput(); - MIResultRecord rr = getMIResultRecord(); - - MIResult[] results = null; - if (exec != null) { - results = exec.getMIResults(); - } else if (rr != null) { - results = rr.getMIResults(); - } - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; //$NON-NLS-1$ - if (value instanceof MIConst) { - str = ((MIConst)value).getString(); - } - - if (var.equals("signal-name")) { //$NON-NLS-1$ - sigName = str; - } else if (var.equals("signal-meaning")) { //$NON-NLS-1$ - sigMeaning = str; - } else if (var.equals("thread-id")) { //$NON-NLS-1$ - try { - int id = Integer.parseInt(str.trim()); - setThreadId(id); - } catch (NumberFormatException e) { - } - } else if (var.equals("frame")) { //$NON-NLS-1$ - if (value instanceof MITuple) { - MIFrame f = new MIFrame((MITuple)value); - setFrame(f); - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MISteppingRangeEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MISteppingRangeEvent.java deleted file mode 100644 index d2f0cf0a838..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MISteppingRangeEvent.java +++ /dev/null @@ -1,80 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIFrame; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MITuple; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - -/** - * - * *stopped,reason="end-stepping-range",thread-id="0",frame={addr="0x08048538",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbffff18c"}],file="hello.c",line="13"} - */ -public class MISteppingRangeEvent extends MIStoppedEvent { - - public MISteppingRangeEvent(MISession source, MIExecAsyncOutput async) { - super(source, async); - parse(); - } - - public MISteppingRangeEvent(MISession source, MIResultRecord record) { - super(source, record); - parse(); - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("thread-id=").append(getThreadId()).append('\n'); //$NON-NLS-1$ - MIFrame f = getFrame(); - if (f != null) { - buffer.append(getFrame().toString()); - } - return buffer.toString(); - } - - void parse () { - MIResult[] results = null; - MIExecAsyncOutput exec = getMIExecAsyncOutput(); - MIResultRecord rr = getMIResultRecord(); - if (exec != null) { - results = exec.getMIResults(); - } else if (rr != null) { - results = rr.getMIResults(); - } - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - - if (var.equals("thread-id")) { //$NON-NLS-1$ - if (value instanceof MIConst) { - String str = ((MIConst)value).getString(); - try { - int id = Integer.parseInt(str.trim()); - setThreadId(id); - } catch (NumberFormatException e) { - } - } - } else if (var.equals("frame")) { //$NON-NLS-1$ - if (value instanceof MITuple) { - MIFrame f = new MIFrame((MITuple)value); - setFrame(f); - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIStoppedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIStoppedEvent.java deleted file mode 100644 index 331e4f4ff5b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIStoppedEvent.java +++ /dev/null @@ -1,99 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIFrame; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MITuple; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - - - -/** - * *stopped - * - */ -public class MIStoppedEvent extends MIEvent { - - private int threadId; - private MIFrame frame; - private MIExecAsyncOutput exec; - private MIResultRecord rr; - - public MIStoppedEvent(MISession source, MIExecAsyncOutput record) { - super(source, record.getToken()); - exec = record; - parse(); - } - - public MIStoppedEvent(MISession source, MIResultRecord record) { - super(source, record.getToken()); - rr = record; - parse(); - } - - public int getThreadId() { - return threadId; - } - - public void setThreadId(int id) { - threadId = id; - } - - public MIFrame getFrame() { - return frame; - } - - public void setFrame(MIFrame f) { - frame = f; - } - - public MIExecAsyncOutput getMIExecAsyncOutput() { - return exec; - } - - public MIResultRecord getMIResultRecord() { - return rr; - } - - void parse () { - MIResult[] results = null; - if (exec != null) { - results = exec.getMIResults(); - } else if (rr != null) { - results = rr.getMIResults(); - } - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - - if (var.equals("thread-id")) { //$NON-NLS-1$ - if (value instanceof MIConst) { - String str = ((MIConst)value).getString(); - try { - threadId = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } - } else if (var.equals("frame")) { //$NON-NLS-1$ - if (value instanceof MITuple) { - frame = new MIFrame((MITuple)value); - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIThreadCreatedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIThreadCreatedEvent.java deleted file mode 100644 index 15ff143f371..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIThreadCreatedEvent.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public class MIThreadCreatedEvent extends MICreatedEvent { - - int tid; - - public MIThreadCreatedEvent(MISession source, int id) { - this(source, 0, id); - } - - public MIThreadCreatedEvent(MISession source, int token, int id) { - super(source, token); - tid = id; - } - - public int getId() { - return tid; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIThreadExitEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIThreadExitEvent.java deleted file mode 100644 index 32b2e3a0f6f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIThreadExitEvent.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public class MIThreadExitEvent extends MIDestroyedEvent { - - int tid; - - public MIThreadExitEvent(MISession source, int id) { - this(source, 0, id); - } - - public MIThreadExitEvent(MISession source, int token, int id) { - super(source, token); - tid = id; - } - - public int getId() { - return tid; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIVarChangedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIVarChangedEvent.java deleted file mode 100644 index e3084c707e8..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIVarChangedEvent.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; - - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public class MIVarChangedEvent extends MIChangedEvent { - - String varName; - - public MIVarChangedEvent(MISession source, String var) { - this(source, 0, var); - } - - public MIVarChangedEvent(MISession source, int token, String var) { - super(source, token); - varName = var; - } - - public String getVarName() { - return varName; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIVarCreatedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIVarCreatedEvent.java deleted file mode 100644 index 9cdea25ce56..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIVarCreatedEvent.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; - - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public class MIVarCreatedEvent extends MICreatedEvent { - - String varName; - - public MIVarCreatedEvent(MISession source, String var) { - super(source, 0); - varName = var; - } - - public MIVarCreatedEvent(MISession source, int token, String var) { - super(source, token); - varName = var; - } - - public String getVarName() { - return varName; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIVarDeletedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIVarDeletedEvent.java deleted file mode 100644 index c2fbec222d5..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIVarDeletedEvent.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; - - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public class MIVarDeletedEvent extends MIDestroyedEvent { - - String varName; - - public MIVarDeletedEvent(MISession source, String var) { - this(source, 0, var); - } - - public MIVarDeletedEvent(MISession source, int token, String var) { - super(source, token); - varName = var; - } - - public String getVarName() { - return varName; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIWatchpointScopeEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIWatchpointScopeEvent.java deleted file mode 100644 index dfaf6c300eb..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIWatchpointScopeEvent.java +++ /dev/null @@ -1,85 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIFrame; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MITuple; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - -/** - * *stopped,reason="watchpoint-trigger",wpt={number="2",exp="i"},value={old="0",new="1"},thread-id="0",frame={addr="0x08048534",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbffff18c"}],file="hello.c",line="10"} - * - */ -public class MIWatchpointScopeEvent extends MIStoppedEvent { - - int number; - - public MIWatchpointScopeEvent(MISession source, MIExecAsyncOutput async) { - super(source, async); - parse(); - } - - public MIWatchpointScopeEvent(MISession source, MIResultRecord record) { - super(source, record); - parse(); - } - - public int getNumber() { - return number; - } - - void parse() { - MIExecAsyncOutput exec = getMIExecAsyncOutput(); - MIResultRecord rr = getMIResultRecord(); - - MIResult[] results = null; - if (exec != null) { - results = exec.getMIResults(); - } else if (rr != null) { - results = rr.getMIResults(); - } - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - - if (var.equals("wpnum")) { //$NON-NLS-1$ - if (value instanceof MIConst) { - String str = ((MIConst) value).getString(); - try { - number = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } - } else if (var.equals("thread-id")) { //$NON-NLS-1$ - if (value instanceof MIConst) { - String str = ((MIConst) value).getString(); - try { - int id = Integer.parseInt(str.trim()); - setThreadId(id); - } catch (NumberFormatException e) { - } - } - } else if (var.equals("frame")) { //$NON-NLS-1$ - if (value instanceof MITuple) { - MIFrame f = new MIFrame((MITuple) value); - setFrame(f); - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIWatchpointTriggerEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIWatchpointTriggerEvent.java deleted file mode 100644 index 965e932dd8d..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIWatchpointTriggerEvent.java +++ /dev/null @@ -1,156 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIFrame; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MITuple; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - -/** - * *stopped,reason="watchpoint-trigger",wpt={number="2",exp="i"},value={old="0",new="1"},thread-id="0",frame={addr="0x08048534",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbffff18c"}],file="hello.c",line="10"} - * - */ -public class MIWatchpointTriggerEvent extends MIStoppedEvent { - - int number; - String exp = ""; //$NON-NLS-1$ - String oldValue = ""; //$NON-NLS-1$ - String newValue = ""; //$NON-NLS-1$ - - public MIWatchpointTriggerEvent(MISession source, MIExecAsyncOutput async) { - super(source, async); - parse(); - } - - public MIWatchpointTriggerEvent(MISession source, MIResultRecord record) { - super(source, record); - parse(); - } - - public int getNumber() { - return number; - } - - public String getExpression() { - return exp; - } - - public String getOldValue() { - return oldValue; - } - - public String getNewValue() { - return newValue; - } - - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("number=").append(number).append('\n'); //$NON-NLS-1$ - buffer.append("expression=" + exp + "\n"); //$NON-NLS-1$//$NON-NLS-2$ - buffer.append("old=" + oldValue + "\n"); //$NON-NLS-1$//$NON-NLS-2$ - buffer.append("new=" + newValue + "\n"); //$NON-NLS-1$//$NON-NLS-2$ - buffer.append("thread-id=").append(getThreadId()).append('\n'); //$NON-NLS-1$ - MIFrame f = getFrame(); - if (f != null) { - buffer.append(f.toString()); - } - return buffer.toString(); - } - - void parse() { - MIResult[] results = null; - MIExecAsyncOutput exec = getMIExecAsyncOutput(); - MIResultRecord rr = getMIResultRecord(); - if (exec != null) { - results = exec.getMIResults(); - } else if (rr != null) { - results = rr.getMIResults(); - } - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - - if (var.equals("wpt") || var.equals("hw-awpt") || var.equals("hw-rwpt")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - if (value instanceof MITuple) { - parseWPT((MITuple) value); - } - } else if (var.equals("value")) { //$NON-NLS-1$ - if (value instanceof MITuple) { - parseValue((MITuple) value); - } - } else if (var.equals("thread-id")) { //$NON-NLS-1$ - if (value instanceof MIConst) { - String str = ((MIConst) value).getString(); - try { - int id = Integer.parseInt(str.trim()); - setThreadId(id); - } catch (NumberFormatException e) { - } - } - } else if (var.equals("frame")) { //$NON-NLS-1$ - if (value instanceof MITuple) { - MIFrame f = new MIFrame((MITuple) value); - setFrame(f); - } - } - } - } - } - - void parseWPT(MITuple tuple) { - MIResult[] results = tuple.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - - if (var.equals("number")) { //$NON-NLS-1$ - if (value instanceof MIConst) { - String str = ((MIConst) value).getString(); - try { - number = Integer.parseInt(str); - } catch (NumberFormatException e) { - } - } - } else if (var.equals("exp")) { //$NON-NLS-1$ - if (value instanceof MIConst) { - exp = ((MIConst) value).getString(); - } - } - } - } - - void parseValue(MITuple tuple) { - MIResult[] results = tuple.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; //$NON-NLS-1$ - if (value instanceof MIConst) { - str = ((MIConst) value).getString(); - } - - if (var.equals("old")) { //$NON-NLS-1$ - oldValue = str; - } else if (var.equals("new")) { //$NON-NLS-1$ - newValue = str; - } else if (var.equals("value")) { //$NON-NLS-1$ - oldValue = newValue = str; - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/CLIInfoProgramInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/CLIInfoProgramInfo.java deleted file mode 100644 index 3fe8cc6f3f5..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/CLIInfoProgramInfo.java +++ /dev/null @@ -1,76 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.StringTokenizer; - - -/** - * GDB/MI info program parsing. -(gdb) -info program -&"info program\n" -~"\tUsing the running image of child process 21301.\n" -~"Program stopped at 0x804853f.\n" -~"It stopped at breakpoint 1.\n" -~"Type \"info stack\" or \"info registers\" for more information.\n" -^done -(gdb) - - */ -public class CLIInfoProgramInfo extends MIInfo { - - int pid; - - public CLIInfoProgramInfo(MIOutput out) { - super(out); - parse(); - } - - public int getPID() { - return pid; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIOOBRecord[] oobs = out.getMIOOBRecords(); - for (int i = 0; i < oobs.length; i++) { - if (oobs[i] instanceof MIConsoleStreamOutput) { - MIStreamRecord cons = (MIStreamRecord) oobs[i]; - String str = cons.getString(); - // We are interested in the signal info - parseLine(str); - } - } - } - } - - void parseLine(String str) { - if (str != null && str.length() > 0) { - str = str.replace('.', ' '); - str = str.trim(); - if (str.startsWith("Using")) { //$NON-NLS-1$ - StringTokenizer st = new StringTokenizer(str); - while (st.hasMoreTokens()) { - String s = st.nextToken(); - if (Character.isDigit(s.charAt(0))) { - try { - pid = Integer.decode(s).intValue(); - break; - } catch (NumberFormatException e) { - } - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/CLIInfoSharedLibraryInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/CLIInfoSharedLibraryInfo.java deleted file mode 100644 index fafb73af866..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/CLIInfoSharedLibraryInfo.java +++ /dev/null @@ -1,192 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - -/** - * - */ -public class CLIInfoSharedLibraryInfo extends MIInfo { - - MIShared[] shared; - boolean isUnixFormat = true; - boolean hasProcessHeader = false; - - // HP-UX shared library view - private boolean isHPUXFormat; - static String mergestr=null; - - public CLIInfoSharedLibraryInfo(MIOutput out) { - super(out); - parse(); - } - - public MIShared[] getMIShared() { - return shared; - } - - void parse() { - List aList = new ArrayList(); - if (isDone()) { - MIOutput out = getMIOutput(); - MIOOBRecord[] oobs = out.getMIOOBRecords(); - for (int i = 0; i < oobs.length; i++) { - if (oobs[i] instanceof MIConsoleStreamOutput) { - MIStreamRecord cons = (MIStreamRecord) oobs[i]; - String str = cons.getString(); - // We are interested in the shared info - parseShared(str.trim(), aList); - } - } - } - shared = new MIShared[aList.size()]; - for (int i = 0; i < aList.size(); i++) { - shared[i] = (MIShared) aList.get(i); - } - } - - protected void parseShared(String str, List aList) { - if (!hasProcessHeader) { - // Process the header and choose a type. - if (str.startsWith("DLL")) { //$NON-NLS-1$ - // Cygwin info shared - isUnixFormat = false; - } else if(str.startsWith("Shared Object Libraries")) { //$NON-NLS-1$ - // HP-UX shared library view - isHPUXFormat = true; - } - hasProcessHeader = true; - } else if (isHPUXFormat) { - // FIX : HP-UX shared library view - if(str.startsWith("0x")) { //$NON-NLS-1$ - //merging... - mergestr +=" "+str; //$NON-NLS-1$ - parseHPUXShared(mergestr, aList); - return; - } else if(str.startsWith("tstart")) { //$NON-NLS-1$ - return; - } else { - // new shareed library entry...; - mergestr = new String(str); - return; - } - } else if (isUnixFormat) { - parseUnixShared(str, aList); - } else { - parseWinShared(str, aList); - } - } - - /** - * We do the parsing backward because on some Un*x system, the To or the From - * and even the "Sym Read" can be empty.... - * @param str - * @param aList - */ - void parseUnixShared(String str, List aList) { - if (str.length() > 0) { - // Pass the header - int index = -1; - String from = ""; //$NON-NLS-1$ - String to = ""; //$NON-NLS-1$ - boolean syms = false; - String name = ""; //$NON-NLS-1$ - - for (int i = 0;(index = str.lastIndexOf(' ')) != -1 || i <= 3; i++) { - if (index == -1) { - index = 0; - } - String sub = str.substring(index).trim(); - // move to previous column - str = str.substring(0, index).trim(); - switch (i) { - case 0 : - name = sub; - break; - case 1 : - if (sub.equalsIgnoreCase("Yes")) { //$NON-NLS-1$ - syms = true; - } - break; - case 2 : // second column is "To" - to = sub; - break; - case 3 : // first column is "From" - from = sub; - break; - } - } - if (name.length() > 0) { - MIShared s = new MIShared(from, to, syms, name); - aList.add(s); - } - } - } - - // FIX : HP-UX shared library view - void parseHPUXShared(String str, List aList) { - if (str.length() > 0) { - // Pass the header - int index = -1; - String from = ""; //$NON-NLS-1$ - String to = ""; //$NON-NLS-1$ - boolean syms = false; - String name = ""; //$NON-NLS-1$ - - for (int i = 0;(index = str.indexOf(' ')) != -1 || i < 3; i++) - { - if (index == -1) { - index = 0; - } - - String sub = str.substring(0,index).trim(); - str= str.substring(index).trim(); - switch (i) { - case 0 : - name = sub; - break; - case 2 : // second column is "To" - to = sub; - break; - case 1 : // first column is "From" - from = sub; - break; - } - } - syms=true; - if (name.length() > 0) { - MIShared s = new MIShared(from, to, syms, name); - aList.add(s); - } - } - } // end fo fix - - void parseWinShared(String str, List aList) { - String from = ""; //$NON-NLS-1$ - String to = ""; //$NON-NLS-1$ - boolean syms = true; - - int index = str.lastIndexOf(' '); - if (index > 0) { - String sub = str.substring(index).trim(); - // Go figure they do not print the "0x" to indicate hexadecimal!! - if (!sub.startsWith("0x")) { //$NON-NLS-1$ - sub = "0x" + sub; //$NON-NLS-1$ - } - from = sub; - str = str.substring(0, index).trim(); - } - MIShared s = new MIShared(from, to, syms, str.trim()); - aList.add(s); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/CLIInfoSignalsInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/CLIInfoSignalsInfo.java deleted file mode 100644 index b39ed41acf4..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/CLIInfoSignalsInfo.java +++ /dev/null @@ -1,115 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; -import java.util.StringTokenizer; - -/** - * GDB/MI signal table parsing. - info signals - &"info signals\n" - ~"Signal Stop\tPrint\tPass to program\tDescription\n" - ~"\n" - ~"SIGHUP Yes\tYes\tYes\t\tHangup\n" - ~"SIGINT Yes\tYes\tNo\t\tInterrupt\n" - ~"SIGQUIT Yes\tYes\tYes\t\tQuit\n" - ~"SIGILL Yes\tYes\tYes\t\tIllegal instruction\n" - ~"SIGTRAP Yes\tYes\tNo\t\tTrace/breakpoint trap\n" - ~"SIGABRT Yes\tYes\tYes\t\tAborted\n" - ~"SIGEMT Yes\tYes\tYes\t\tEmulation trap\n" - */ -public class CLIInfoSignalsInfo extends MIInfo { - - MISigHandle[] signals; - - public CLIInfoSignalsInfo(MIOutput out) { - super(out); - parse(); - } - - public MISigHandle[] getMISignals() { - return signals; - } - - void parse() { - List aList = new ArrayList(); - if (isDone()) { - MIOutput out = getMIOutput(); - MIOOBRecord[] oobs = out.getMIOOBRecords(); - for (int i = 0; i < oobs.length; i++) { - if (oobs[i] instanceof MIConsoleStreamOutput) { - MIStreamRecord cons = (MIStreamRecord) oobs[i]; - String str = cons.getString(); - // We are interested in the signal info - parseSignal(str.trim(), aList); - } - } - } - signals = new MISigHandle[aList.size()]; - for (int i = 0; i < aList.size(); i++) { - signals[i] = (MISigHandle)aList.get(i); - } - } - - void parseSignal(String str, List aList) { - if (str.length() > 0) { - // Pass the header and th tailer. - // ~"Signal Stop\tPrint\tPass to program\tDescription\n" - // ~"Use the \"handle\" command to change these tables.\n" - if (!str.startsWith("Signal ") && !str.startsWith("Use ")) { //$NON-NLS-1$ //$NON-NLS-2$ - String signal = ""; //$NON-NLS-1$ - boolean stop = false; - boolean print = false; - boolean pass = false; - String desc = ""; //$NON-NLS-1$ - - StringTokenizer tokenizer = new StringTokenizer(str); - for (int i = 0; tokenizer.hasMoreTokens(); i++) { - String sub = null; - if (i == 4) { - sub = tokenizer.nextToken("\n"); //$NON-NLS-1$ - } else { - sub = tokenizer.nextToken(); - } - switch (i) { - case 0: // first column is "Signal" - signal = sub; - break; - case 1: // second column is "Stop" - stop = getBoolean(sub); - break; - case 2: // third column is "Print" - print = getBoolean(sub); - break; - case 3: // third column is "Pass to Program" - pass = getBoolean(sub); - break; - case 4: // last column is "Description" - desc = sub; - break; - } - } - MISigHandle s = new MISigHandle(signal, stop, print, pass, desc.trim()); - aList.add(s); - } - } - } - - static boolean getBoolean(String value) { - if (value != null && value.equalsIgnoreCase("Yes")) { //$NON-NLS-1$ - return true; - } - return false; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/CLIInfoThreadsInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/CLIInfoThreadsInfo.java deleted file mode 100644 index ac2785c0b3f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/CLIInfoThreadsInfo.java +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - * GDB/MI thread list parsing. -~"\n" -~" 2 Thread 2049 (LWP 29354) " -~"* 1 Thread 1024 (LWP 29353) " - - */ -public class CLIInfoThreadsInfo extends MIInfo { - - protected int[] threadIds; - protected int currentThreadId; - - public CLIInfoThreadsInfo(MIOutput out) { - super(out); - parse(); - } - - public int[] getThreadIds() { - return threadIds; - } - - public String[] getThreadNames() { - return null; - } - - public int getCurrentThread() { - return currentThreadId; - } - - protected void parse() { - List aList = new ArrayList(); - if (isDone()) { - MIOutput out = getMIOutput(); - MIOOBRecord[] oobs = out.getMIOOBRecords(); - for (int i = 0; i < oobs.length; i++) { - if (oobs[i] instanceof MIConsoleStreamOutput) { - MIStreamRecord cons = (MIStreamRecord) oobs[i]; - String str = cons.getString(); - // We are interested in finding the current thread - parseThreadInfo(str.trim(), aList); - } - } - } - threadIds = new int[aList.size()]; - for (int i = 0; i < aList.size(); i++) { - threadIds[i] = ((Integer) aList.get(i)).intValue(); - } - Arrays.sort(threadIds); - } - - protected void parseThreadInfo(String str, List aList) { - if (str.length() > 0) { - boolean isCurrentThread = false; - // Discover the current thread - if (str.charAt(0) == '*') { - isCurrentThread = true; - str = str.substring(1).trim(); - } - // Fetch the threadId - if (str.length() > 0 && Character.isDigit(str.charAt(0))) { - int i = 1; - while (i < str.length() && Character.isDigit(str.charAt(i))) { - i++; - } - String number = str.substring(0, i); - try { - Integer num = Integer.valueOf(number); - aList.add(num); - if (isCurrentThread) { - currentThreadId = num.intValue(); - } - } catch (NumberFormatException e) { - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/CLIPTypeInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/CLIPTypeInfo.java deleted file mode 100644 index 2a01e0829e6..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/CLIPTypeInfo.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI whatis parsing. - */ -public class CLIPTypeInfo extends MIInfo { - - String type; - - public CLIPTypeInfo(MIOutput out) { - super(out); - parse(); - } - - public String getType() { - return type; - } - - void parse() { - StringBuffer buffer = new StringBuffer(); - if (isDone()) { - MIOutput out = getMIOutput(); - MIOOBRecord[] oobs = out.getMIOOBRecords(); - for (int i = 0; i < oobs.length; i++) { - if (oobs[i] instanceof MIConsoleStreamOutput) { - MIStreamRecord cons = (MIStreamRecord) oobs[i]; - String str = cons.getString(); - // We are interested in the shared info - if (str != null) { - str = str.trim(); - if (str.startsWith ("type")) { //$NON-NLS-1$ - int equal = str.indexOf('='); - if (equal > 0) { - str = str.substring(equal + 1); - } - } - buffer.append(str); - } - } - } - } - type = buffer.toString().trim(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/CLIWhatisInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/CLIWhatisInfo.java deleted file mode 100644 index 1be47995732..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/CLIWhatisInfo.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI whatis parsing. - */ -public class CLIWhatisInfo extends MIInfo { - - String type; - - public CLIWhatisInfo(MIOutput out) { - super(out); - parse(); - } - - public String getType() { - return type; - } - - void parse() { - StringBuffer buffer = new StringBuffer(); - if (isDone()) { - MIOutput out = getMIOutput(); - MIOOBRecord[] oobs = out.getMIOOBRecords(); - for (int i = 0; i < oobs.length; i++) { - if (oobs[i] instanceof MIConsoleStreamOutput) { - MIStreamRecord cons = (MIStreamRecord) oobs[i]; - String str = cons.getString(); - // We are interested in the shared info - if (str != null) { - str = str.trim(); - if (str.startsWith ("type")) { //$NON-NLS-1$ - int equal = str.indexOf('='); - if (equal > 0) { - str = str.substring(equal + 1); - } - } - buffer.append(str); - } - } - } - } - type = buffer.toString().trim(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIArg.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIArg.java deleted file mode 100644 index 60372a79ccc..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIArg.java +++ /dev/null @@ -1,130 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - - -/** - * Represents a set name=value. - */ -public class MIArg { - String name; - String value; - - public MIArg(String name, String value) { - this.name = name; - this.value = value; - } - - public String getName() { - return name; - } - - public String getValue() { - return value; - } - - /** - * Parsing a MIList of the form: - * [{name="xxx",value="yyy"},{name="xxx",value="yyy"},..] - * [name="xxx",name="xxx",..] - * [{name="xxx"},{name="xxx"}] - */ - public static MIArg[] getMIArgs(MIList miList) { - List aList = new ArrayList(); - MIValue[] values = miList.getMIValues(); - for (int i = 0; i < values.length; i++) { - if (values[i] instanceof MITuple) { - MIArg arg = getMIArg((MITuple)values[i]); - if (arg != null) { - aList.add(arg); - } - } - } - MIResult[] results = miList.getMIResults(); - for (int i = 0; i < results.length; i++) { - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - String str = ((MIConst)value).getCString(); - aList.add(new MIArg(str, "")); //$NON-NLS-1$ - } - } - return ((MIArg[])aList.toArray(new MIArg[aList.size()])); - } - - /** - * Parsing a MITuple of the form: - * {{name="xxx",value="yyy"},{name="xxx",value="yyy"},..} - * {name="xxx",name="xxx",..} - * {{name="xxx"},{name="xxx"}} - */ - public static MIArg[] getMIArgs(MITuple miTuple) { - List aList = new ArrayList(); - MIValue[] values = miTuple.getMIValues(); - for (int i = 0; i < values.length; i++) { - if (values[i] instanceof MITuple) { - MIArg arg = getMIArg((MITuple)values[i]); - if (arg != null) { - aList.add(arg); - } - } - } - MIResult[] results = miTuple.getMIResults(); - for (int i = 0; i < results.length; i++) { - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - String str = ((MIConst)value).getCString(); - aList.add(new MIArg(str, "")); //$NON-NLS-1$ - } - } - return ((MIArg[])aList.toArray(new MIArg[aList.size()])); - } - /** - * Parsing a MITuple of the form: - * {name="xxx",value="yyy"} - * {name="xxx"} - */ - public static MIArg getMIArg(MITuple tuple) { - MIResult[] args = tuple.getMIResults(); - MIArg arg = null; - if (args.length > 0) { - // Name - String aName = ""; //$NON-NLS-1$ - MIValue value = args[0].getMIValue(); - if (value != null && value instanceof MIConst) { - aName = ((MIConst)value).getCString(); - } else { - aName = ""; //$NON-NLS-1$ - } - - // Value - String aValue = ""; //$NON-NLS-1$ - if (args.length == 2) { - value = args[1].getMIValue(); - if (value != null && value instanceof MIConst) { - aValue = ((MIConst)value).getCString(); - } else { - aValue = ""; //$NON-NLS-1$ - } - } - - arg = new MIArg(aName, aValue); - } - return arg; - } - - public String toString() { - return name + "=" + value; //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIAsm.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIAsm.java deleted file mode 100644 index 945207797ba..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIAsm.java +++ /dev/null @@ -1,116 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * Represent a GDB Tuple MI assembly response. - */ -public class MIAsm { - String address; - String function = ""; //$NON-NLS-1$ - String opcode = ""; //$NON-NLS-1$ - String args = ""; //$NON-NLS-1$ - long offset; - - public MIAsm (MITuple tuple) { - parse(tuple); - } - - public String getAddress() { - return address; - } - - public String getFunction() { - return function; - } - - public long getOffset() { - return offset; - } - - public String getInstruction() { - return opcode + " " + args; //$NON-NLS-1$ - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append('{'); - buffer.append("address=\"" + address +"\""); //$NON-NLS-1$//$NON-NLS-2$ - buffer.append(",func-name=\"" + function + "\""); //$NON-NLS-1$//$NON-NLS-2$ - buffer.append(",offset=\"").append(offset).append('"'); //$NON-NLS-1$ - buffer.append(",inst=\"" + getInstruction() + "\""); //$NON-NLS-1$//$NON-NLS-2$ - buffer.append('}'); - return buffer.toString(); - } - - void parse(MITuple tuple) { - MIResult[] results = tuple.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; //$NON-NLS-1$ - - if (value != null && value instanceof MIConst) { - str = ((MIConst)value).getCString(); - } - - if (var.equals("address")) { //$NON-NLS-1$ - try { - address = str.trim(); - } catch (NumberFormatException e) { - } - } else if (var.equals("func-name")) { //$NON-NLS-1$ - function = str; - } else if (var.equals("offset")) { //$NON-NLS-1$ - try { - offset = Long.decode(str.trim()).longValue(); - } catch (NumberFormatException e) { - } - } else if (var.equals("inst")) { //$NON-NLS-1$ - /* for the instruction, we do not want the C string but the - translated string since the only thing we are doing is - displaying it. */ - str = ((MIConst)value).getString(); - - char chars[] = str.toCharArray(); - int index = 0; - - // count the non-whitespace characters. - while( (index < chars.length) && (chars[index] > '\u0020')) - index++; - - opcode = str.substring( 0, index ); - - // skip any whitespace characters - while( index < chars.length && chars[index] >= '\u0000' && chars[index] <= '\u0020') - index++; - - // guard no argument - if( index < chars.length ) - args = str.substring( index ); - } - } - } - - /** - * @return String - */ - public String getArgs() { - return args; - } - - /** - * @return String - */ - public String getOpcode() { - return opcode; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIAsyncRecord.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIAsyncRecord.java deleted file mode 100644 index 0ab0425095c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIAsyncRecord.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.output; - -/** - * base Abstract class for the OOB stream MI responses. - */ -public abstract class MIAsyncRecord extends MIOOBRecord { - - final static MIResult[] nullResults = new MIResult[0]; - - MIResult[] results = null; - String asynClass = ""; //$NON-NLS-1$ - int token = 0; - - public int getToken() { - return token; - } - - public void setToken(int t) { - token = t; - } - - public String getAsyncClass() { - return asynClass; - } - - public void setAsyncClass(String a) { - asynClass = a; - } - - public MIResult[] getMIResults() { - if (results == null) { - return nullResults; - } - return results; - } - - public void setMIResults(MIResult[] res) { - results = res; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - if (token != 0) { - buffer.append(token); - } - if (this instanceof MIExecAsyncOutput) { - buffer.append('*'); - } else if (this instanceof MIStatusAsyncOutput) { - buffer.append('+'); - } else if (this instanceof MINotifyAsyncOutput) { - buffer.append('='); - } - buffer.append(asynClass); - if (results != null) { - for (int i = 0; i < results.length; i++) { - buffer.append(','); - buffer.append(results.toString()); - } - } - buffer.append('\n'); - return buffer.toString(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIBreakInsertInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIBreakInsertInfo.java deleted file mode 100644 index 278863a7421..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIBreakInsertInfo.java +++ /dev/null @@ -1,86 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - - -/** - * -break-insert main - * ^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x08048468",func="main",file="hello.c",line="4",times="0"} - * -break-insert -a p - * ^done,hw-awpt={number="2",exp="p"} - * -break-watch -r p - * ^done,hw-rwpt={number="4",exp="p"} - * -break-watch p - * ^done,wpt={number="6",exp="p"} - */ -public class MIBreakInsertInfo extends MIInfo { - - MIBreakpoint[] breakpoints; - - void parse() { - List aList = new ArrayList(1); - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue val = results[i].getMIValue(); - MIBreakpoint bpt = null; - if (var.equals("wpt")) { //$NON-NLS-1$ - if (val instanceof MITuple) { - bpt = new MIBreakpoint((MITuple)val); - bpt.setEnabled(true); - bpt.setWriteWatchpoint(true); - } - } else if (var.equals("bkpt")) { //$NON-NLS-1$ - if (val instanceof MITuple) { - bpt = new MIBreakpoint((MITuple)val); - bpt.setEnabled(true); - } - } else if (var.equals("hw-awpt")) { //$NON-NLS-1$ - if (val instanceof MITuple) { - bpt = new MIBreakpoint((MITuple)val); - bpt.setAccessWatchpoint(true); - bpt.setEnabled(true); - } - } else if (var.equals("hw-rwpt")) { //$NON-NLS-1$ - if (val instanceof MITuple) { - bpt = new MIBreakpoint((MITuple)val); - bpt.setReadWatchpoint(true); - bpt.setEnabled(true); - } - } - if (bpt != null) { - aList.add(bpt); - } - } - } - } - breakpoints = (MIBreakpoint[])aList.toArray(new MIBreakpoint[aList.size()]); - } - - public MIBreakInsertInfo(MIOutput record) { - super(record); - } - - public MIBreakpoint[] getMIBreakpoints() { - if (breakpoints == null) { - parse(); - } - return breakpoints; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIBreakListInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIBreakListInfo.java deleted file mode 100644 index 20aeb7206c2..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIBreakListInfo.java +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - - -/** - * A -break-list result-record is the form: - * <pre> - * ^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[..],body=[brkpt={},brkpt={}]} - *-break-list -^done,BreakpointTable={nr_rows="6",nr_cols="6",hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0804846b",func="main",file="hello.c",line="4",times="0"},bkpt={number="2",type="breakpoint",disp="del",enabled="y",addr="0x0804846b",func="main",file="hello.c",line="4",times="0"},bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x0804846b",func="main",file="hello.c",line="4",cond="1",times="0"},bkpt={number="4",type="hw breakpoint",disp="keep",enabled="y",addr="0x0804846b",func="main",file="hello.c",line="4",times="0"},bkpt={number="5",type="breakpoint",disp="keep",enabled="y",addr="0x0804846b",func="main",file="hello.c",line="4",thread="0",thread="0",times="0"},bkpt={number="6",type="breakpoint",disp="keep",enabled="y",addr="0x0804846b",func="main",file="hello.c",line="4",thread="1",thread="1",times="0"}]} - * </pre> - */ -public class MIBreakListInfo extends MIInfo { - - MIBreakpoint[] breakpoints; - - public MIBreakListInfo(MIOutput rr) { - super(rr); - } - - public MIBreakpoint[] getMIBreakpoints() { - if (breakpoints == null) { - parse(); - } - return breakpoints; - } - - void parse() { - List aList = new ArrayList(1); - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("BreakpointTable")) { //$NON-NLS-1$ - parseTable(results[i].getMIValue(), aList); - } - } - } - } - breakpoints = (MIBreakpoint[])aList.toArray(new MIBreakpoint[aList.size()]); - } - - void parseTable(MIValue val, List aList) { - if (val instanceof MITuple) { - MIResult[] table = ((MITuple)val).getMIResults(); - for (int j = 0; j < table.length; j++) { - String variable = table[j].getVariable(); - if (variable.equals("body")) { //$NON-NLS-1$ - parseBody(table[j].getMIValue(), aList); - } - } - } - } - - void parseBody(MIValue body, List aList) { - if (body instanceof MIList) { - MIResult[] bkpts = ((MIList)body).getMIResults(); - for (int i = 0; i < bkpts.length; i++) { - String b = bkpts[i].getVariable(); - if (b.equals("bkpt")) { //$NON-NLS-1$ - MIValue value = bkpts[i].getMIValue(); - if (value instanceof MITuple) { - aList.add(new MIBreakpoint((MITuple)value)); - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIBreakWatchInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIBreakWatchInfo.java deleted file mode 100644 index dcbf26ddda3..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIBreakWatchInfo.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.output; - - -/** - * -break-watch buf - * ^done,wpt={number="2",exp="buf"} - */ -public class MIBreakWatchInfo extends MIBreakInsertInfo { - - public MIBreakWatchInfo(MIOutput rr) { - super(rr); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIBreakpoint.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIBreakpoint.java deleted file mode 100644 index db987cf4a08..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIBreakpoint.java +++ /dev/null @@ -1,266 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.output; - -/** - * Contain info about the GDB/MI breakpoint info. - *<ul> - * <li> - * -break-insert main - * ^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0804846b",func="main",file="hello.c",line="4",times="0"} - * (gdb) - * </li> - * <li> - * -break-insert -t main - * ^done,bkpt={number="2",type="breakpoint",disp="del",enabled="y",addr="0x0804846b",func="main",file="hello.c",line="4",times="0"} - * </li> - * <li> - * -break-insert -c 1 main -^done,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x0804846b",func="main",file="hello.c",line="4",cond="1",times="0"} - * </li> - * <li> - * -break-insert -h main - * ^done,bkpt={number="4",type="hw breakpoint",disp="keep",enabled="y",addr="0x0804846b",func="main",file="hello.c",line="4",times="0"} - * <li> - * -break-insert -p 0 main - * ^done,bkpt={number="5",type="breakpoint",disp="keep",enabled="y",addr="0x0804846b",func="main",file="hello.c",line="4",thread="0",thread="0",times="0"} - * </li> - * <li> - * -break-insert -a p - * ^done,hw-awpt={number="2",exp="p"} - * </li> - * <li> - * -break-watch -r p - * ^done,hw-rwpt={number="4",exp="p"} - * </li> - * <li> - * -break-watch p - * ^done,wpt={number="6",exp="p"} - * </li> - *</ul> - */ -public class MIBreakpoint { - - int number; - String type = ""; //$NON-NLS-1$ - String disp = ""; //$NON-NLS-1$ - boolean enabled; - String address; - String func = ""; //$NON-NLS-1$ - String file = ""; //$NON-NLS-1$ - int line; - String cond = ""; //$NON-NLS-1$ - int times; - String what = ""; //$NON-NLS-1$ - String threadId = ""; //$NON-NLS-1$ - int ignore; - - boolean isWpt; - boolean isAWpt; - boolean isRWpt; - boolean isWWpt; - boolean isHdw; - - public MIBreakpoint(MITuple tuple) { - parse(tuple); - } - - public int getNumber() { - return number; - } - - public void setNumber(int num) { - number = num; - } - - public String getType() { - return type; - } - - public boolean isTemporary() { - return getDisposition().equals("del"); //$NON-NLS-1$ - } - - public boolean isWatchpoint() { - return isWpt; - } - - public void setWatchpoint(boolean w) { - isWpt = w; - } - - public boolean isHardware() { - return isHdw; - } - - public void setHardware(boolean hd) { - isWpt = hd; - isHdw = hd; - } - - public boolean isAccessWatchpoint() { - return isAWpt; - } - - public void setAccessWatchpoint(boolean a) { - isWpt = a; - isAWpt = a; - } - - public boolean isReadWatchpoint() { - return isRWpt; - } - - public void setReadWatchpoint(boolean r) { - isWpt = r; - isRWpt = r; - } - - public boolean isWriteWatchpoint() { - return isWWpt; - } - - public void setWriteWatchpoint(boolean w) { - isWpt = w; - isWWpt = w; - } - - public String getDisposition() { - return disp; - } - - public boolean isEnabled() { - return enabled; - } - - public void setEnabled(boolean e) { - enabled = e; - } - - public String getAddress() { - return address; - } - - public String getFunction() { - return func; - } - - public String getFile() { - return file; - } - - public int getLine() { - return line; - } - - public int getTimes() { - return times; - } - - public String getWhat() { - return what; - } - - public int getIgnoreCount() { - return ignore; - } - - public String getCondition() { - return cond; - } - - public String getThreadId() { - return threadId; - } - - void parse(MITuple tuple) { - MIResult[] results = tuple.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; //$NON-NLS-1$ - if (value != null && value instanceof MIConst) { - str = ((MIConst)value).getCString(); - } - - if (var.equals("number")) { //$NON-NLS-1$ - try { - number = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } else if (var.equals("type")) { //$NON-NLS-1$ - type = str; - //type="hw watchpoint" - if (type.startsWith("hw")) { //$NON-NLS-1$ - isHdw = true; - isWWpt = true; - isWpt = true; - } - //type="acc watchpoint" - if (type.startsWith("acc")) { //$NON-NLS-1$ - isWWpt = true; - isRWpt = true; - isWpt = true; - } - //type="read watchpoint" - if (type.startsWith("read")) { //$NON-NLS-1$ - isRWpt = true; - isWpt = true; - } - // ?? - if (type.equals("watchpoint")) { //$NON-NLS-1$ - isWpt = true; - } - // type="breakpoint" - // default ok. - } else if (var.equals("disp")) { //$NON-NLS-1$ - disp = str; - } else if (var.equals("enabled")) { //$NON-NLS-1$ - enabled = str.equals("y"); //$NON-NLS-1$ - } else if (var.equals("addr")) { //$NON-NLS-1$ - try { - address = str.trim(); - } catch (NumberFormatException e) { - } - } else if (var.equals("func")) { //$NON-NLS-1$ - func = str; - } else if (var.equals("file")) { //$NON-NLS-1$ - file = str; - } else if (var.equals("thread")) { //$NON-NLS-1$ - threadId = str; - } else if (var.equals("line")) { //$NON-NLS-1$ - try { - line = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } else if (var.equals("times")) { //$NON-NLS-1$ - try { - times = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } else if (var.equals("what") || var.equals("exp")) { //$NON-NLS-1$ //$NON-NLS-2$ - what = str; - } else if (var.equals("ignore")) { //$NON-NLS-1$ - try { - ignore = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } else if (var.equals("cond")) { //$NON-NLS-1$ - cond = str; - } - } - } - - public void setFile(String file) { - this.file = file; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIConsoleStreamOutput.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIConsoleStreamOutput.java deleted file mode 100644 index 6fd8894dc61..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIConsoleStreamOutput.java +++ /dev/null @@ -1,18 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.output; - -/** - * @see MIStreamRecord - */ -public class MIConsoleStreamOutput extends MIStreamRecord { -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIConst.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIConst.java deleted file mode 100644 index bc32352adad..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIConst.java +++ /dev/null @@ -1,122 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI const value represents a ios-c string. - */ -public class MIConst extends MIValue { - String cstring = ""; //$NON-NLS-1$ - - public String getCString() { - return cstring; - } - - public void setCString(String str) { - cstring = str; - } - - /** - * Translate gdb c-string. - */ - public String getString() { - return getString(cstring); - } - - public static String getString(String str) { - StringBuffer buffer = new StringBuffer(); - boolean escape = false; - for (int i = 0; i < str.length(); i++) { - char c = str.charAt(i); - if (c == '\\') { - if (escape) { - buffer.append(c); - escape = false; - } else { - escape = true; - } - } else { - if (escape) { - if (isIsoCSpecialChar(c)) { - buffer.append(isoC(c)); - } else { - buffer.append('\\'); - buffer.append(c); - } - } else { - buffer.append(c); - } - escape = false; - } - } - - // If escape is still true it means that the - // last char was an '\'. - if (escape) { - buffer.append('\\'); - } - - return buffer.toString(); - } - - public String toString() { - return getCString(); - } - - /** - * Assuming that the precedent character was the - * escape sequence '\' - */ - private static String isoC(char c) { - String s = new Character(c).toString(); - if (c == '"') { - s = "\""; //$NON-NLS-1$ - } else if (c == '\'') { - s = "\'"; //$NON-NLS-1$ - } else if (c == '?') { - s = "?"; //$NON-NLS-1$ - } else if (c == 'a') { - s = "\007"; //$NON-NLS-1$ - } else if (c == 'b') { - s = "\b"; //$NON-NLS-1$ - } else if (c == 'f') { - s = "\f"; //$NON-NLS-1$ - } else if (c == 'n') { - s = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$ $NON-NLS-2$ - } else if (c == 'r') { - s = "\r"; //$NON-NLS-1$ - } else if (c == 't') { - s = "\t"; //$NON-NLS-1$ - } else if (c == 'v') { - s = "\013"; //$NON-NLS-1$ - } - return s; - } - - private static boolean isIsoCSpecialChar(char c) { - switch (c) { - case '"': - case '\'': - case '?': - case 'a': - case 'b': - case 'f': - case 'n': - case 'r': - case 't': - case 'v': - return true; - } - return false; - - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIDataDisassembleInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIDataDisassembleInfo.java deleted file mode 100644 index 44e5771d504..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIDataDisassembleInfo.java +++ /dev/null @@ -1,121 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - -/** - * GDB/MI disassemble parsing response. - */ -public class MIDataDisassembleInfo extends MIInfo { - - MISrcAsm[] src_asm; - MIAsm[] asm; - boolean mixed; - - public MIDataDisassembleInfo(MIOutput rr) { - super(rr); - mixed = false; - parse(); - } - - public MIAsm[] getMIAsms() { - return asm; - } - - public boolean isMixed() { - return mixed; - } - - public MISrcAsm[] getMISrcAsms() { - return src_asm; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("asm_insns=["); //$NON-NLS-1$ - - if (isMixed()) { - MISrcAsm[] array = getMISrcAsms(); - for (int i = 0; i < array.length; i++) { - if (i != 0) { - buffer.append(','); - } - buffer.append(array[i].toString()); - } - } else { - MIAsm[] array = getMIAsms(); - for (int i = 0; i < array.length; i++) { - if (i != 0) { - buffer.append(','); - } - buffer.append(array[i].toString()); - } - } - buffer.append("]"); //$NON-NLS-1$ - return buffer.toString(); - } - - void parse() { - List asmList = new ArrayList(); - List srcList = new ArrayList(); - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("asm_insns")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MIList) { - parse((MIList)value, srcList, asmList); - } - } - } - } - } - src_asm = (MISrcAsm[])srcList.toArray(new MISrcAsm[srcList.size()]); - asm = (MIAsm[])asmList.toArray(new MIAsm[asmList.size()]); - } - - void parse(MIList list, List srcList, List asmList) { - // src and assenbly is different - - // Mixed mode. - MIResult[] results = list.getMIResults(); - if (results != null && results.length > 0) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("src_and_asm_line")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MITuple) { - srcList.add(new MISrcAsm((MITuple)value)); - } - } - } - mixed = true; - } - - // Non Mixed with source - MIValue[] values = list.getMIValues(); - if (values != null && values.length > 0) { - for (int i = 0; i < values.length; i++) { - if (values[i] instanceof MITuple) { - asmList.add(new MIAsm((MITuple)values[i])); - } - } - mixed = false; - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIDataEvaluateExpressionInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIDataEvaluateExpressionInfo.java deleted file mode 100644 index f798092be18..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIDataEvaluateExpressionInfo.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.output; - - -/** - * GDB/MI Data evalue expression parsing response. - */ -public class MIDataEvaluateExpressionInfo extends MIInfo{ - - String expr; - - public MIDataEvaluateExpressionInfo(MIOutput rr) { - super(rr); - } - - public String getExpression() { - if (expr == null) { - parse(); - } - return expr; - } - - void parse() { - expr = ""; //$NON-NLS-1$ - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("value")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - expr = ((MIConst)value).getCString(); - } - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIDataListChangedRegistersInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIDataListChangedRegistersInfo.java deleted file mode 100644 index cbd19733ff5..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIDataListChangedRegistersInfo.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - -/** - * GDB/MI data list changed registers response parsing. - */ -public class MIDataListChangedRegistersInfo extends MIInfo { - - int[] registers; - - public MIDataListChangedRegistersInfo(MIOutput rr) { - super(rr); - } - - public int[] getRegisterNumbers() { - if (registers == null) { - parse(); - } - return registers; - } - - void parse() { - List aList = new ArrayList(); - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("changed-registers")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MIList) { - parseRegisters((MIList)value, aList); - } - } - } - } - } - registers = new int[aList.size()]; - for (int i = 0; i < aList.size(); i++) { - String str = (String)aList.get(i); - try { - registers[i] = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } - } - - void parseRegisters(MIList list, List aList) { - MIValue[] values = list.getMIValues(); - for (int i = 0; i < values.length; i++) { - if (values[i] instanceof MIConst) { - String str = ((MIConst)values[i]).getCString(); - if (str != null && str.length() > 0) { - aList.add(str); - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIDataListRegisterNamesInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIDataListRegisterNamesInfo.java deleted file mode 100644 index d9fc474be3b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIDataListRegisterNamesInfo.java +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - -/** - * GDB/MI data list regiter names response extraction. - */ -public class MIDataListRegisterNamesInfo extends MIInfo { - - String[] names; - protected int realNameCount = 0; - - public MIDataListRegisterNamesInfo(MIOutput rr) { - super(rr); - } - - /** - * @return the list of register names. This list can include 0 length - * strings in the case where the underlying GDB has a sparse set of - * registers. They are returned as 0 length strings - */ - public String[] getRegisterNames() { - if (names == null) { - parse(); - } - return names; - } - - void parse() { - List aList = new ArrayList(); - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("register-names")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MIList) { - parseRegisters((MIList) value, aList); - } - } - } - } - } - names = (String[]) aList.toArray(new String[aList.size()]); - } - - void parseRegisters(MIList list, List aList) { - MIValue[] values = list.getMIValues(); - for (int i = 0; i < values.length; i++) { - if (values[i] instanceof MIConst) { - String str = ((MIConst) values[i]).getCString(); - - /* this cannot filter nulls because index is critical in retreival - * and index is assigned in the layers above. The MI spec allows - * empty returns, for some register names. */ - if (str != null && str.length() > 0) { - realNameCount++; - aList.add(str); - } else { - aList.add(""); //$NON-NLS-1$ - } - } - } - } - - /** - * @return the number of non-null and non-empty names in the - * register list - */ - public int getNumRealNames() { - if (names == null) - parse(); - return realNameCount; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIDataListRegisterValuesInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIDataListRegisterValuesInfo.java deleted file mode 100644 index 619ca219fc3..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIDataListRegisterValuesInfo.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI data list register values extraction. - */ -public class MIDataListRegisterValuesInfo extends MIInfo { - - MIRegisterValue[] registers; - - public MIDataListRegisterValuesInfo(MIOutput rr) { - super(rr); - } - - public MIRegisterValue[] getMIRegisterValues() { - if (registers == null) { - parse(); - } - return registers; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("register-values")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MIList) { - registers = MIRegisterValue.getMIRegisterValues((MIList)value); - } - } - } - } - } - if (registers == null) { - registers = new MIRegisterValue[0]; - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIDataReadMemoryInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIDataReadMemoryInfo.java deleted file mode 100644 index bd224814edd..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIDataReadMemoryInfo.java +++ /dev/null @@ -1,154 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.output; - - - -/** - * GDB/MI data read memor info extraction. - */ -public class MIDataReadMemoryInfo extends MIInfo { - - String addr; - long nextRow; - long prevRow; - long nextPage; - long prevPage; - long numBytes; - long totalBytes; - MIMemory[] memories; - - - public MIDataReadMemoryInfo(MIOutput rr) { - super(rr); - parse(); - } - - public String getAddress() { - return addr; - } - - public long getNumberBytes() { - return numBytes; - } - - public long getTotalBytes() { - return totalBytes; - } - - public long getNextRow() { - return nextRow; - } - - public long getPreviousRow() { - return prevRow; - } - - public long getNextPage() { - return nextPage; - } - - public long getPreviousPage() { - return prevPage; - } - - public MIMemory[] getMemories() { - return memories; - } -/* - public String toString() { - MIMemory[] mem = getMemories(); - StringBuffer buffer = new StringBuffer(); - for (int i = 0; i < mem.length; i++) { - buffer.append(Long.toHexString(mem[i].getAddress())); - buffer.append(":"); - long[] data = mem[i].getData(); - for (int j = 0; j < data.length; j++) { - buffer.append(" ").append(Long.toHexString(data[j])); - } - buffer.append("\t").append(mem[i].getAscii()); - } - return buffer.toString(); - } -*/ - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; //$NON-NLS-1$ - if (value != null && value instanceof MIConst) { - str = ((MIConst)value).getCString(); - } - - if (var.equals("addr")) { //$NON-NLS-1$ - try { - addr = str.trim(); - } catch (NumberFormatException e) { - } - } else if (var.equals("nr-bytes")) { //$NON-NLS-1$ - try { - numBytes = Long.decode(str.trim()).longValue(); - } catch (NumberFormatException e) { - } - } else if (var.equals("total-bytes")) { //$NON-NLS-1$ - try { - totalBytes = Long.decode(str.trim()).longValue(); - } catch (NumberFormatException e) { - } - } else if (var.equals("next-row")) { //$NON-NLS-1$ - try { - nextRow = Long.decode(str.trim()).longValue(); - } catch (NumberFormatException e) { - } - } else if (var.equals("prev-row")) { //$NON-NLS-1$ - try { - prevRow = Long.decode(str.trim()).longValue(); - } catch (NumberFormatException e) { - } - } else if (var.equals("next-page")) { //$NON-NLS-1$ - try { - nextPage = Long.decode(str.trim()).longValue(); - } catch (NumberFormatException e) { - } - } else if (var.equals("prev-page")) { //$NON-NLS-1$ - try { - prevPage = Long.decode(str.trim()).longValue(); - } catch (NumberFormatException e) { - } - } else if (var.equals("memory")) { //$NON-NLS-1$ - if (value instanceof MIList) { - parseMemory((MIList)value); - } - } - } - } - } - if (memories == null) { - memories = new MIMemory[0]; - } - } - - void parseMemory(MIList list) { - MIValue[] values = list.getMIValues(); - memories = new MIMemory[values.length]; - for (int i = 0; i < values.length; i++) { - if (values[i] instanceof MITuple) { - memories[i] = new MIMemory((MITuple)values[i]); - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIEnvironmentPWDInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIEnvironmentPWDInfo.java deleted file mode 100644 index 6fd9bd04b6f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIEnvironmentPWDInfo.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.output; - - - - -/** - * GDB/MI environment PWD info extraction. - */ -public class MIEnvironmentPWDInfo extends MIInfo { - - String pwd = ""; //$NON-NLS-1$ - - public MIEnvironmentPWDInfo(MIOutput o) { - super(o); - parse(); - } - - public String getWorkingDirectory() { - return pwd; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIOOBRecord[] oobs = out.getMIOOBRecords(); - for (int i = 0; i < oobs.length; i++) { - if (oobs[i] instanceof MIConsoleStreamOutput) { - MIStreamRecord cons = (MIStreamRecord)oobs[i]; - String str = cons.getString(); - if (str.startsWith("Working directory")) { //$NON-NLS-1$ - int len = "Working directory".length(); //$NON-NLS-1$ - str = str.substring(len).trim(); - len = str.indexOf('.'); - if (len != -1) { - str = str.substring(0, len); - } - pwd = str; - } - } - } - } - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIExecAsyncOutput.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIExecAsyncOutput.java deleted file mode 100644 index 74fc3ccc4a7..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIExecAsyncOutput.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * @see MIAsyncRecord - */ -public class MIExecAsyncOutput extends MIAsyncRecord { -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIFrame.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIFrame.java deleted file mode 100644 index 8c50848e15f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIFrame.java +++ /dev/null @@ -1,134 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI Frame tuple parsing. - */ -public class MIFrame { - - int level; - String addr; - String func = ""; //$NON-NLS-1$ - String file = ""; //$NON-NLS-1$ - // since gdb 6.4 - String fullname = ""; //$NON-NLS-1$ - int line; - MIArg[] args = new MIArg[0]; - - public MIFrame(MITuple tuple) { - parse(tuple); - } - - public MIArg[] getArgs() { - return args; - } - - public String getFile() { - String fname = getFullname(); - return ( fname.length() != 0 ) ? fname : file; - } - - public String getFullname() { - return fullname; - } - - public String getFunction() { - return func; - } - - public int getLine() { - return line; - } - - public String getAddress() { - return addr; - } - - public int getLevel() { - return level; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("level=\"" + level + "\""); //$NON-NLS-1$//$NON-NLS-2$ - buffer.append(",addr=\"" + addr + "\""); //$NON-NLS-1$//$NON-NLS-2$ - buffer.append(",func=\"" + func + "\""); //$NON-NLS-1$//$NON-NLS-2$ - buffer.append(",file=\"" + file + "\""); //$NON-NLS-1$//$NON-NLS-2$ - buffer.append(",line=\"").append(line).append('"'); //$NON-NLS-1$ - buffer.append(",args=["); //$NON-NLS-1$ - for (int i = 0; i < args.length; i++) { - if (i != 0) { - buffer.append(','); - } - buffer.append("{name=\"" + args[i].getName() + "\"");//$NON-NLS-1$//$NON-NLS-2$ - buffer.append(",value=\"" + args[i].getValue() + "\"}");//$NON-NLS-1$//$NON-NLS-2$ - } - buffer.append(']'); - return buffer.toString(); - } - - void parse(MITuple tuple) { - MIResult[] results = tuple.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; //$NON-NLS-1$ - if (value != null && value instanceof MIConst) { - str = ((MIConst)value).getCString(); - } - - if (var.equals("level")) { //$NON-NLS-1$ - try { - level = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } else if (var.equals("addr")) { //$NON-NLS-1$ - try { - addr = str.trim(); - } catch (NumberFormatException e) { - } - } else if (var.equals("func")) { //$NON-NLS-1$ - func = null; - if ( str != null ) { - str = str.trim(); - if ( str.equals( "??" ) ) //$NON-NLS-1$ - func = ""; //$NON-NLS-1$ - else - { - // In some situations gdb returns the function names that include parameter types. - // To make the presentation consistent truncate the parameters. PR 46592 - int end = str.indexOf( '(' ); - if ( end != -1 ) - func = str.substring( 0, end ); - else - func = str; - } - } - } else if (var.equals("file")) { //$NON-NLS-1$ - file = str; - } else if (var.equals("fullname")) { //$NON-NLS-1$ - fullname = str; - } else if (var.equals("line")) { //$NON-NLS-1$ - try { - line = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } else if (var.equals("args")) { //$NON-NLS-1$ - if (value instanceof MIList) { - args = MIArg.getMIArgs((MIList)value); - } else if (value instanceof MITuple) { - args = MIArg.getMIArgs((MITuple)value); - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIGDBShowAddressSizeInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIGDBShowAddressSizeInfo.java deleted file mode 100644 index 46fd274c27b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIGDBShowAddressSizeInfo.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - initial API and implementation - *******************************************************************************/ -/* - * Created on Jun 7, 2004 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * @author root - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class MIGDBShowAddressSizeInfo extends MIGDBShowInfo { - - public MIGDBShowAddressSizeInfo(MIOutput o) { - super(o); - } - - public int getAddressSize() - { - return Integer.parseInt(getValue()); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIGDBShowDirectoriesInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIGDBShowDirectoriesInfo.java deleted file mode 100644 index 008aa4d3d26..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIGDBShowDirectoriesInfo.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.StringTokenizer; - - -/** - * GDB/MI show parsing. - * (gdb) - * -gdb-show directories - * ~"Source directories searched: /tmp:$cdir:$cwd\n" - * ^done - */ -public class MIGDBShowDirectoriesInfo extends MIInfo { - - String[] dirs = new String[0]; - - public MIGDBShowDirectoriesInfo(MIOutput o) { - super(o); - parse(); - } - - public String[] getDirectories() { - return dirs; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIOOBRecord[] oobs = out.getMIOOBRecords(); - for (int i = 0; i < oobs.length; i++) { - if (oobs[i] instanceof MIConsoleStreamOutput) { - MIStreamRecord cons = (MIStreamRecord)oobs[i]; - String str = cons.getString(); - if (str.startsWith("Source directories searched:")) { //$NON-NLS-1$ - int j = str.indexOf(':'); - if (j != -1) { - String sub = str.substring(j + 1).trim(); - parseDirectories(sub); - } - } - } - } - } - } - - void parseDirectories(String d) { - String sep = System.getProperty("path.separator", ":"); //$NON-NLS-1$ //$NON-NLS-2$ - StringTokenizer st = new StringTokenizer(d, sep); - int count = st.countTokens(); - dirs = new String[count]; - for (int i = 0; st.hasMoreTokens() && i < count; i++) { - dirs[i] = st.nextToken(); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIGDBShowEndianInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIGDBShowEndianInfo.java deleted file mode 100644 index 7fb986b7b3a..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIGDBShowEndianInfo.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.output; - -/** - * -gdb-show endian - * ~"The target endianness is set automatically (currently little endian)\n" - * ^done - * &"show endian\n" - * - */ -public class MIGDBShowEndianInfo extends MIInfo { - - boolean littleEndian; - - public MIGDBShowEndianInfo(MIOutput out) { - super(out); - parse(); - } - - public boolean isLittleEndian() { - return littleEndian; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIOOBRecord[] oobs = out.getMIOOBRecords(); - for (int i = 0; i < oobs.length; i++) { - if (oobs[i] instanceof MIConsoleStreamOutput) { - MIStreamRecord cons = (MIStreamRecord) oobs[i]; - String str = cons.getString(); - // We are interested in the stream info - parseLine(str); - } - } - } - } - - void parseLine(String str) { - if (str != null && str.length() > 0) { - littleEndian = (str.indexOf("little") != -1); //$NON-NLS-1$ - } - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIGDBShowExitCodeInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIGDBShowExitCodeInfo.java deleted file mode 100644 index 62416676589..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIGDBShowExitCodeInfo.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - - - - -/** - * GDB/MI show parsing. - * (gdb) - * -data-evaluate-expression $_exitcode - * ^done,value="10" - * (gdb) - */ -public class MIGDBShowExitCodeInfo extends MIDataEvaluateExpressionInfo { - - public MIGDBShowExitCodeInfo(MIOutput o) { - super(o); - } - - public int getCode() { - int code = 0; - String exp = getExpression(); - try { - code = Integer.parseInt(exp); - } catch (NumberFormatException e) { - } - return code; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIGDBShowInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIGDBShowInfo.java deleted file mode 100644 index e0ba76984ca..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIGDBShowInfo.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - - - - -/** - * GDB/MI show parsing. - */ -public class MIGDBShowInfo extends MIInfo { - - String value = ""; //$NON-NLS-1$ - - public MIGDBShowInfo(MIOutput o) { - super(o); - parse(); - } - - public String getValue() { - return value; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("value")) { //$NON-NLS-1$ - MIValue val = results[i].getMIValue(); - if (val instanceof MIConst) { - value = ((MIConst)val).getString(); - } - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIGDBShowSolibSearchPathInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIGDBShowSolibSearchPathInfo.java deleted file mode 100644 index d141e822ab8..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIGDBShowSolibSearchPathInfo.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.StringTokenizer; - - -/** - * GDB/MI show parsing. - * -gdb-show solib-search-path - * ^done,value="" - * (gdb) - * -gdb-set solib-search-path /tmp:/lib - * ^done - * (gdb) - * -gdb-show solib-search-path - * ^done,value="/tmp:/lib" - */ -public class MIGDBShowSolibSearchPathInfo extends MIGDBShowInfo { - - String[] dirs = null; - - public MIGDBShowSolibSearchPathInfo(MIOutput o) { - super(o); - } - - public String[] getDirectories() { - if (dirs == null) { - String val = getValue(); - parseDirectories(val); - } - return dirs; - } - - void parseDirectories(String d) { - String sep = System.getProperty("path.separator", ":"); //$NON-NLS-1$ //$NON-NLS-2$ - StringTokenizer st = new StringTokenizer(d, sep); - int count = st.countTokens(); - dirs = new String[count]; - for (int i = 0; st.hasMoreTokens() && i < count; i++) { - dirs[i] = st.nextToken(); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIInfo.java deleted file mode 100644 index 036fc473ea9..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIInfo.java +++ /dev/null @@ -1,85 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * Base class for teh parsing/info GDB/MI classes. - */ -public class MIInfo { - - MIOutput miOutput; - - public MIInfo(MIOutput record) { - miOutput = record; - } - - public MIOutput getMIOutput () { - return miOutput; - } - - public boolean isDone() { - return isResultClass(MIResultRecord.DONE); - } - - public boolean isRunning() { - return isResultClass(MIResultRecord.RUNNING); - } - - public boolean isConnected() { - return isResultClass(MIResultRecord.CONNECTED); - } - - public boolean isError() { - return isResultClass(MIResultRecord.ERROR); - } - - public boolean isExit() { - return isResultClass(MIResultRecord.EXIT); - } - - public String toString() { - if (miOutput != null) { - return miOutput.toString(); - } - return ""; //$NON-NLS-1$ - } - - boolean isResultClass(String rc) { - if (miOutput != null) { - MIResultRecord rr = miOutput.getMIResultRecord(); - if (rr != null) { - String clazz = rr.getResultClass(); - return clazz.equals(rc); - } - } - return false; - } - - public String getErrorMsg() { - if (miOutput != null) { - MIResultRecord rr = miOutput.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("msg")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - String s = ((MIConst)value).getCString(); - return s; - } - } - } - } - } - return ""; //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIList.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIList.java deleted file mode 100644 index 566e17131c7..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIList.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI list semantic. - */ -public class MIList extends MIValue { - - final static MIResult[] nullResults = new MIResult[0]; - final static MIValue[] nullValues = new MIValue[0]; - - MIResult[] results = nullResults; - MIValue[] values = nullValues; - - public MIResult[] getMIResults() { - return results; - } - - public void setMIResults(MIResult[] res) { - results = res; - } - - public MIValue[] getMIValues() { - return values; - } - - public void setMIValues(MIValue[] vals) { - values = vals; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append('['); - for (int i = 0; i < results.length; i++) { - if (i != 0) { - buffer.append(','); - } - buffer.append(results[i].toString()); - } - for (int i = 0; i < values.length; i++) { - if (i != 0) { - buffer.append(','); - } - buffer.append(values[i].toString()); - } - buffer.append(']'); - return buffer.toString(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MILogStreamOutput.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MILogStreamOutput.java deleted file mode 100644 index 0fd2c2adc38..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MILogStreamOutput.java +++ /dev/null @@ -1,18 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * @see MIStreamRecord - */ -public class MILogStreamOutput extends MIStreamRecord { - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIMemory.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIMemory.java deleted file mode 100644 index 55f03b76815..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIMemory.java +++ /dev/null @@ -1,107 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - -/** - * GDB/MI memory parsing. - */ -public class MIMemory { - String addr; - long [] data = new long[0]; - List badOffsets = new ArrayList(); - String ascii = ""; //$NON-NLS-1$ - - public MIMemory(MITuple tuple) { - parse(tuple); - } - - public String getAddress() { - return addr; - } - - public long [] getData() { - return data; - } - - public int[] getBadOffsets() { - int[] data = new int[badOffsets.size()]; - for (int i = 0; i < data.length; ++i) { - Integer o = (Integer)badOffsets.get(i); - data[i] = o.intValue(); - } - return data; - } - - public String getAscii() { - return ascii; - } - - public String toSting() { - StringBuffer buffer = new StringBuffer(); - buffer.append("addr=\"" + addr + "\""); //$NON-NLS-1$ //$NON-NLS-2$ - buffer.append("data=["); //$NON-NLS-1$ - for (int i = 0 ; i < data.length; i++) { - if (i != 0) { - buffer.append(','); - } - buffer.append('"').append(Long.toHexString(data[i])).append('"'); - } - buffer.append(']'); - if (ascii.length() > 0) { - buffer.append(",ascii=\"" + ascii + "\""); //$NON-NLS-1$ //$NON-NLS-2$ - } - return buffer.toString(); - } - - void parse(MITuple tuple) { - MIResult[] results = tuple.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; //$NON-NLS-1$ - if (value != null && value instanceof MIConst) { - str = ((MIConst)value).getCString(); - } - - if (var.equals("addr")) { //$NON-NLS-1$ - try { - addr = str.trim(); - } catch (NumberFormatException e) { - } - } else if (var.equals("data")) { //$NON-NLS-1$ - if (value != null && value instanceof MIList) { - parseData((MIList)value); - } - } else if (var.equals("ascii")) { //$NON-NLS-1$ - ascii = str; - } - } - } - - void parseData(MIList list) { - MIValue[] values = list.getMIValues(); - data = new long[values.length]; - for (int i = 0; i < values.length; i++) { - if (values[i] instanceof MIConst) { - String str = ((MIConst)values[i]).getCString(); - try { - data[i] = Long.decode(str.trim()).longValue(); - } catch (NumberFormatException e) { - badOffsets.add(new Integer(i)); - data[i] = 0; - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MINotifyAsyncOutput.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MINotifyAsyncOutput.java deleted file mode 100644 index 053e46ca2a1..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MINotifyAsyncOutput.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * @see MIAsyncRecord - */ -public class MINotifyAsyncOutput extends MIAsyncRecord { -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIOOBRecord.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIOOBRecord.java deleted file mode 100644 index 6fcea72ac31..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIOOBRecord.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * @see MIOOBRecord - */ -public abstract class MIOOBRecord { -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIOutput.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIOutput.java deleted file mode 100644 index c30ae6c6887..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIOutput.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI response. - */ -public class MIOutput { - - public static final MIOOBRecord[] nullOOBRecord = new MIOOBRecord[0]; - MIResultRecord rr = null; - MIOOBRecord[] oobs = nullOOBRecord; - - - public MIResultRecord getMIResultRecord() { - return rr; - } - - public void setMIResultRecord(MIResultRecord res) { - rr = res ; - } - - public MIOOBRecord[] getMIOOBRecords() { - return oobs; - } - - public void setMIOOBRecords(MIOOBRecord [] bands) { - oobs = bands; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - for (int i = 0; i < oobs.length; i++) { - buffer.append(oobs[i].toString()); - } - if (rr != null) { - buffer.append(rr.toString()); - } - return buffer.toString(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIParser.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIParser.java deleted file mode 100644 index dbb778bc151..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIParser.java +++ /dev/null @@ -1,564 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; -import java.util.StringTokenizer; - -/** -<pre> -`OUTPUT :' - `( OUT-OF-BAND-RECORD )* [ RESULT-RECORD ] "(gdb)" NL' - -`RESULT-RECORD :' - ` [ TOKEN ] "^" RESULT-CLASS ( "," RESULT )* NL' - -`OUT-OF-BAND-RECORD :' - `ASYNC-RECORD | STREAM-RECORD' - -`ASYNC-RECORD :' - `EXEC-ASYNC-OUTPUT | STATUS-ASYNC-OUTPUT | NOTIFY-ASYNC-OUTPUT' - -`EXEC-ASYNC-OUTPUT :' - `[ TOKEN ] "*" ASYNC-OUTPUT' - -`STATUS-ASYNC-OUTPUT :' - `[ TOKEN ] "+" ASYNC-OUTPUT' - -`NOTIFY-ASYNC-OUTPUT :' - `[ TOKEN ] "=" ASYNC-OUTPUT' - -`ASYNC-OUTPUT :' - `ASYNC-CLASS ( "," RESULT )* NL' - -`RESULT-CLASS :' - `"done" | "running" | "connected" | "error" | "exit"' - -`ASYNC-CLASS :' - `"stopped" | OTHERS' (where OTHERS will be added depending on the - needs--this is still in development). - -`RESULT :' - ` VARIABLE "=" VALUE' - -`VARIABLE :' - ` STRING ' - -`VALUE :' - ` CONST | TUPLE | LIST ' - -`CONST :' - `C-STRING' - -`TUPLE :' - ` "{}" | "{" RESULT ( "," RESULT )* "}" ' - -`LIST :' - ` "[]" | "[" VALUE ( "," VALUE )* "]" | "[" RESULT ( "," RESULT )* - "]" ' - -`STREAM-RECORD :' - `CONSOLE-STREAM-OUTPUT | TARGET-STREAM-OUTPUT | LOG-STREAM-OUTPUT' - -`CONSOLE-STREAM-OUTPUT :' - `"~" C-STRING' - -`TARGET-STREAM-OUTPUT :' - `"@" C-STRING' - -`LOG-STREAM-OUTPUT :' - `"&" C-STRING' - -`NL :' - `CR | CR-LF' - -`TOKEN :' - _any sequence of digits_. - -`C-STRING :' - `""" SEVEN-BIT-ISO-C-STRING-CONTENT """' -</pre> - */ -public class MIParser { - - public String primaryPrompt = "(gdb)"; //$NON-NLS-1$ - public String cliPrompt = primaryPrompt; - public String secondaryPrompt = ">"; //$NON-NLS-1$ - - /** - * Point of entry to create an AST for MI. - * - * @param buffer Output from MI Channel. - * @return MIOutput - * @see MIOutput - */ - public MIOutput parse(String buffer) { - MIOutput mi = new MIOutput(); - MIResultRecord rr = null; - List oobs = new ArrayList(1); - int id = -1; - - StringTokenizer st = new StringTokenizer(buffer, "\n"); //$NON-NLS-1$ - while (st.hasMoreTokens()) { - StringBuffer token = new StringBuffer(st.nextToken()); - - // Fetch the Token/Id - if (token.length() > 0 && Character.isDigit(token.charAt(0))) { - int i = 1; - while (i < token.length() && Character.isDigit(token.charAt(i))) { - i++; - } - String numbers = token.substring(0, i); - try { - id = Integer.parseInt(numbers); - } catch (NumberFormatException e) { - } - // Consume the token. - token.delete(0, i); - } - - // ResultRecord ||| Out-Of-Band Records - if (token.length() > 0) { - if (token.charAt(0) == '^') { - token.deleteCharAt(0); - rr = processMIResultRecord(token, id); - } else if (startsWith(token, primaryPrompt)) { - //break; // Do nothing. - } else { - MIOOBRecord band = processMIOOBRecord(token, id); - if (band != null) { - oobs.add(band); - } - } - } - } - MIOOBRecord[] bands = (MIOOBRecord[]) oobs.toArray(new MIOOBRecord[oobs.size()]); - mi.setMIOOBRecords(bands); - mi.setMIResultRecord(rr); - return mi; - } - - /** - * Assuming '^' was deleted from the Result Record. - */ - private MIResultRecord processMIResultRecord(StringBuffer buffer, int id) { - MIResultRecord rr = new MIResultRecord(); - rr.setToken(id); - if (buffer.toString().startsWith(MIResultRecord.DONE)) { - rr.setResultClass(MIResultRecord.DONE); - buffer.delete(0, MIResultRecord.DONE.length()); - } else if (buffer.toString().startsWith(MIResultRecord.ERROR)) { - rr.setResultClass(MIResultRecord.ERROR); - buffer.delete(0, MIResultRecord.ERROR.length()); - } else if (buffer.toString().startsWith(MIResultRecord.EXIT)) { - rr.setResultClass(MIResultRecord.EXIT); - buffer.delete(0, MIResultRecord.EXIT.length()); - } else if (buffer.toString().startsWith(MIResultRecord.RUNNING)) { - rr.setResultClass(MIResultRecord.RUNNING); - buffer.delete(0, MIResultRecord.RUNNING.length()); - } else if (buffer.toString().startsWith(MIResultRecord.CONNECTED)) { - rr.setResultClass(MIResultRecord.CONNECTED); - buffer.delete(0, MIResultRecord.CONNECTED.length()); - } else { - // FIXME: - // Error throw an exception? - } - - // Results are separated by commas. - if (buffer.length() > 0 && buffer.charAt(0) == ',') { - buffer.deleteCharAt(0); - MIResult[] res = processMIResults(new FSB(buffer)); - rr.setMIResults(res); - } - return rr; - } - - /** - * Find OutOfBand Records depending on the starting token. - */ - private MIOOBRecord processMIOOBRecord(StringBuffer buffer, int id) { - MIOOBRecord oob = null; - char c = buffer.charAt(0); - if (c == '*' || c == '+' || c == '=') { - // Consume the first char - buffer.deleteCharAt(0); - MIAsyncRecord async = null; - switch (c) { - case '*' : - async = new MIExecAsyncOutput(); - break; - - case '+' : - async = new MIStatusAsyncOutput(); - break; - - case '=' : - async = new MINotifyAsyncOutput(); - break; - } - async.setToken(id); - // Extract the Async-Class - int i = buffer.toString().indexOf(','); - if (i != -1) { - String asyncClass = buffer.substring(0, i); - async.setAsyncClass(asyncClass); - // Consume the async-class and the comma - buffer.delete(0, i + 1); - } else { - async.setAsyncClass(buffer.toString().trim()); - buffer.setLength(0); - } - MIResult[] res = processMIResults(new FSB(buffer)); - async.setMIResults(res); - oob = async; - } else if (c == '~' || c == '@' || c == '&') { - // Consume the first char - buffer.deleteCharAt(0); - MIStreamRecord stream = null; - switch (c) { - case '~' : - stream = new MIConsoleStreamOutput(); - break; - - case '@' : - stream = new MITargetStreamOutput(); - break; - - case '&' : - stream = new MILogStreamOutput(); - break; - } - // translateCString() assumes that the leading " is deleted - if (buffer.length() > 0 && buffer.charAt(0) == '"') { - buffer.deleteCharAt(0); - } - stream.setCString(translateCString(new FSB(buffer))); - oob = stream; - } else { - // Badly format MI line, just pass it to the user as target stream - MIStreamRecord stream = new MITargetStreamOutput(); - stream.setCString(buffer.toString() + "\n"); //$NON-NLS-1$ - oob = stream; - } - return oob; - } - - /** - * Assuming that the usual leading comma was consumed. - * Extract the MI Result comma seperated responses. - */ - private MIResult[] processMIResults(FSB buffer) { - List aList = new ArrayList(); - MIResult result = processMIResult(buffer); - if (result != null) { - aList.add(result); - } - while (buffer.length() > 0 && buffer.charAt(0) == ',') { - buffer.deleteCharAt(0); - result = processMIResult(buffer); - if (result != null) { - aList.add(result); - } - } - return (MIResult[]) aList.toArray(new MIResult[aList.size()]); - } - - /** - * Construct the MIResult. Characters will be consume/delete - * moving forward constructing the AST. - */ - private MIResult processMIResult(FSB buffer) { - MIResult result = new MIResult(); - int equal; - if (buffer.length() > 0 && Character.isLetter(buffer.charAt(0)) && (equal = buffer.indexOf('=')) != -1) { - String variable = buffer.substring(0, equal); - result.setVariable(variable); - buffer.delete(0, equal + 1); - MIValue value = processMIValue(buffer); - result.setMIValue(value); - } else if(buffer.length()>0 && buffer.charAt(0)=='"') { - // This an error but we just swallow it and move on. - MIValue value = processMIValue(buffer); - result.setMIValue(value); - } else { - result.setVariable(buffer.toString()); - result.setMIValue(new MIConst()); // Empty string:??? - buffer.setLength(0); - } - return result; - } - - /** - * Find a MIValue implementation or return null. - */ - private MIValue processMIValue(FSB buffer) { - MIValue value = null; - if (buffer.length() > 0) { - if (buffer.charAt(0) == '{') { - buffer.deleteCharAt(0); - value = processMITuple(buffer); - } else if (buffer.charAt(0) == '[') { - buffer.deleteCharAt(0); - value = processMIList(buffer); - } else if (buffer.charAt(0) == '"') { - buffer.deleteCharAt(0); - MIConst cnst = new MIConst(); - cnst.setCString(translateCString(buffer)); - value = cnst; - } - } - return value; - } - - /** - * Assuming the starting '{' was deleted form the StringBuffer, - * go to the closing '}' consuming/deleting all the characters. - * This is usually call by processMIvalue(); - */ - private MIValue processMITuple(FSB buffer) { - MITuple tuple = new MITuple(); - List valueList = new ArrayList(); - List resultList = new ArrayList(); - // Catch closing '}' - while (buffer.length() > 0 && buffer.charAt(0) != '}') { - // Try for the MIValue first - MIValue value = processMIValue(buffer); - if (value != null) { - valueList.add(value); - } else { - MIResult result = processMIResult(buffer); - if (result != null) { - resultList.add(result); - } - } - if (buffer.length() > 0 && buffer.charAt(0) == ',') { - buffer.deleteCharAt(0); - } - } - if (buffer.length() > 0 && buffer.charAt(0) == '}') { - buffer.deleteCharAt(0); - } - MIValue[] values = (MIValue[]) valueList.toArray(new MIValue[valueList.size()]); - MIResult[] res = (MIResult[]) resultList.toArray(new MIResult[resultList.size()]); - tuple.setMIValues(values); - tuple.setMIResults(res); - return tuple; - } - - /** - * Assuming the leading '[' was deleted, find the closing - * ']' consuming/delete chars from the StringBuffer. - */ - private MIValue processMIList(FSB buffer) { - MIList list = new MIList(); - List valueList = new ArrayList(); - List resultList = new ArrayList(); - // catch closing ']' - while (buffer.length() > 0 && buffer.charAt(0) != ']') { - // Try for the MIValue first - MIValue value = processMIValue(buffer); - if (value != null) { - valueList.add(value); - } else { - MIResult result = processMIResult(buffer); - if (result != null) { - resultList.add(result); - } - } - if (buffer.length() > 0 && buffer.charAt(0) == ',') { - buffer.deleteCharAt(0); - } - } - if (buffer.length() > 0 && buffer.charAt(0) == ']') { - buffer.deleteCharAt(0); - } - MIValue[] values = (MIValue[]) valueList.toArray(new MIValue[valueList.size()]); - MIResult[] res = (MIResult[]) resultList.toArray(new MIResult[resultList.size()]); - list.setMIValues(values); - list.setMIResults(res); - return list; - } - - /* - * MI C-String rather MICOnst values are enclose in double quotes - * and any double quotes or backslash in the string are escaped. - * Assuming the starting double quote was removed. - * This method will stop at the closing double quote remove the extra - * backslach escaping and return the string __without__ the enclosing double quotes - * The orignal StringBuffer will move forward. - */ - private String translateCString(FSB buffer) { - boolean escape = false; - boolean closingQuotes = false; - - StringBuffer sb = new StringBuffer(); - - int index = 0; - for (; index < buffer.length() && !closingQuotes; index++) { - char c = buffer.charAt(index); - if (c == '\\') { - if (escape) { - sb.append(c); - escape = false; - } else { - escape = true; - } - } else if (c == '"') { - if (escape) { - sb.append(c); - escape = false; - } else { - // Bail out. - closingQuotes = true; - } - } else { - if (escape) { - sb.append('\\'); - } - sb.append(c); - escape = false; - } - } - buffer.delete(0, index); - return sb.toString(); - } - - /** - * Tests if this string starts with the specified prefix beginning - * a specified index. - * - * @param value the string. - * @param prefix the prefix. - * @return <code>true</code> if prefix starts value. - */ - public boolean startsWith(StringBuffer value, String prefix) { - int vlen = value.length(); - int plen = prefix.length(); - - if (vlen < plen) { - return false; - } - for (int i = 0; i < plen; i++) { - if (value.charAt(i) != prefix.charAt(i)) { - return false; - } - } - return true; - } - - /** - * Fast String Buffer class. MIParser does a lot - * of deleting off the front of a string, that's clearly - * an order N operation for StringBuffer which makes - * the MIParser an order N^2 operation. There are "issues" - * with this for large arrays. Use of FSB rather than String - * Buffer makes MIParser N rather than N^2 because FSB can - * delete from the front in constant time. - */ - public class FSB { - StringBuffer buf; - int pos; - boolean shared; - - public FSB(StringBuffer buf) { - this.buf = buf; - pos = 0; - shared = false; - } - - public FSB(FSB fbuf) { - pos = fbuf.pos; - buf = fbuf.buf; - shared = true; - } - - public int length() { - int res = buf.length() - pos; - if (res < 0) - return 0; - - return res; - } - - public char charAt(int index) { - return buf.charAt(index + pos); - } - - private void resolveCopy() { - if (shared) { - buf = new StringBuffer(buf.toString()); - shared = false; - } - } - - public FSB deleteCharAt(int index) { - if (index == 0) { - pos++; - } else { - resolveCopy(); - buf = buf.deleteCharAt(pos + index); - } - - return this; - } - - public FSB delete(int start, int end) { - if (start == 0) { - pos = pos + end - start; - } else { - resolveCopy(); - buf.delete(start + pos, end + pos); - } - - return this; - } - - public void setLength(int a) { - if (a == 0) - pos = buf.length(); - else { - // panic! fortunately we don't do this. - } - } - - public String substring(int start, int end) { - return buf.substring(start + pos, end + pos); - } - - public String toString() { - return buf.substring(pos, buf.length()); - } - - int indexOf(char c) { - int len = buf.length(); - for (int i = pos; i < len; i++) { - if (buf.charAt(i) == c) - return i - pos; - } - - return -1; - } - - boolean startsWith(String s) { - int len = Math.min(s.length(), length()); - if (len < s.length()) - return false; - - for (int i = 0; i < len; i++) { - if (s.charAt(i) != buf.charAt(pos + i)) - return false; - } - - return true; - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIRegisterValue.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIRegisterValue.java deleted file mode 100644 index c29f548f6c4..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIRegisterValue.java +++ /dev/null @@ -1,97 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - - - -/** - * GDB/MI register response parsing. - */ -public class MIRegisterValue { - int number; - String value; - - public MIRegisterValue(int n, String v) { - number = n; - value = v; - } - - public int getNumber() { - return number; - } - - public String getValue() { - return value; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("number=\"").append(number).append('"'); //$NON-NLS-1$ - buffer.append(',').append("value=\"" + value + "\""); //$NON-NLS-1$ //$NON-NLS-2$ - return buffer.toString(); - } - - /** - * Parsing a MIList of the form: - * [{number="1",value="0xffff"},{number="xxx",value="yyy"},..] - */ - public static MIRegisterValue[] getMIRegisterValues(MIList miList) { - List aList = new ArrayList(); - MIValue[] values = miList.getMIValues(); - for (int i = 0; i < values.length; i++) { - if (values[i] instanceof MITuple) { - MIRegisterValue reg = getMIRegisterValue((MITuple)values[i]); - if (reg != null) { - aList.add(reg); - } - } - } - return ((MIRegisterValue[])aList.toArray(new MIRegisterValue[aList.size()])); - } - - /** - * Parsing a MITuple of the form: - * {number="xxx",value="yyy"} - */ - public static MIRegisterValue getMIRegisterValue(MITuple tuple) { - MIResult[] args = tuple.getMIResults(); - MIRegisterValue arg = null; - if (args.length == 2) { - // Name - String aName = ""; //$NON-NLS-1$ - MIValue value = args[0].getMIValue(); - if (value != null && value instanceof MIConst) { - aName = ((MIConst)value).getCString(); - } else { - aName = ""; //$NON-NLS-1$ - } - - // Value - String aValue = ""; //$NON-NLS-1$ - value = args[1].getMIValue(); - if (value != null && value instanceof MIConst) { - aValue = ((MIConst)value).getCString(); - } else { - aValue = ""; //$NON-NLS-1$ - } - - try { - int reg = Integer.parseInt(aName.trim()); - arg = new MIRegisterValue(reg, aValue.trim()); - } catch (NumberFormatException e) { - } - } - return arg; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIResult.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIResult.java deleted file mode 100644 index 3e3fd974713..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIResult.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI result sematic (Variable=Value) - */ -public class MIResult { - String variable = ""; //$NON-NLS-1$ - MIValue value = null; - - public String getVariable() { - return variable; - } - - public void setVariable(String var) { - variable = var; - } - - public MIValue getMIValue() { - return value; - } - - public void setMIValue(MIValue val) { - value = val; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append(variable); - if (value != null) { - String v = value.toString(); - buffer.append('='); - if (v.charAt(0) == '[' || v.charAt(0) =='{') { - buffer.append(v); - } else { - buffer.append("\"" + value.toString() + "\""); //$NON-NLS-1$ //$NON-NLS-2$ - } - } - return buffer.toString(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIResultRecord.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIResultRecord.java deleted file mode 100644 index 9619f886908..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIResultRecord.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI ResultRecord. - */ -public class MIResultRecord { - - public final static String DONE ="done"; //$NON-NLS-1$ - public final static String RUNNING ="running"; //$NON-NLS-1$ - public final static String CONNECTED ="connected"; //$NON-NLS-1$ - public final static String ERROR ="error"; //$NON-NLS-1$ - public final static String EXIT ="exit"; //$NON-NLS-1$ - - static final MIResult[] nullResults = new MIResult[0]; - MIResult[] results = nullResults; - String resultClass = ""; //$NON-NLS-1$ - int token = -1; - - public int getToken() { - return token; - } - - public void setToken(int t) { - token = t; - } - - /** - */ - public String getResultClass() { - return resultClass; - } - - public void setResultClass(String type) { - resultClass = type; - } - - public MIResult[] getMIResults() { - return results; - } - - public void setMIResults(MIResult[] res) { - results = res; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append(token).append('^').append(resultClass); - for (int i = 0; i < results.length; i++) { - buffer.append(',').append(results[i].toString()); - } - return buffer.toString(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIShared.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIShared.java deleted file mode 100644 index 868d566e388..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIShared.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - - -/** - * GDB/MI shared information - */ -public class MIShared { - - String from; - String to; - boolean isread; - String name; - - public MIShared (String start, String end, boolean read, String location) { - from = start; - to = end; - isread = read; - name = location; - } - - public String getFrom() { - return from; - } - - public String getTo() { - return to; - } - - public boolean isRead() { - return isread; - } - - public String getName() { - return name; - } - - public void setSymbolsRead(boolean read) { - isread = read; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MISigHandle.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MISigHandle.java deleted file mode 100644 index ad0864481d0..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MISigHandle.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - - -/** - * GDB/MI shared information - */ -public class MISigHandle { - - String signal = ""; //$NON-NLS-1$ - boolean stop; - boolean print; - boolean pass; - String description = ""; //$NON-NLS-1$ - - public MISigHandle (String name, boolean stp, boolean prnt, boolean ps, String desc) { - signal = name; - stop = stp; - print = prnt; - pass = ps; - description = desc; - } - - public String getName() { - return signal; - } - - public boolean isStop() { - return stop; - } - - public boolean isPrint() { - return print; - } - - public boolean isPass() { - return pass; - } - - public void handle(boolean isIgnore, boolean isStop) { - pass = !isIgnore; - stop = isStop; - } - - public String getDescription() { - return description; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MISrcAsm.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MISrcAsm.java deleted file mode 100644 index 37bb5e2b68b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MISrcAsm.java +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - -/** - * Represent a GDB Tuple MI assembly response. - */ -public class MISrcAsm { - int line; - String file = ""; //$NON-NLS-1$ - MIAsm[] asm; - - public MISrcAsm(MITuple tuple) { - parse(tuple); - } - - public int getLine() { - return line; - } - - public String getFile() { - return file; - } - - public MIAsm[] getMIAsms() { - return asm; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("src_and_asm_line={"); //$NON-NLS-1$ - buffer.append("line=\"").append(line).append('"'); //$NON-NLS-1$ - buffer.append(",file=\"" + file + "\","); //$NON-NLS-1$ //$NON-NLS-2$ - buffer.append("line_asm_insn=["); //$NON-NLS-1$ - for (int i = 0; i < asm.length; i++) { - if (i != 0) { - buffer.append(','); - } - buffer.append(asm[i].toString()); - } - buffer.append(']'); - buffer.append('}'); - return buffer.toString(); - } - - void parse(MITuple tuple) { - List aList = new ArrayList(); - MIResult[] results = tuple.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; //$NON-NLS-1$ - - if (value != null && value instanceof MIConst) { - str = ((MIConst)value).getCString(); - } - - if (var.equals("line_asm_insn")) { //$NON-NLS-1$ - if (value instanceof MIList) { - MIList list = (MIList)value; - MIValue[] values = list.getMIValues(); - for (int j = 0; j < values.length; j++) { - if (values[j] instanceof MITuple) { - aList.add(new MIAsm((MITuple)values[j])); - } - } - } - } if (var.equals("line")) { //$NON-NLS-1$ - try { - line = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } else if (var.equals("file")) { //$NON-NLS-1$ - file = str; - } - } - asm = (MIAsm[])aList.toArray(new MIAsm[aList.size()]); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIStackInfoDepthInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIStackInfoDepthInfo.java deleted file mode 100644 index b5581a5585b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIStackInfoDepthInfo.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI stack info depth parsing. - */ -public class MIStackInfoDepthInfo extends MIInfo { - - int depth; - - public MIStackInfoDepthInfo(MIOutput out) { - super(out); - parse(); - } - - public int getDepth() { - return depth; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("depth")) { //$NON-NLS-1$ - MIValue val = results[i].getMIValue(); - if (val instanceof MIConst) { - String str = ((MIConst)val).getCString(); - try { - depth = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIStackListArgumentsInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIStackListArgumentsInfo.java deleted file mode 100644 index c4aaaf7f68c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIStackListArgumentsInfo.java +++ /dev/null @@ -1,83 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - - -/** - * GDB/MI stack list arguments parsing. - */ -public class MIStackListArgumentsInfo extends MIInfo { - - MIFrame[] frames; - - public MIStackListArgumentsInfo(MIOutput out) { - super(out); - } - - public MIFrame[] getMIFrames() { - if (frames == null) { - parse(); - } - return frames; - } - - void parse() { - List aList = new ArrayList(1); - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("stack-args")) { //$NON-NLS-1$ - MIValue val = results[i].getMIValue(); - if (val instanceof MIList) { - parseStack((MIList)val, aList); - } else if (val instanceof MITuple) { - parseStack((MITuple)val, aList); - } - } - } - } - } - frames = (MIFrame[])aList.toArray(new MIFrame[aList.size()]); - } - - void parseStack(MIList miList, List aList) { - MIResult[] results = miList.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("frame")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MITuple) { - aList.add (new MIFrame((MITuple)value)); - } - } - } - } - void parseStack(MITuple miTuple, List aList) { - MIResult[] results = miTuple.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("frame")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MITuple) { - aList.add (new MIFrame((MITuple)value)); - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIStackListFramesInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIStackListFramesInfo.java deleted file mode 100644 index 88aa6a6d73c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIStackListFramesInfo.java +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - - -/** - * GDB/MI stack list frames info. - */ -public class MIStackListFramesInfo extends MIInfo { - - MIFrame[] frames; - - public MIStackListFramesInfo(MIOutput out) { - super(out); - } - - public MIFrame[] getMIFrames() { - if (frames == null) { - parse(); - } - return frames; - } - - void parse() { - List aList = new ArrayList(1); - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("stack")) { //$NON-NLS-1$ - MIValue val = results[i].getMIValue(); - if (val instanceof MIList) { - parseStack((MIList)val, aList); - } else if (val instanceof MITuple) { - parseStack((MITuple)val, aList); - } - } - } - } - } - frames = (MIFrame[])aList.toArray(new MIFrame[aList.size()]); - } - - void parseStack(MIList miList, List aList) { - MIResult[] results = miList.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("frame")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MITuple) { - aList.add (new MIFrame((MITuple)value)); - } - } - } - } - - // Old gdb use tuple instead of a list. - void parseStack(MITuple tuple, List aList) { - MIResult[] results = tuple.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("frame")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MITuple) { - aList.add (new MIFrame((MITuple)value)); - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIStackListLocalsInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIStackListLocalsInfo.java deleted file mode 100644 index c8e2ba8d630..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIStackListLocalsInfo.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.output; - - - -/** - * GDB/MI stack list locals parsing. - * -stack-list-locals 1 - * ^done,locals=[{name="p",value="0x8048600 \"ghislaine\""},{name="buf",value="\"'\", 'x' <repeats 24 times>, \"i,xxxxxxxxx\", 'a' <repeats 24 times>"},{name="buf2",value="\"\\\"?'\\\\()~\""},{name="buf3",value="\"alain\""},{name="buf4",value="\"\\t\\t\\n\\f\\r\""},{name="i",value="0"}] - * - * On MacOS X 10.4 this returns a tuple: - * ^done,locals={{name="p",value="0x8048600 \"ghislaine\""},{name="buf",value="\"'\", 'x' <repeats 24 times>, \"i,xxxxxxxxx\", 'a' <repeats 24 times>"},{name="buf2",value="\"\\\"?'\\\\()~\""},{name="buf3",value="\"alain\""},{name="buf4",value="\"\\t\\t\\n\\f\\r\""},{name="i",value="0"}} - */ -public class MIStackListLocalsInfo extends MIInfo { - - MIArg[] locals; - - public MIStackListLocalsInfo(MIOutput out) { - super(out); - parse(); - } - - public MIArg[] getLocals() { - if (locals == null) { - parse(); - } - return locals; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("locals")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MIList) { - locals = MIArg.getMIArgs((MIList)value); - } else if (value instanceof MITuple) { - locals = MIArg.getMIArgs((MITuple)value); - } - } - } - } - } - if (locals == null) { - locals = new MIArg[0]; - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIStatusAsyncOutput.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIStatusAsyncOutput.java deleted file mode 100644 index 8d7b3286c12..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIStatusAsyncOutput.java +++ /dev/null @@ -1,18 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * @see MIAsyncRecord - */ -public class MIStatusAsyncOutput extends MIAsyncRecord { - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIStreamRecord.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIStreamRecord.java deleted file mode 100644 index 2c8983fb454..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIStreamRecord.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI stream record response. - */ -public abstract class MIStreamRecord extends MIOOBRecord { - - String cstring = ""; //$NON-NLS-1$ - - public String getCString() { - return cstring; - } - - public void setCString(String str) { - cstring = str; - } - - public String getString () { - return MIConst.getString(getCString()); - } - - public String toString() { - if (this instanceof MIConsoleStreamOutput) { - return "~\"" + cstring + "\"\n"; //$NON-NLS-1$ //$NON-NLS-2$ - } else if (this instanceof MITargetStreamOutput) { - return "@\"" + cstring + "\"\n"; //$NON-NLS-1$ //$NON-NLS-2$ - } else if (this instanceof MILogStreamOutput) { - return "&\"" + cstring + "\"\n"; //$NON-NLS-1$ //$NON-NLS-2$ - } - return "\"" + cstring + "\"\n"; //$NON-NLS-1$ //$NON-NLS-2$ - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MITargetStreamOutput.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MITargetStreamOutput.java deleted file mode 100644 index 59fe4839f33..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MITargetStreamOutput.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * @see MIStreamRecord - */ -public class MITargetStreamOutput extends MIStreamRecord { - - public static final String startTag = "@"; //$NON-NLS-1$ -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIThreadListIdsInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIThreadListIdsInfo.java deleted file mode 100644 index d8e47cd9807..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIThreadListIdsInfo.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI thread list parsing. - */ -public class MIThreadListIdsInfo extends MIInfo { - - int[] threadIds; - - public MIThreadListIdsInfo(MIOutput out) { - super(out); - } - - public int[] getThreadIds() { - if (threadIds == null) { - parse(); - } - return threadIds; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("thread-ids")) { //$NON-NLS-1$ - MIValue val = results[i].getMIValue(); - if (val instanceof MITuple) { - parseThreadIds((MITuple)val); - } - } - } - } - } - if (threadIds == null) { - threadIds = new int[0]; - } - } - - void parseThreadIds(MITuple tuple) { - MIResult[] results = tuple.getMIResults(); - threadIds = new int[results.length]; - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("thread-id")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - String str = ((MIConst)value).getCString(); - try { - threadIds[i] = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIThreadSelectInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIThreadSelectInfo.java deleted file mode 100644 index c0b817d2807..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIThreadSelectInfo.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI thread select parsing. - */ -public class MIThreadSelectInfo extends MIInfo { - - int threadId; - MIFrame frame; - - public MIThreadSelectInfo(MIOutput out) { - super(out); - parse(); - } - - public int getNewThreadId() { - return threadId; - } - - public MIFrame getFrame() { - return frame; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("new-thread-id")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - String str = ((MIConst)value).getCString(); - try { - threadId = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } - } else if (var.equals("frame")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MITuple) { - frame = new MIFrame((MITuple)value); - } - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MITuple.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MITuple.java deleted file mode 100644 index e3b324decad..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MITuple.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI tuple value. - */ -public class MITuple extends MIValue { - - final static MIResult[] nullResults = new MIResult[0]; - final static MIValue[] nullValues = new MIValue[0]; - MIResult[] results = nullResults; - MIValue[] values = nullValues; - - public MIResult[] getMIResults() { - return results; - } - - public void setMIResults(MIResult[] res) { - results = res; - } - - public MIValue[] getMIValues() { - return values; - } - - public void setMIValues(MIValue[] vals) { - values = vals; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append('{'); - for (int i = 0; i < results.length; i++) { - if (i != 0) { - buffer.append(','); - } - buffer.append(results[i].toString()); - } - for (int i = 0; i < values.length; i++) { - if (i != 0) { - buffer.append(','); - } - buffer.append(values[i].toString()); - } - buffer.append('}'); - return buffer.toString(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIValue.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIValue.java deleted file mode 100644 index d89c7b0b36f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIValue.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI value. - */ -public abstract class MIValue { -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVar.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVar.java deleted file mode 100644 index ba3323fcaca..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVar.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI var-list-children - * -var-list-children var2 - * ^done,numchild="6",children={child={name="var2.0",exp="0",numchild="0",type="char"},child={name="var2.1",exp="1",numchild="0",type="char"},child={name="var2.2",exp="2",numchild="0",type="char"},child={name="var2.3",exp="3",numchild="0",type="char"},child={name="var2.4",exp="4",numchild="0",type="char"},child={name="var2.5",exp="5",numchild="0",type="char"}} - * - */ -public class MIVar { - - String name = ""; //$NON-NLS-1$ - String type = ""; //$NON-NLS-1$ - String exp = ""; //$NON-NLS-1$ - int numchild; - - - public MIVar(String n, int num, String t) { - name = n; - numchild = num; - type = t; - } - - public MIVar(MITuple tuple) { - parse(tuple); - } - - public String getVarName() { - return name; - } - - public String getType() { - return type; - } - - public int getNumChild() { - return numchild; - } - - public String getExp() { - return exp; - } - - void parse(MITuple tuple) { - MIResult[] results = tuple.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; //$NON-NLS-1$ - if (value != null && value instanceof MIConst) { - str = ((MIConst)value).getCString(); - } - - if (var.equals("numchild")) { //$NON-NLS-1$ - try { - numchild = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } else if (var.equals("name")) { //$NON-NLS-1$ - name = str; - } else if (var.equals("type")) { //$NON-NLS-1$ - type = str; - } else if (var.equals("exp")) { //$NON-NLS-1$ - exp = str; - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarChange.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarChange.java deleted file mode 100644 index 1eb5b4926df..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarChange.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI var-update. - */ - -public class MIVarChange { - String name; - boolean inScope; - boolean changed; - - public MIVarChange(String n) { - name = n; - } - - public String getVarName() { - return name; - } - - public boolean isInScope() { - return inScope; - } - - public boolean isChanged() { - return changed; - } - - public void setInScope(boolean b) { - inScope = b; - } - - public void setChanged(boolean c) { - changed = c; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarCreateInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarCreateInfo.java deleted file mode 100644 index bf00512ba82..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarCreateInfo.java +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - - -/** - * GDB/MI var-create. - * -var-create "-" * buf3 - * ^done,name="var1",numchild="6",type="char [6]" - */ -public class MIVarCreateInfo extends MIInfo { - - String name = ""; //$NON-NLS-1$ - int numChild; - String type = ""; //$NON-NLS-1$ - MIVar child; - - public MIVarCreateInfo(MIOutput record) { - super(record); - parse(); - } - - public MIVar getMIVar() { - if (child == null) { - child = new MIVar(name, numChild, type); - } - return child; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; //$NON-NLS-1$ - if (value instanceof MIConst) { - str = ((MIConst)value).getString(); - } - - if (var.equals("name")) { //$NON-NLS-1$ - name = str; - } else if (var.equals("numchild")) { //$NON-NLS-1$ - try { - numChild = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } else if (var.equals("type")) { //$NON-NLS-1$ - type = str; - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarDeleteInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarDeleteInfo.java deleted file mode 100644 index 5e20244a74d..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarDeleteInfo.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - - -/** - * GDB/MI var-delete. - */ -public class MIVarDeleteInfo extends MIInfo { - - int ndeleted; - - public MIVarDeleteInfo(MIOutput record) { - super(record); - parse(); - } - - public int getNumberDeleted () { - return ndeleted; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("ndeleted")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - String str = ((MIConst)value).getString(); - try { - ndeleted = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarEvaluateExpressionInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarEvaluateExpressionInfo.java deleted file mode 100644 index 8031aafb530..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarEvaluateExpressionInfo.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI var-evalute-expression - */ -public class MIVarEvaluateExpressionInfo extends MIInfo { - - String value = ""; //$NON-NLS-1$ - - public MIVarEvaluateExpressionInfo(MIOutput record) { - super(record); - parse(); - } - - public String getValue () { - return value; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("value")) { //$NON-NLS-1$ - MIValue val = results[i].getMIValue(); - if (val instanceof MIConst) { - value = ((MIConst)val).getCString(); - } - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarInfoExpressionInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarInfoExpressionInfo.java deleted file mode 100644 index 37631620c48..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarInfoExpressionInfo.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI var-info-expression. - */ -public class MIVarInfoExpressionInfo extends MIInfo { - - String lang = ""; //$NON-NLS-1$ - String exp = ""; //$NON-NLS-1$ - - public MIVarInfoExpressionInfo(MIOutput record) { - super(record); - parse(); - } - - public String getLanguage () { - return lang; - } - - public String getExpression() { - return exp; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; //$NON-NLS-1$ - if (value instanceof MIConst) { - str = ((MIConst)value).getString(); - } - - if (var.equals("lang")) { //$NON-NLS-1$ - lang = str; - } else if (var.equals("exp")) { //$NON-NLS-1$ - exp = str; - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarInfoNumChildrenInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarInfoNumChildrenInfo.java deleted file mode 100644 index 7200cfe4f39..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarInfoNumChildrenInfo.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.output; - - -/** - * GDB/MI var-info-num-children. - */ -public class MIVarInfoNumChildrenInfo extends MIInfo { - - int children; - - public MIVarInfoNumChildrenInfo(MIOutput record) { - super(record); - parse(); - } - - public int getChildNumber() { - return children; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - - if (var.equals("numchild")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - String str = ((MIConst)value).getString(); - try { - children = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarInfoTypeInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarInfoTypeInfo.java deleted file mode 100644 index 9ebf6af7965..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarInfoTypeInfo.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - - -/** - * GDB/MI var-info-type - */ -public class MIVarInfoTypeInfo extends MIInfo { - - String type = ""; //$NON-NLS-1$ - - public MIVarInfoTypeInfo(MIOutput record) { - super(record); - parse(); - } - - public String getType() { - return type; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("type")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - type = ((MIConst)value).getString(); - } - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarListChildrenInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarListChildrenInfo.java deleted file mode 100644 index 3ccdd6d9c29..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarListChildrenInfo.java +++ /dev/null @@ -1,88 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - -/** - * GDB/MI var-list-children - * -var-list-children var2 - * ^done,numchild="6",children={child={name="var2.0",exp="0",numchild="0",type="char"},child={name="var2.1",exp="1",numchild="0",type="char"},child={name="var2.2",exp="2",numchild="0",type="char"},child={name="var2.3",exp="3",numchild="0",type="char"},child={name="var2.4",exp="4",numchild="0",type="char"},child={name="var2.5",exp="5",numchild="0",type="char"}} - * - */ -public class MIVarListChildrenInfo extends MIInfo { - - MIVar[] children; - int numchild; - - public MIVarListChildrenInfo(MIOutput record) { - super(record); - parse(); - } - - public MIVar[] getMIVars() { - return children; - } - - void parse() { - List aList = new ArrayList(); - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - - if (var.equals("numchild")) { //$NON-NLS-1$ - if (value instanceof MIConst) { - String str = ((MIConst)value).getString(); - try { - numchild = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } - } else if (var.equals("children")) { //$NON-NLS-1$ - parseChildren(value, aList); - } - } - } - } - children = (MIVar[])aList.toArray(new MIVar[aList.size()]); - } - - /* - * Some gdb MacOSX do not return a MITuple so we have - * to check for different format. - * See PR 81019 - */ - void parseChildren(MIValue val, List aList) { - MIResult[] results = null; - if (val instanceof MITuple) { - results = ((MITuple)val).getMIResults(); - } else if (val instanceof MIList) { - results = ((MIList)val).getMIResults(); - } - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("child")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MITuple) { - aList.add(new MIVar((MITuple)value)); - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarShowAttributesInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarShowAttributesInfo.java deleted file mode 100644 index 0798489d573..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarShowAttributesInfo.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI var-show-attributes - */ -public class MIVarShowAttributesInfo extends MIInfo { - - String attr = ""; //$NON-NLS-1$ - - public MIVarShowAttributesInfo(MIOutput record) { - super(record); - parse(); - } - - public String getAttributes () { - return attr; - } - - public boolean isEditable() { - return attr.equals("editable"); //$NON-NLS-1$ - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("attr")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - attr = ((MIConst)value).getString(); - } - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarShowFormatInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarShowFormatInfo.java deleted file mode 100644 index 3d6043fb76f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarShowFormatInfo.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -import org.eclipse.cdt.debug.mi.core.MIFormat; - -/** - * GDB/MI var-show-format - */ -public class MIVarShowFormatInfo extends MIInfo { - - int format = MIFormat.NATURAL; - - public MIVarShowFormatInfo(MIOutput record) { - super(record); - parse(); - } - - public int getFormat() { - return format; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("name")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - String str = ((MIConst)value).getString(); - if ("binary".equals(str)) { //$NON-NLS-1$ - format = MIFormat.BINARY; - } else if ("decimal".equals(str)) { //$NON-NLS-1$ - format = MIFormat.DECIMAL; - } else if ("hexadecimal".equals(str)) { //$NON-NLS-1$ - format = MIFormat.HEXADECIMAL; - } else if ("octal".equals(str)) { //$NON-NLS-1$ - format = MIFormat.OCTAL; - } else if ("natural".equals(str)) { //$NON-NLS-1$ - format = MIFormat.NATURAL; - } - } - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarUpdateInfo.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarUpdateInfo.java deleted file mode 100644 index fa8553760b0..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIVarUpdateInfo.java +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - -/** - * GDB/MI var-update. - * -var-update * - * ^done,changelist={name="var3",in_scope="true",type_changed="false",name="var2",in_scope="true",type_changed="false"} - */ -public class MIVarUpdateInfo extends MIInfo { - - MIVarChange[] changeList; - - public MIVarUpdateInfo(MIOutput record) { - super(record); - parse(); - } - - public MIVarChange[] getMIVarChanges() { - return changeList; - } - - void parse() { - List aList = new ArrayList(); - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("changelist")) { //$NON-NLS-1$ - MIValue value = results[i].getMIValue(); - if (value instanceof MITuple) { - parseChangeList((MITuple)value, aList); - } else if (value instanceof MIList) { - parseChangeList((MIList)value, aList); - } - } - } - } - } - changeList = (MIVarChange[])aList.toArray(new MIVarChange[aList.size()]); - } - - /** - * For MI2 the format is now a MIList. - * @param tuple - * @param aList - */ - void parseChangeList(MIList miList, List aList) { - MIValue[] values = miList.getMIValues(); - for (int i = 0; i < values.length; ++i) { - if (values[i] instanceof MITuple) { - parseChangeList((MITuple)values[i], aList); - } else if (values[i] instanceof MIList) { - parseChangeList((MIList)values[i], aList); - } - } - } - - void parseChangeList(MITuple tuple, List aList) { - MIResult[] results = tuple.getMIResults(); - MIVarChange change = null; - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - if (value instanceof MITuple) { - parseChangeList((MITuple)value, aList); - } - else - { - String str = ""; //$NON-NLS-1$ - if (value instanceof MIConst) { - str = ((MIConst)value).getString(); - } - if (var.equals("name")) { //$NON-NLS-1$ - change = new MIVarChange(str); - aList.add(change); - } else if (var.equals("in_scope")) { //$NON-NLS-1$ - if (change != null) { - change.setInScope("true".equals(str)); //$NON-NLS-1$ - } - } else if (var.equals("type_changed")) { //$NON-NLS-1$ - if (change != null) { - change.setChanged("true".equals(str)); //$NON-NLS-1$ - } - } - } - } - } -} |