mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 01:36:01 +02:00
first framework to implement cdi.
This commit is contained in:
parent
0fecb04151
commit
dda2bd3297
80 changed files with 1790 additions and 146 deletions
|
@ -4,5 +4,6 @@
|
|||
<classpathentry kind="src" path="/org.eclipse.core.runtime"/>
|
||||
<classpathentry kind="src" path="/org.eclipse.core.boot"/>
|
||||
<classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/>
|
||||
<classpathentry kind="src" path="/org.eclipse.cdt.debug.core"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<name>org.eclipse.cdt.debug.mi.core</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
<project>org.eclipse.cdt.debug.core</project>
|
||||
<project>org.eclipse.core.boot</project>
|
||||
<project>org.eclipse.core.runtime</project>
|
||||
</projects>
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core;
|
||||
|
||||
/**
|
||||
* 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() {
|
||||
}
|
||||
}
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
@ -7,7 +11,7 @@ import org.eclipse.core.runtime.IPluginDescriptor;
|
|||
import org.eclipse.core.runtime.Plugin;
|
||||
|
||||
/**
|
||||
*
|
||||
* GDB/MI Plugin.
|
||||
*/
|
||||
public class MIPlugin extends Plugin {
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -175,6 +179,10 @@ public class MISession extends Observable {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean isTerminated() {
|
||||
return (!txThread.isAlive() || !rxThread.isAlive());
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the MISession.
|
||||
*/
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package org.eclipse.cdt.debug.mi.core;
|
||||
|
||||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
|
@ -11,6 +10,9 @@ import java.util.List;
|
|||
|
||||
import org.eclipse.cdt.debug.mi.core.command.Command;
|
||||
|
||||
/**
|
||||
* Simple thread-safe Queue implemetation.
|
||||
*/
|
||||
public class Queue {
|
||||
|
||||
private List list;
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
|
@ -31,12 +35,9 @@ 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;
|
||||
|
||||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
/**
|
||||
* Receiving thread of gdb, read the input channel.
|
||||
*/
|
||||
|
||||
|
||||
public class RxThread extends Thread {
|
||||
|
||||
final MISession session;
|
||||
|
|
|
@ -1,15 +1,19 @@
|
|||
package org.eclipse.cdt.debug.mi.core;
|
||||
|
||||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
package org.eclipse.cdt.debug.mi.core;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import org.eclipse.cdt.debug.mi.core.command.Command;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
|
|
@ -0,0 +1,110 @@
|
|||
/*
|
||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.cdi;
|
||||
|
||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICBreakpoint;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICBreakpointManager;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICCatchEvent;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICCatchpoint;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICCondition;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICLocation;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICLocationBreakpoint;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICSession;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICWatchpoint;
|
||||
import org.eclipse.cdt.debug.mi.core.MISession;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class BreakpointManager implements ICBreakpointManager {
|
||||
|
||||
MISession session;
|
||||
|
||||
public BreakpointManager(MISession s) {
|
||||
session = s;
|
||||
}
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICBreakpointManager#deleteAllBreakpoints()
|
||||
*/
|
||||
public void deleteAllBreakpoints() throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICBreakpointManager#deleteBreakpoint(ICBreakpoint)
|
||||
*/
|
||||
public void deleteBreakpoint(ICBreakpoint breakpoint) throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICBreakpointManager#deleteBreakpoints(ICBreakpoint[])
|
||||
*/
|
||||
public void deleteBreakpoints(ICBreakpoint[] breakpoints)
|
||||
throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICBreakpointManager#getBreakpoint(String)
|
||||
*/
|
||||
public ICBreakpoint getBreakpoint(String breakpointId)
|
||||
throws CDIException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICBreakpointManager#getBreakpoints()
|
||||
*/
|
||||
public ICBreakpoint[] getBreakpoints() throws CDIException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICBreakpointManager#setCatchpoint(int, ICCatchEvent, String, ICCondition, boolean)
|
||||
*/
|
||||
public ICCatchpoint setCatchpoint(
|
||||
int type,
|
||||
ICCatchEvent event,
|
||||
String expression,
|
||||
ICCondition condition,
|
||||
boolean enabled)
|
||||
throws CDIException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICBreakpointManager#setLocationBreakpoint(int, ICLocation, ICCondition, boolean, String)
|
||||
*/
|
||||
public ICLocationBreakpoint setLocationBreakpoint(
|
||||
int type,
|
||||
ICLocation location,
|
||||
ICCondition condition,
|
||||
boolean enabled,
|
||||
String threadId)
|
||||
throws CDIException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICBreakpointManager#setWatchpoint(int, int, String, ICCondition, boolean)
|
||||
*/
|
||||
public ICWatchpoint setWatchpoint(
|
||||
int type,
|
||||
int watchType,
|
||||
String expression,
|
||||
ICCondition condition,
|
||||
boolean enabled)
|
||||
throws CDIException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICSessionObject#getSession()
|
||||
*/
|
||||
public ICSession getSession() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,126 @@
|
|||
/*
|
||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.eclipse.cdt.debug.mi.core.cdi;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICBreakpointManager;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICEventManager;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICExpressionManager;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICMemoryManager;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICSession;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICSignalManager;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICSourceManager;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICTarget;
|
||||
import org.eclipse.cdt.debug.mi.core.MISession;
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICSession
|
||||
*/
|
||||
public class CSession implements ICSession {
|
||||
|
||||
Properties props;
|
||||
MISession session;
|
||||
BreakpointManager breakpointManager;
|
||||
EventManager eventManager;
|
||||
ExpressionManager expressionManager;
|
||||
MemoryManager memoryManager;
|
||||
SignalManager signalManager;
|
||||
SourceManager sourceManager;
|
||||
CTarget ctarget;
|
||||
|
||||
public CSession(MISession s) {
|
||||
session = s;
|
||||
props = new Properties();
|
||||
breakpointManager = new BreakpointManager(session);
|
||||
eventManager = new EventManager(session);
|
||||
expressionManager = new ExpressionManager(session);
|
||||
memoryManager = new MemoryManager(session);
|
||||
signalManager = new SignalManager(session);
|
||||
sourceManager = new SourceManager(session);
|
||||
ctarget = new CTarget(session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICSession#getAttribute(String)
|
||||
*/
|
||||
public String getAttribute(String key) {
|
||||
return props.getProperty(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICSession#getBreakpointManager()
|
||||
*/
|
||||
public ICBreakpointManager getBreakpointManager() {
|
||||
return breakpointManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICSession#getEventManager()
|
||||
*/
|
||||
public ICEventManager getEventManager() {
|
||||
return eventManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICSession#getExpressionManager()
|
||||
*/
|
||||
public ICExpressionManager getExpressionManager() {
|
||||
return expressionManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICSession#getMemoryManager()
|
||||
*/
|
||||
public ICMemoryManager getMemoryManager() {
|
||||
return memoryManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICSession#getSignalManager()
|
||||
*/
|
||||
public ICSignalManager getSignalManager() {
|
||||
return signalManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICSession#getSourceManager()
|
||||
*/
|
||||
public ICSourceManager getSourceManager() {
|
||||
return sourceManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICSession#getTargets()
|
||||
*/
|
||||
public ICTarget[] getTargets() {
|
||||
return new ICTarget[]{ctarget};
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICSession#isTerminated()
|
||||
*/
|
||||
public boolean isTerminated() {
|
||||
return session.isTerminated();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICSession#setAttribute(String, String)
|
||||
*/
|
||||
public void setAttribute(String key, String value) {
|
||||
props.setProperty(key, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICSession#terminate()
|
||||
*/
|
||||
public void terminate() throws CDIException {
|
||||
session.terminate();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,234 @@
|
|||
/*
|
||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.cdi;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICSession;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICExpression;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICGlobalVariable;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICMemoryBlock;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICObject;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICRegisterGroup;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICSharedLibrary;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICTarget;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICThread;
|
||||
import org.eclipse.cdt.debug.mi.core.MISession;
|
||||
|
||||
/**
|
||||
* @author alain
|
||||
*
|
||||
* To change this generated comment edit the template variable "typecomment":
|
||||
* Window>Preferences>Java>Templates.
|
||||
* To enable and disable the creation of type comments go to
|
||||
* Window>Preferences>Java>Code Generation.
|
||||
*/
|
||||
public class CTarget implements ICTarget {
|
||||
|
||||
MISession session;
|
||||
|
||||
public CTarget(MISession s) {
|
||||
session = s;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#disconnect()
|
||||
*/
|
||||
public void disconnect() throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#evaluateExpression(ICExpression)
|
||||
*/
|
||||
public void evaluateExpression(ICExpression expression)
|
||||
throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#evaluateExpression(String)
|
||||
*/
|
||||
public ICExpression evaluateExpression(String expressionText)
|
||||
throws CDIException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#finish()
|
||||
*/
|
||||
public void finish() throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#getCMemoryBlock(long, long)
|
||||
*/
|
||||
public ICMemoryBlock getCMemoryBlock(long startAddress, long length)
|
||||
throws CDIException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#getErrorStream()
|
||||
*/
|
||||
public InputStream getErrorStream() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#getGlobalVariables()
|
||||
*/
|
||||
public ICGlobalVariable[] getGlobalVariables() throws CDIException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#getInputStream()
|
||||
*/
|
||||
public InputStream getInputStream() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#getOutputStream()
|
||||
*/
|
||||
public OutputStream getOutputStream() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#getRegisterGroups()
|
||||
*/
|
||||
public ICRegisterGroup[] getRegisterGroups() throws CDIException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#getSession()
|
||||
*/
|
||||
public ICSession getSession() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#getSharedLibraries()
|
||||
*/
|
||||
public ICSharedLibrary[] getSharedLibraries() throws CDIException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#getThread(String)
|
||||
*/
|
||||
public ICThread getThread(String id) throws CDIException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#getThreads()
|
||||
*/
|
||||
public ICThread[] getThreads() throws CDIException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#isDisconnected()
|
||||
*/
|
||||
public boolean isDisconnected() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#isStepping()
|
||||
*/
|
||||
public boolean isStepping() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#isSuspended()
|
||||
*/
|
||||
public boolean isSuspended() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#isTerminated()
|
||||
*/
|
||||
public boolean isTerminated() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#restart()
|
||||
*/
|
||||
public void restart() throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#resume()
|
||||
*/
|
||||
public void resume() throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#stepInto()
|
||||
*/
|
||||
public void stepInto() throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#stepIntoInstruction()
|
||||
*/
|
||||
public void stepIntoInstruction() throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#stepOver()
|
||||
*/
|
||||
public void stepOver() throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#stepOverInstruction()
|
||||
*/
|
||||
public void stepOverInstruction() throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#suspend()
|
||||
*/
|
||||
public void suspend() throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICTarget#terminate()
|
||||
*/
|
||||
public void terminate() throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICObject#getCDITarget()
|
||||
*/
|
||||
public ICTarget getCDITarget() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICObject#getId()
|
||||
*/
|
||||
public String getId() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICObject#getParent()
|
||||
*/
|
||||
public ICObject getParent() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.cdi;
|
||||
|
||||
import org.eclipse.cdt.debug.core.cdi.ICEventManager;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICSession;
|
||||
import org.eclipse.cdt.debug.core.cdi.event.ICEventListener;
|
||||
import org.eclipse.cdt.debug.mi.core.MISession;
|
||||
|
||||
/**
|
||||
* @author alain
|
||||
*
|
||||
* To change this generated comment edit the template variable "typecomment":
|
||||
* Window>Preferences>Java>Templates.
|
||||
* To enable and disable the creation oEventManagerts go to
|
||||
* Window>Preferences>Java>Code Generation.
|
||||
*/
|
||||
public class EventManager implements ICEventManager {
|
||||
|
||||
MISession session;
|
||||
|
||||
public EventManager(MISession s) {
|
||||
session = s;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICEventManager#addEventListener(ICEventListener)
|
||||
*/
|
||||
public void addEventListener(ICEventListener listener) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICEventManager#removeEventListener(ICEventListener)
|
||||
*/
|
||||
public void removeEventListener(ICEventListener listener) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICSessionObject#getSession()
|
||||
*/
|
||||
public ICSession getSession() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.cdi;
|
||||
|
||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICExpressionManager;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICSession;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICExpression;
|
||||
import org.eclipse.cdt.debug.mi.core.MISession;
|
||||
|
||||
/**
|
||||
* @author alain
|
||||
*
|
||||
* To change this generated comment edit the template variable "typecomment":
|
||||
* Window>Preferences>Java>Templates.
|
||||
* To enable and disable the creation of type comments go to
|
||||
* Window>Preferences>Java>Code Generation.
|
||||
*/
|
||||
public class ExpressionManager implements ICExpressionManager {
|
||||
|
||||
MISession session;
|
||||
|
||||
public ExpressionManager(MISession s) {
|
||||
session = s;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICExpressionManager#addExpression(ICExpression)
|
||||
*/
|
||||
public void addExpression(ICExpression expression) throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICExpressionManager#getExpression(String)
|
||||
*/
|
||||
public ICExpression getExpression(String expressionId)
|
||||
throws CDIException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICExpressionManager#getExpressions()
|
||||
*/
|
||||
public ICExpression[] getExpressions() throws CDIException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICExpressionManager#removeExpression(ICExpression)
|
||||
*/
|
||||
public void removeExpression(ICExpression expression) throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICExpressionManager#removeExpressions(ICExpression[])
|
||||
*/
|
||||
public void removeExpressions(ICExpression[] expressions)
|
||||
throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICSessionObject#getSession()
|
||||
*/
|
||||
public ICSession getSession() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.cdi;
|
||||
|
||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICMemoryManager;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICSession;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICMemoryBlock;
|
||||
import org.eclipse.cdt.debug.mi.core.MISession;
|
||||
|
||||
/**
|
||||
* @author alain
|
||||
*
|
||||
* To change this generated comment edit the template variable "typecomment":
|
||||
* Window>Preferences>Java>Templates.
|
||||
* To enable and disable the creation of type comments go to
|
||||
* Window>Preferences>Java>Code Generation.
|
||||
*/
|
||||
public class MemoryManager implements ICMemoryManager {
|
||||
|
||||
MISession session;
|
||||
|
||||
public MemoryManager(MISession s) {
|
||||
session = s;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICMemoryManager#addBlock(ICMemoryBlock)
|
||||
*/
|
||||
public void addBlock(ICMemoryBlock memoryBlock) throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICMemoryManager#getBlock(String)
|
||||
*/
|
||||
public ICMemoryBlock getBlock(String id) throws CDIException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICMemoryManager#getBlocks()
|
||||
*/
|
||||
public ICMemoryBlock[] getBlocks() throws CDIException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICMemoryManager#removeAllBlocks()
|
||||
*/
|
||||
public void removeAllBlocks() throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICMemoryManager#removeBlock(ICMemoryBlock)
|
||||
*/
|
||||
public void removeBlock(ICMemoryBlock memoryBlock) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICMemoryManager#removeBlocks(ICMemoryBlock[])
|
||||
*/
|
||||
public void removeBlocks(ICMemoryBlock[] memoryBlocks)
|
||||
throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICSessionObject#getSession()
|
||||
*/
|
||||
public ICSession getSession() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.cdi;
|
||||
|
||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICSession;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICSignal;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICSignalManager;
|
||||
import org.eclipse.cdt.debug.mi.core.MISession;
|
||||
|
||||
/**
|
||||
* @author alain
|
||||
*
|
||||
* To change this generated comment edit the template variable "typecomment":
|
||||
* Window>Preferences>Java>Templates.
|
||||
* To enable and disable the creation of type comments go to
|
||||
* Window>Preferences>Java>Code Generation.
|
||||
*/
|
||||
public class SignalManager implements ICSignalManager {
|
||||
|
||||
MISession session;
|
||||
|
||||
public SignalManager(MISession s) {
|
||||
session = s;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICSignalManager#getSignals()
|
||||
*/
|
||||
public ICSignal[] getSignals() throws CDIException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICSessionObject#getSession()
|
||||
*/
|
||||
public ICSession getSession() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.cdi;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICSession;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICSourceManager;
|
||||
import org.eclipse.cdt.debug.mi.core.MISession;
|
||||
|
||||
/**
|
||||
* @author alain
|
||||
*
|
||||
* To change this generated comment edit the template variable "typecomment":
|
||||
* Window>Preferences>Java>Templates.
|
||||
* To enable and disable the creation of type comments go to
|
||||
* Window>Preferences>Java>Code Generation.
|
||||
*/
|
||||
public class SourceManager implements ICSourceManager {
|
||||
|
||||
MISession session;
|
||||
|
||||
public SourceManager(MISession s) {
|
||||
session = s;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICSourceManager#getDirectories()
|
||||
*/
|
||||
public File[] getDirectories() throws CDIException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICSourceManager#reset()
|
||||
*/
|
||||
public void reset() throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICSourceManager#set(File[])
|
||||
*/
|
||||
public void set(File[] directories) throws CDIException {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICSessionObject#getSession()
|
||||
*/
|
||||
public ICSession getSession() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -10,7 +10,6 @@ import org.eclipse.cdt.debug.mi.core.output.MIInfo;
|
|||
import org.eclipse.cdt.debug.mi.core.output.MIOutput;
|
||||
|
||||
/**
|
||||
*
|
||||
* Represents a CLI command.
|
||||
*/
|
||||
public class CLICommand extends Command
|
||||
|
@ -28,6 +27,8 @@ public class CLICommand extends Command
|
|||
* @return the text representation of this command
|
||||
*/
|
||||
public String toString(){
|
||||
return operation;
|
||||
if (operation.endsWith("\n"))
|
||||
return operation;
|
||||
return operation + "\n";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,11 +11,7 @@ import org.eclipse.cdt.debug.mi.core.output.MIInfo;
|
|||
import org.eclipse.cdt.debug.mi.core.output.MIOutput;
|
||||
|
||||
/**
|
||||
*
|
||||
* A base class for all mi requests.
|
||||
*
|
||||
* @author Mikhail Khodjaiants
|
||||
* @since Jul 11, 2002
|
||||
*/
|
||||
public abstract class Command
|
||||
{
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
package org.eclipse.cdt.debug.mi.core.command;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Factory to create GDB commands.
|
||||
*/
|
||||
public class CommandFactory {
|
||||
|
||||
|
@ -68,8 +71,8 @@ public class CommandFactory {
|
|||
return new MIDataListRegisterValues(fmt, regno);
|
||||
}
|
||||
|
||||
public MIDataReadMemory createMIDataReadMemory(int offset, String address,
|
||||
String wordFormat, int wordSize,
|
||||
public MIDataReadMemory createMIDataReadMemory(long offset, String address,
|
||||
int wordFormat, int wordSize,
|
||||
int rows, int cols, Character asChar) {
|
||||
return new MIDataReadMemory(offset, address, wordFormat, wordSize,
|
||||
rows, cols, asChar);
|
||||
|
@ -147,6 +150,14 @@ public class CommandFactory {
|
|||
return new MIGDBExit();
|
||||
}
|
||||
|
||||
public MIGDBSet createMIGDBSet(String[] params) {
|
||||
return new MIGDBSet(params);
|
||||
}
|
||||
|
||||
public MIGDBShow createMIGDBShow(String[] params) {
|
||||
return new MIGDBShow(params);
|
||||
}
|
||||
|
||||
public MIStackInfoDepth createMIStackInfoDepth(int depth) {
|
||||
return new MIStackInfoDepth(depth);
|
||||
}
|
||||
|
|
|
@ -8,10 +8,11 @@ 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.
|
||||
*
|
||||
* -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
|
||||
*/
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
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;
|
||||
|
@ -24,13 +25,6 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
|
|||
*/
|
||||
public class MIDataListRegisterValues extends MICommand
|
||||
{
|
||||
public final static int HEXADECIMAL = 0;
|
||||
public final static int OCTAL = 1;
|
||||
public final static int BINARY = 2;
|
||||
public final static int DECIMAL = 3;
|
||||
public final static int RAW = 4;
|
||||
public final static int NATURAL = 5;
|
||||
|
||||
public MIDataListRegisterValues(int fmt) {
|
||||
this(fmt, null);
|
||||
}
|
||||
|
@ -40,27 +34,30 @@ public class MIDataListRegisterValues extends MICommand
|
|||
|
||||
String format = "x";
|
||||
switch (fmt) {
|
||||
case NATURAL:
|
||||
format = "N";
|
||||
case MIFormat.NATURAL:
|
||||
format = "N";
|
||||
break;
|
||||
case RAW:
|
||||
format = "r";
|
||||
|
||||
case MIFormat.RAW:
|
||||
format = "r";
|
||||
break;
|
||||
case DECIMAL:
|
||||
format = "d";
|
||||
|
||||
case MIFormat.DECIMAL:
|
||||
format = "d";
|
||||
break;
|
||||
case BINARY:
|
||||
format = "t";
|
||||
|
||||
case MIFormat.BINARY:
|
||||
format = "t";
|
||||
break;
|
||||
case OCTAL:
|
||||
format = "o";
|
||||
|
||||
case MIFormat.OCTAL:
|
||||
format = "o";
|
||||
break;
|
||||
/*
|
||||
case HEXADECIMAL:
|
||||
default:
|
||||
format = "x";
|
||||
|
||||
case MIFormat.HEXADECIMAL:
|
||||
default:
|
||||
format = "x";
|
||||
break;
|
||||
*/
|
||||
}
|
||||
|
||||
setOptions(new String[]{format});
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
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;
|
||||
|
@ -49,22 +50,81 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
|
|||
*
|
||||
*
|
||||
*/
|
||||
public class MIDataReadMemory extends MICommand
|
||||
{
|
||||
public class MIDataReadMemory extends MICommand {
|
||||
|
||||
public MIDataReadMemory (int offset, String address,
|
||||
String wordFormat, int wordSize,
|
||||
int rows, int cols, Character asChar) {
|
||||
public MIDataReadMemory(
|
||||
long offset,
|
||||
String address,
|
||||
int wordFormat,
|
||||
int wordSize,
|
||||
int rows,
|
||||
int cols,
|
||||
Character asChar) {
|
||||
super("-data-read-memory");
|
||||
if (offset != 0) {
|
||||
setOptions(new String[]{"-o", Integer.toString(offset)});
|
||||
setOptions(new String[] { "-o", Long.toString(offset)});
|
||||
}
|
||||
|
||||
String format = "x";
|
||||
switch (wordFormat) {
|
||||
case MIFormat.UNSIGNED :
|
||||
format = "u";
|
||||
break;
|
||||
|
||||
case MIFormat.FLOAT :
|
||||
format = "f";
|
||||
break;
|
||||
|
||||
case MIFormat.ADDRESS :
|
||||
format = "a";
|
||||
break;
|
||||
|
||||
case MIFormat.INSTRUCTION :
|
||||
format = "i";
|
||||
break;
|
||||
|
||||
case MIFormat.CHAR :
|
||||
format = "c";
|
||||
break;
|
||||
|
||||
case MIFormat.STRING :
|
||||
format = "s";
|
||||
break;
|
||||
|
||||
case MIFormat.DECIMAL :
|
||||
format = "d";
|
||||
break;
|
||||
|
||||
case MIFormat.BINARY :
|
||||
format = "t";
|
||||
break;
|
||||
|
||||
case MIFormat.OCTAL :
|
||||
format = "o";
|
||||
break;
|
||||
|
||||
case MIFormat.HEXADECIMAL :
|
||||
default :
|
||||
format = "x";
|
||||
break;
|
||||
}
|
||||
|
||||
if (asChar == null) {
|
||||
setParameters(new String[]{address, wordFormat, Integer.toString(wordSize),
|
||||
Integer.toString(rows), Integer.toString(cols)});
|
||||
setParameters(
|
||||
new String[] {
|
||||
address,
|
||||
format,
|
||||
Integer.toString(wordSize),
|
||||
Integer.toString(rows),
|
||||
Integer.toString(cols)});
|
||||
} else {
|
||||
setParameters(new String[]{address, wordFormat, Integer.toString(wordSize),
|
||||
Integer.toString(rows), Integer.toString(cols),
|
||||
setParameters(
|
||||
new String[] {
|
||||
address,
|
||||
format,
|
||||
Integer.toString(wordSize),
|
||||
Integer.toString(rows),
|
||||
Integer.toString(cols),
|
||||
asChar.toString()});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,11 @@
|
|||
|
||||
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
|
||||
|
@ -18,4 +23,17 @@ public class MIEnvironmentPWD extends MICommand
|
|||
public MIEnvironmentPWD() {
|
||||
super("-environment-pwd");
|
||||
}
|
||||
|
||||
public MIInfo getMIInfo() throws MIException {
|
||||
MIInfo info = null;
|
||||
MIOutput out = getMIOutput();
|
||||
if (out != null) {
|
||||
info = new MIEnvironmentPWDInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
}
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -26,17 +26,4 @@ public class MIExecStepInstruction extends MICommand
|
|||
public MIExecStepInstruction() {
|
||||
super("-exec-step-instruction");
|
||||
}
|
||||
/*
|
||||
public MIInfo getMIInfo() throws MIException {
|
||||
MIInfo info = null;
|
||||
MIOutput out = getMIOutput();
|
||||
if (out != null) {
|
||||
info = new MIExecStepInstructionInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
}
|
||||
}
|
||||
return info;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.eclipse.cdt.debug.mi.core.command;
|
||||
|
||||
/**
|
||||
*
|
||||
* -gdb-set
|
||||
*
|
||||
* Set an internal GDB variable.
|
||||
*
|
||||
*/
|
||||
public class MIGDBSet extends MICommand
|
||||
{
|
||||
public MIGDBSet(String[] params) {
|
||||
super("-gdb-set", params);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.eclipse.cdt.debug.mi.core.command;
|
||||
|
||||
import org.eclipse.cdt.debug.mi.core.MIException;
|
||||
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[] params) {
|
||||
super("-gdb-show", params);
|
||||
}
|
||||
|
||||
public MIInfo getMIInfo() throws MIException {
|
||||
MIInfo info = null;
|
||||
MIOutput out = getMIOutput();
|
||||
if (out != null) {
|
||||
info = new MIGDBShowInfo(out);
|
||||
if (info.isError()) {
|
||||
throw new MIException(info.getErrorMsg());
|
||||
}
|
||||
}
|
||||
return info;
|
||||
}
|
||||
}
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
package org.eclipse.cdt.debug.mi.core.command;
|
||||
|
||||
import org.eclipse.cdt.debug.mi.core.MIFormat;
|
||||
|
||||
/**
|
||||
*
|
||||
* -var-set-format NAME FORMAT-SPEC
|
||||
|
@ -21,33 +23,27 @@ package org.eclipse.cdt.debug.mi.core.command;
|
|||
*/
|
||||
public class MIVarSetFormat extends MICommand
|
||||
{
|
||||
public final static int HEXADECIMAL = 0;
|
||||
public final static int OCTAL = 1;
|
||||
public final static int BINARY = 2;
|
||||
public final static int DECIMAL = 3;
|
||||
// public final static int RAW = 4;
|
||||
public final static int NATURAL = 5;
|
||||
|
||||
public MIVarSetFormat(String name, int fmt) {
|
||||
super("-var-set-format");
|
||||
String format = "hexadecimal";
|
||||
switch (fmt) {
|
||||
case NATURAL:
|
||||
case MIFormat.NATURAL:
|
||||
format = "natural";
|
||||
break;
|
||||
case DECIMAL:
|
||||
case MIFormat.DECIMAL:
|
||||
format = "decimal";
|
||||
break;
|
||||
case BINARY:
|
||||
case MIFormat.BINARY:
|
||||
format = "binary";
|
||||
break;
|
||||
case OCTAL:
|
||||
case MIFormat.OCTAL:
|
||||
format = "octal";
|
||||
break;
|
||||
/*
|
||||
case HEXADECIMAL:
|
||||
case MIFormat.HEXADECIMAL:
|
||||
case MIFormat.RAW:
|
||||
default:
|
||||
format = "x";
|
||||
format = "hexadecimal";
|
||||
break;
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
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;
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Represent a GDB Tuple MI assembly response.
|
||||
*/
|
||||
public class MIAsm {
|
||||
long address;
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
/**
|
||||
* base Abstract class for the OOB stream MI responses.
|
||||
*/
|
||||
public abstract class MIAsyncRecord extends MIOOBRecord {
|
||||
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
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"}
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
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>
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
/**
|
||||
* Contain info about the GDB/MI breakpoint info.
|
||||
*/
|
||||
public class MIBreakPoint {
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -6,7 +11,6 @@ import java.util.List;
|
|||
import org.eclipse.cdt.debug.mi.core.command.MIBreakInsert;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* -break-watch buf
|
||||
* ^done,wpt={number="2",exp="buf"}
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
/**
|
||||
* GDB/MI var-update.
|
||||
*/
|
||||
|
||||
public class MIChange {
|
||||
String name;
|
||||
boolean inScope;
|
||||
boolean changed;
|
||||
|
||||
public MIChange(String n) {
|
||||
name = n;
|
||||
}
|
||||
|
||||
public boolean isInScope() {
|
||||
return inScope;
|
||||
}
|
||||
|
||||
public boolean isChanged() {
|
||||
return changed;
|
||||
}
|
||||
|
||||
public void setInScope(boolean b) {
|
||||
inScope = b;
|
||||
}
|
||||
|
||||
public void setChanged(boolean c) {
|
||||
changed = c;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
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 MIChild {
|
||||
|
||||
String name = "";
|
||||
String type = "";
|
||||
int numchild;
|
||||
|
||||
|
||||
public MIChild(MITuple tuple) {
|
||||
parse(tuple);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public int getnumChild() {
|
||||
return numchild;
|
||||
}
|
||||
|
||||
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 = "";
|
||||
if (value != null && value instanceof MIConst) {
|
||||
str = ((MIConst)value).getCString();
|
||||
}
|
||||
|
||||
if (var.equals("numchild")) {
|
||||
try {
|
||||
numchild = Integer.parseInt(str.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
} else if (var.equals("name")) {
|
||||
name = str;
|
||||
} else if (var.equals("type")) {
|
||||
type = str;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,12 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
/**
|
||||
* @see MIStreamRecord
|
||||
*/
|
||||
public class MIConsoleStreamOutput extends MIStreamRecord {
|
||||
}
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
/**
|
||||
* GDB/MI const value represents a ios-c string.
|
||||
*/
|
||||
public class MIConst extends MIValue {
|
||||
String cstring = "";
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
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 {
|
||||
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* GDB/MI Data evalue expression parsing response.
|
||||
*/
|
||||
public class MIDataEvaluateExpressionInfo extends MIInfo{
|
||||
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
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 {
|
||||
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
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 {
|
||||
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* GDB/MI data list register values extraction.
|
||||
*/
|
||||
public class MIDataListRegisterValuesInfo extends MIInfo {
|
||||
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* GDB/MI data read memor info extraction.
|
||||
*/
|
||||
public class MIDataReadMemoryInfo extends MIInfo {
|
||||
|
||||
|
|
|
@ -1,16 +1,50 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* GDB/MI environment PWD info extraction.
|
||||
*/
|
||||
public class MIEnvironmentPWDInfo extends MIInfo {
|
||||
|
||||
String pwd = "";
|
||||
|
||||
public MIEnvironmentPWDInfo(MIOutput o) {
|
||||
super(o);
|
||||
parse();
|
||||
}
|
||||
|
||||
public String getWorkingDirectory() {
|
||||
return ".";
|
||||
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")) {
|
||||
int len = "Working directory".length();
|
||||
str = str.substring(len).trim();
|
||||
len = str.indexOf('.');
|
||||
if (len != -1) {
|
||||
str = str.substring(0, len);
|
||||
}
|
||||
pwd = str;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
/**
|
||||
* @see MIAsyncRecord
|
||||
*/
|
||||
public class MIExecAsyncOutput extends MIAsyncRecord {
|
||||
}
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
/**
|
||||
* GDB/MI Frame tuple parsing.
|
||||
*/
|
||||
public class MIFrame {
|
||||
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* GDB/MI show parsing.
|
||||
*/
|
||||
public class MIGDBShowInfo extends MIInfo {
|
||||
|
||||
String value = "";
|
||||
|
||||
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")) {
|
||||
MIValue val = results[i].getMIValue();
|
||||
if (val instanceof MIConst) {
|
||||
value = ((MIConst)val).getString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,8 +1,11 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Base class for teh parsing/info GDB/MI classes.
|
||||
*/
|
||||
public class MIInfo {
|
||||
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
/**
|
||||
* GDB/MI list semantic.
|
||||
*/
|
||||
public class MIList extends MIValue {
|
||||
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
/**
|
||||
* @see MIStreamRecord
|
||||
*/
|
||||
public class MILogStreamOutput extends MIStreamRecord {
|
||||
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
/**
|
||||
* GDB/MI memory parsing.
|
||||
*/
|
||||
public class MIMemory {
|
||||
long addr;
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
/**
|
||||
*
|
||||
* @see MIAsyncRecord
|
||||
*/
|
||||
public class MINotifyAsyncOutput extends MIAsyncRecord {
|
||||
}
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
/**
|
||||
*
|
||||
* @see MIOOBRecord
|
||||
*/
|
||||
public abstract class MIOOBRecord {
|
||||
}
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
/**
|
||||
* GDB/MI response.
|
||||
*/
|
||||
public class MIOutput {
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -6,6 +10,7 @@ import java.util.List;
|
|||
|
||||
|
||||
/**
|
||||
* GDB/MI register response parsing.
|
||||
*/
|
||||
public class MIRegisterValue {
|
||||
int name;
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
/**
|
||||
* GDB/MI result sematic (Variable=Value)
|
||||
*/
|
||||
public class MIResult {
|
||||
String variable = "";
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
/**
|
||||
* GDB/MI ResultRecord.
|
||||
*/
|
||||
public class MIResultRecord {
|
||||
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* GDB/MI stack info depth parsing.
|
||||
*/
|
||||
public class MIStackInfoDepthInfo extends MIInfo {
|
||||
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
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 {
|
||||
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
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 {
|
||||
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* GDB/MI stack list locals parsing.
|
||||
*/
|
||||
public class MIStackListLocalsInfo extends MIInfo {
|
||||
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
/**
|
||||
* @see MIAsyncRecord
|
||||
*/
|
||||
public class MIStatusAsyncOutput extends MIAsyncRecord {
|
||||
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
/**
|
||||
* GDB/MI stream record response.
|
||||
*/
|
||||
public abstract class MIStreamRecord extends MIOOBRecord {
|
||||
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
/**
|
||||
* @see MIStreamRecord
|
||||
*/
|
||||
public class MITargetStreamOutput extends MIStreamRecord {
|
||||
}
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
/**
|
||||
* GDB/MI thread list parsing.
|
||||
*/
|
||||
public class MIThreadListIdsInfo extends MIInfo {
|
||||
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* GDB/MI thread select parsing.
|
||||
*/
|
||||
public class MIThreadSelectInfo extends MIInfo {
|
||||
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
/**
|
||||
* GDB/MI tuple value.
|
||||
*/
|
||||
public class MITuple extends MIValue {
|
||||
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
/**
|
||||
* @author alain
|
||||
*
|
||||
* To change this generated comment edit the template variable "typecomment":
|
||||
* Window>Preferences>Java>Templates.
|
||||
* To enable and disable the creation of type comments go to
|
||||
* Window>Preferences>Java>Code Generation.
|
||||
* GDB/MI value.
|
||||
*/
|
||||
public abstract class MIValue {
|
||||
}
|
||||
|
|
|
@ -1,24 +1,64 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
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 = "";
|
||||
int children;
|
||||
String type = "";
|
||||
|
||||
public MIVarCreateInfo(MIOutput record) {
|
||||
super(record);
|
||||
parse();
|
||||
}
|
||||
|
||||
public String getName () {
|
||||
return "";
|
||||
return name;
|
||||
}
|
||||
|
||||
public int getChildNumber() {
|
||||
return 0;
|
||||
return children;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return "";
|
||||
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();
|
||||
MIValue value = results[i].getMIValue();
|
||||
String str = "";
|
||||
if (value instanceof MIConst) {
|
||||
str = ((MIConst)value).getString();
|
||||
}
|
||||
|
||||
if (var.equals("name")) {
|
||||
name = str;
|
||||
} else if (var.equals("numchild")) {
|
||||
try {
|
||||
children = Integer.parseInt(str.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
} else if (var.equals("type")) {
|
||||
type = str;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,46 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
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 0;
|
||||
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")) {
|
||||
MIValue value = results[i].getMIValue();
|
||||
if (value instanceof MIConst) {
|
||||
String str = ((MIConst)value).getString();
|
||||
try {
|
||||
ndeleted = Integer.parseInt(str.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,41 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* GDB/MI var-evalute-expression
|
||||
*/
|
||||
public class MIVarEvaluateExpressionInfo extends MIInfo {
|
||||
|
||||
String value = "";
|
||||
|
||||
public MIVarEvaluateExpressionInfo(MIOutput record) {
|
||||
super(record);
|
||||
parse();
|
||||
}
|
||||
|
||||
public String getValue () {
|
||||
return "";
|
||||
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("name")) {
|
||||
MIValue val = results[i].getMIValue();
|
||||
if (val instanceof MIConst) {
|
||||
value = ((MIConst)val).getString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,20 +1,51 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* GDB/MI var-info-expression.
|
||||
*/
|
||||
public class MIVarInfoExpressionInfo extends MIInfo {
|
||||
|
||||
String lang = "";
|
||||
String exp = "";
|
||||
|
||||
public MIVarInfoExpressionInfo(MIOutput record) {
|
||||
super(record);
|
||||
parse();
|
||||
}
|
||||
|
||||
public String getLanguage () {
|
||||
return "";
|
||||
return lang;
|
||||
}
|
||||
|
||||
public String getExpression() {
|
||||
return "";
|
||||
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 = "";
|
||||
if (value instanceof MIConst) {
|
||||
str = ((MIConst)value).getString();
|
||||
}
|
||||
|
||||
if (var.equals("lang")) {
|
||||
lang = str;
|
||||
} else if (var.equals("exp")) {
|
||||
exp = str;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,48 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
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 0;
|
||||
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")) {
|
||||
MIValue value = results[i].getMIValue();
|
||||
if (value instanceof MIConst) {
|
||||
String str = ((MIConst)value).getString();
|
||||
try {
|
||||
children = Integer.parseInt(str.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,42 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* GDB/MI var-info-type
|
||||
*/
|
||||
public class MIVarInfoTypeInfo extends MIInfo {
|
||||
|
||||
String type = "";
|
||||
|
||||
public MIVarInfoTypeInfo(MIOutput record) {
|
||||
super(record);
|
||||
parse();
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return "";
|
||||
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")) {
|
||||
MIValue value = results[i].getMIValue();
|
||||
if (value instanceof MIConst) {
|
||||
type = ((MIConst)value).getString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,22 +1,72 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
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 {
|
||||
|
||||
public class Children {
|
||||
String name;
|
||||
int numchild;
|
||||
String type;
|
||||
}
|
||||
MIChild[] children = new MIChild[0];
|
||||
int numchild;
|
||||
|
||||
public MIVarListChildrenInfo(MIOutput record) {
|
||||
super(record);
|
||||
parse();
|
||||
}
|
||||
|
||||
public Children[] getChildren() {
|
||||
return null;
|
||||
public MIChild[] getChildren() {
|
||||
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")) {
|
||||
if (value instanceof MIConst) {
|
||||
String str = ((MIConst)value).getString();
|
||||
try {
|
||||
numchild = Integer.parseInt(str.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
}
|
||||
} else if (var.equals("children")) {
|
||||
if (value instanceof MITuple) {
|
||||
parseChildren((MITuple)value, aList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
children = (MIChild[])aList.toArray(new MIChild[aList.size()]);
|
||||
}
|
||||
|
||||
void parseChildren(MITuple tuple, List aList) {
|
||||
MIResult[] results = tuple.getMIResults();
|
||||
for (int i = 0; i < results.length; i++) {
|
||||
String var = results[i].getVariable();
|
||||
if (var.equals("child")) {
|
||||
MIValue value = results[i].getMIValue();
|
||||
if (value instanceof MITuple) {
|
||||
aList.add(new MIChild((MITuple)value));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,41 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.output;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* GDB/MI var-show-attributes
|
||||
*/
|
||||
public class MIVarShowAttributesInfo extends MIInfo {
|
||||
|
||||
String attr = "";
|
||||
|
||||
public MIVarShowAttributesInfo(MIOutput record) {
|
||||
super(record);
|
||||
parse();
|
||||
}
|
||||
|
||||
public String[] getAttributes () {
|
||||
return null;
|
||||
public String getAttributes () {
|
||||
return attr;
|
||||
}
|
||||
|
||||
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")) {
|
||||
MIValue value = results[i].getMIValue();
|
||||
if (value instanceof MIConst) {
|
||||
attr = ((MIConst)value).getString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,54 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
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 0;
|
||||
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")) {
|
||||
MIValue value = results[i].getMIValue();
|
||||
if (value instanceof MIConst) {
|
||||
String str = ((MIConst)value).getString();
|
||||
if ("binary".equals(str)) {
|
||||
format = MIFormat.BINARY;
|
||||
} else if ("decimal".equals(str)) {
|
||||
format = MIFormat.DECIMAL;
|
||||
} else if ("hexadecimal".equals(str)) {
|
||||
format = MIFormat.HEXADECIMAL;
|
||||
} else if ("octal".equals(str)) {
|
||||
format = MIFormat.OCTAL;
|
||||
} else if ("natural".equals(str)) {
|
||||
format = MIFormat.NATURAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,16 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
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 {
|
||||
|
||||
|
@ -12,11 +20,60 @@ public class MIVarUpdateInfo extends MIInfo {
|
|||
boolean changed;
|
||||
}
|
||||
|
||||
MIChange[] changeList;
|
||||
|
||||
public MIVarUpdateInfo(MIOutput record) {
|
||||
super(record);
|
||||
parse();
|
||||
}
|
||||
|
||||
public Change[] getChangeList () {
|
||||
return null;
|
||||
public MIChange[] getChangeList () {
|
||||
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")) {
|
||||
MIValue value = results[i].getMIValue();
|
||||
if (value instanceof MITuple) {
|
||||
parseChangeList((MITuple)value, aList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
changeList = (MIChange[])aList.toArray(new MIChange[aList.size()]);
|
||||
}
|
||||
|
||||
void parseChangeList(MITuple tuple, List aList) {
|
||||
MIResult[] results = tuple.getMIResults();
|
||||
MIChange change = null;
|
||||
for (int i = 0; i < results.length; i++) {
|
||||
String var = results[i].getVariable();
|
||||
MIValue value = results[i].getMIValue();
|
||||
String str = "";
|
||||
if (value instanceof MIConst) {
|
||||
str = ((MIConst)value).getString();
|
||||
}
|
||||
if (var.equals("name")) {
|
||||
change = new MIChange(str);
|
||||
aList.add(change);
|
||||
} else if (var.equals("in_scope")) {
|
||||
if (change != null) {
|
||||
change.setInScope("true".equals(str));
|
||||
}
|
||||
} else if (var.equals("type_changed")) {
|
||||
if (change != null) {
|
||||
change.setChanged("true".equals(str));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue