1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 18:26:01 +02:00

Adjust to the new CDI interface.

This commit is contained in:
Alain Magloire 2004-09-08 04:16:34 +00:00
parent ead5f8c975
commit 654e6be53f
20 changed files with 397 additions and 298 deletions

View file

@ -11,20 +11,17 @@
package org.eclipse.cdt.debug.mi.core.cdi; package org.eclipse.cdt.debug.mi.core.cdi;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDICatchEvent;
import org.eclipse.cdt.debug.core.cdi.ICDICondition; import org.eclipse.cdt.debug.core.cdi.ICDICondition;
import org.eclipse.cdt.debug.core.cdi.ICDILocation; import org.eclipse.cdt.debug.core.cdi.ICDILocation;
import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager; import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager;
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint; import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
import org.eclipse.cdt.debug.core.cdi.model.ICDICatchpoint; import org.eclipse.cdt.debug.core.cdi.model.ICDIExceptionpoint;
import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint; import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint; import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint;
@ -361,13 +358,6 @@ public class BreakpointManager extends Manager {
} }
} }
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#deleteAllBreakpoints()
*/
public void deleteAllBreakpoints() throws CDIException {
deleteBreakpoints(getBreakpoints());
}
public void deleteAllBreakpoints(Target target) throws CDIException { public void deleteAllBreakpoints(Target target) throws CDIException {
List bList = (List)breakMap.get(target); List bList = (List)breakMap.get(target);
if (bList != null) { if (bList != null) {
@ -383,15 +373,6 @@ public class BreakpointManager extends Manager {
deleteBreakpoints((Target)breakpoint.getTarget(), new ICDIBreakpoint[] { breakpoint }); deleteBreakpoints((Target)breakpoint.getTarget(), new ICDIBreakpoint[] { breakpoint });
} }
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#deleteBreakpoints(ICDIBreakpoint[])
*/
public void deleteBreakpoints(ICDIBreakpoint[] breakpoints) throws CDIException {
for (int i = 0; i < breakpoints.length; ++i) {
deleteBreakpoint(breakpoints[i]);
}
}
public void deleteBreakpoints(Target target, ICDIBreakpoint[] breakpoints) throws CDIException { public void deleteBreakpoints(Target target, ICDIBreakpoint[] breakpoints) throws CDIException {
int[] numbers = new int[breakpoints.length]; int[] numbers = new int[breakpoints.length];
List bList = (List)breakMap.get(target); List bList = (List)breakMap.get(target);
@ -444,17 +425,6 @@ public class BreakpointManager extends Manager {
return EMPTY_BREAKPOINTS; return EMPTY_BREAKPOINTS;
} }
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#getBreakpoints()
*/
public ICDIBreakpoint[] getBreakpoints() throws CDIException {
Collection col = breakMap.values();
Iterator itr = breakMap.values().iterator();
ICDIBreakpoint[] bps = new ICDIBreakpoint[col.size()];
col.toArray(bps);
return bps;
}
public ICDIBreakpoint[] getDeferredBreakpoints(Target target) throws CDIException { public ICDIBreakpoint[] getDeferredBreakpoints(Target target) throws CDIException {
List dlist = (List)deferredMap.get(target); List dlist = (List)deferredMap.get(target);
if (dlist != null) { if (dlist != null) {
@ -465,33 +435,6 @@ public class BreakpointManager extends Manager {
return EMPTY_BREAKPOINTS; return EMPTY_BREAKPOINTS;
} }
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#setCatchpoint(int, ICDICatchEvent, String, ICDICondition, boolean)
*/
public ICDICatchpoint setCatchpoint( int type, ICDICatchEvent event, String expression,
ICDICondition condition) throws CDIException {
throw new CDIException(CdiResources.getString("cdi.BreakpointManager.Not_Supported")); //$NON-NLS-1$
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#setLocationBreakpoint(int, ICDILocation, ICDICondition, boolean, String)
*/
public ICDILocationBreakpoint setLocationBreakpoint(int type, ICDILocation location,
ICDICondition condition, String threadId) throws CDIException {
return setLocationBreakpoint(type, location, condition, threadId, false);
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#setLocationBreakpoint(int, ICDILocation, ICDICondition, boolean, String)
*/
public ICDILocationBreakpoint setLocationBreakpoint(int type, ICDILocation location,
ICDICondition condition, String threadId, boolean deferred) throws CDIException {
Session session = (Session)getSession();
Target target = (Target)session.getCurrentTarget();
return setLocationBreakpoint(target, type, location, condition, threadId, deferred);
}
public ICDILocationBreakpoint setLocationBreakpoint(Target target, int type, ICDILocation location, public ICDILocationBreakpoint setLocationBreakpoint(Target target, int type, ICDILocation location,
ICDICondition condition, String threadId, boolean deferred) throws CDIException { ICDICondition condition, String threadId, boolean deferred) throws CDIException {
@ -598,14 +541,6 @@ public class BreakpointManager extends Manager {
bkpt.setMIBreakpoint(points[0]); bkpt.setMIBreakpoint(points[0]);
} }
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#setWatchpoint(int, int, String, ICDICondition, boolean)
*/
public ICDIWatchpoint setWatchpoint(int type, int watchType, String expression,
ICDICondition condition) throws CDIException {
Target target = (Target)getSession().getCurrentTarget();
return setWatchpoint(target, type, watchType, expression, condition);
}
public ICDIWatchpoint setWatchpoint(Target target, int type, int watchType, String expression, public ICDIWatchpoint setWatchpoint(Target target, int type, int watchType, String expression,
ICDICondition condition) throws CDIException { ICDICondition condition) throws CDIException {
@ -644,6 +579,11 @@ public class BreakpointManager extends Manager {
return bkpt; return bkpt;
} }
public ICDIExceptionpoint setExceptionpoint(Target target, String clazz, boolean stopOnThrow,
boolean stopOnCatch) throws CDIException {
return null;
}
/** /**
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#createCondition(int, String) * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#createCondition(int, String)
*/ */

View file

@ -54,6 +54,7 @@ import org.eclipse.cdt.debug.mi.core.event.MIDestroyedEvent;
import org.eclipse.cdt.debug.mi.core.event.MIDetachedEvent; 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.MIEvent;
import org.eclipse.cdt.debug.mi.core.event.MIGDBExitEvent; import org.eclipse.cdt.debug.mi.core.event.MIGDBExitEvent;
import org.eclipse.cdt.debug.mi.core.event.MIInferiorCreatedEvent;
import org.eclipse.cdt.debug.mi.core.event.MIInferiorExitEvent; 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.MIInferiorSignalExitEvent;
import org.eclipse.cdt.debug.mi.core.event.MIMemoryChangedEvent; import org.eclipse.cdt.debug.mi.core.event.MIMemoryChangedEvent;
@ -163,7 +164,7 @@ public class EventManager extends SessionObject implements ICDIEventManager, Obs
} else if (miEvent instanceof MIGDBExitEvent) { } else if (miEvent instanceof MIGDBExitEvent) {
cdiList.add(new DestroyedEvent(session)); cdiList.add(new DestroyedEvent(session));
} else if (miEvent instanceof MIDetachedEvent) { } else if (miEvent instanceof MIDetachedEvent) {
cdiList.add(new DisconnectedEvent(session)); cdiList.add(new DisconnectedEvent(session, (MIDetachedEvent)miEvent));
} else if (miEvent instanceof MIBreakpointDeletedEvent) { } else if (miEvent instanceof MIBreakpointDeletedEvent) {
MIBreakpointDeletedEvent bpoint = (MIBreakpointDeletedEvent)miEvent; MIBreakpointDeletedEvent bpoint = (MIBreakpointDeletedEvent)miEvent;
if (bpoint.getNumber() > 0) { if (bpoint.getNumber() > 0) {
@ -204,6 +205,8 @@ public class EventManager extends SessionObject implements ICDIEventManager, Obs
cdiList.add(new CreatedEvent(session, (MIMemoryCreatedEvent)miEvent)); cdiList.add(new CreatedEvent(session, (MIMemoryCreatedEvent)miEvent));
} else if (miEvent instanceof MISharedLibCreatedEvent) { } else if (miEvent instanceof MISharedLibCreatedEvent) {
cdiList.add(new CreatedEvent(session, (MISharedLibCreatedEvent)miEvent)); cdiList.add(new CreatedEvent(session, (MISharedLibCreatedEvent)miEvent));
} else if (miEvent instanceof MIInferiorCreatedEvent) {
cdiList.add(new CreatedEvent(session, (MIInferiorCreatedEvent)miEvent));
} }
} }

View file

@ -131,12 +131,11 @@ public class ExpressionManager extends Manager implements ICDIExpressionManager{
public ICDIExpression createExpression(ICDIStackFrame frame, String name) throws CDIException { public ICDIExpression createExpression(ICDIStackFrame frame, String name) throws CDIException {
Expression expression = null; Expression expression = null;
Session session = (Session)getSession(); Session session = (Session)getSession();
ICDITarget currentTarget = session.getCurrentTarget(); Target target = (Target)frame.getTarget();
ICDIThread currentThread = currentTarget.getCurrentThread(); ICDIThread currentThread = target.getCurrentThread();
ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame(); ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame();
frame.getThread().setCurrentStackFrame(frame, false); frame.getThread().setCurrentStackFrame(frame, false);
try { try {
Target target = (Target)frame.getThread().getTarget();
MISession mi = target.getMISession(); MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
MIVarCreate var = factory.createMIVarCreate(name); MIVarCreate var = factory.createMIVarCreate(name);

View file

@ -5,51 +5,104 @@
*/ */
package org.eclipse.cdt.debug.mi.core.cdi; package org.eclipse.cdt.debug.mi.core.cdi;
import java.util.HashMap; import java.util.Vector;
import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
import org.eclipse.cdt.debug.mi.core.event.MIInferiorCreatedEvent;
import org.eclipse.cdt.debug.mi.core.event.MIInferiorExitEvent;
/** /**
*/ */
public class ProcessManager extends Manager { public class ProcessManager extends Manager {
static final Target[] noProcess = new Target[0]; static final Target[] EMPTY_TARGETS = new Target[0];
Vector debugTargetList;
HashMap processMap; Target currentTarget;
class ProcessSet {
Target[] currentProcs;
int currentProcessId;
ProcessSet(Target[] procs, int id) {
currentProcs = procs;
currentProcessId = id;
}
}
public ProcessManager(Session session) { public ProcessManager(Session session) {
super(session, true); super(session, true);
processMap = new HashMap(); debugTargetList = new Vector(1);
} }
/** /**
* @see org.eclipse.cdt.debug.core.cdi.ICDIProcessManager#getProcesses() * @see org.eclipse.cdt.debug.core.cdi.ICDIProcessManager#getProcesses()
*/ */
public Target[] getProcesses(Session session) throws CDIException { public Target[] getTargets() {
ProcessSet set = (ProcessSet)processMap.get(session); return (Target[]) debugTargetList.toArray(new Target[debugTargetList.size()]);
if (set == null) {
set = getProcessSet(session);
processMap.put(session, set);
}
return set.currentProcs;
} }
protected ProcessSet getProcessSet(Session session) throws CDIException { public ICDITarget[] getCDITargets() {
//Target[] cprocs = new Target[] {new Target((Session)session)}; return (ICDITarget[]) debugTargetList.toArray(new ICDITarget[debugTargetList.size()]);
//return new ProcessSet(cprocs, 0); }
public void addTargets(Target[] targets, Target current) {
EventManager eventManager = (EventManager)getSession().getEventManager();
for (int i = 0; i < targets.length; ++i) {
Target target = targets[i];
MISession miSession = target.getMISession();
if (miSession != null) {
miSession.addObserver(eventManager);
miSession.fireEvent(new MIInferiorCreatedEvent(miSession, 0));
if (!debugTargetList.contains(target)) {
debugTargetList.add(target);
}
}
}
if (current != null && debugTargetList.contains(current)) {
currentTarget = current;
}
debugTargetList.trimToSize();
}
public void removeTargets(Target[] targets) {
EventManager eventManager = (EventManager)getSession().getEventManager();
for (int i = 0; i < targets.length; ++i) {
Target target = targets[i];
MISession miSession = target.getMISession();
if (miSession != null) {
miSession.notifyObservers(new MIInferiorExitEvent(miSession, 0));
miSession.deleteObserver(eventManager);
}
if (currentTarget != null && currentTarget.equals(target)) {
currentTarget = null;
}
debugTargetList.remove(target);
}
debugTargetList.trimToSize();
}
public Target getTarget(MISession miSession) {
synchronized(debugTargetList) {
for (int i = 0; i < debugTargetList.size(); ++i) {
Target target = (Target)debugTargetList.get(i);
MISession mi = target.getMISession();
if (mi.equals(miSession)) {
return target;
}
}
}
// ASSERT: it should not happen.
return null; return null;
} }
/**
* @deprecated
* @return
*/
public Target getCurrentTarget() {
return currentTarget;
}
/**
* @deprecated
* @param current
*/
public void setCurrentTarget(Target current) {
currentTarget = current;
}
/** /**
* @deprecated * @deprecated
* @see org.eclipse.cdt.derug.core.cdi.ICDIManager#update() * @see org.eclipse.cdt.derug.core.cdi.ICDIManager#update()

View file

@ -11,8 +11,6 @@
package org.eclipse.cdt.debug.mi.core.cdi; package org.eclipse.cdt.debug.mi.core.cdi;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Properties; import java.util.Properties;
import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.CDIException;
@ -42,6 +40,7 @@ public class Session implements ICDISession, ICDISessionObject {
public final static Target[] EMPTY_TARGETS = {}; public final static Target[] EMPTY_TARGETS = {};
Properties props; Properties props;
ProcessManager processManager;
EventManager eventManager; EventManager eventManager;
BreakpointManager breakpointManager; BreakpointManager breakpointManager;
ExpressionManager expressionManager; ExpressionManager expressionManager;
@ -52,8 +51,6 @@ public class Session implements ICDISession, ICDISessionObject {
SignalManager signalManager; SignalManager signalManager;
SourceManager sourceManager; SourceManager sourceManager;
ICDIConfiguration configuration; ICDIConfiguration configuration;
Target[] debugTargets = EMPTY_TARGETS;
Target currentTarget;
public Session(MISession miSession, boolean attach) { public Session(MISession miSession, boolean attach) {
commonSetup(); commonSetup();
@ -79,6 +76,7 @@ public class Session implements ICDISession, ICDISessionObject {
private void commonSetup() { private void commonSetup() {
props = new Properties(); props = new Properties();
processManager = new ProcessManager(this);
breakpointManager = new BreakpointManager(this); breakpointManager = new BreakpointManager(this);
eventManager = new EventManager(this); eventManager = new EventManager(this);
expressionManager = new ExpressionManager(this); expressionManager = new ExpressionManager(this);
@ -91,44 +89,27 @@ public class Session implements ICDISession, ICDISessionObject {
} }
public void addTargets(Target[] targets, Target current) { public void addTargets(Target[] targets, Target current) {
Target[] newTargets = new Target[debugTargets.length + targets.length]; ProcessManager pMgr = getProcessManager();
System.arraycopy(debugTargets, 0, newTargets, 0, debugTargets.length); pMgr.addTargets(targets, current);
System.arraycopy(targets, 0, newTargets, debugTargets.length, targets.length);
if (current != null) {
currentTarget = current;
}
for (int i = 0; i < targets.length; ++i) {
MISession miSession = targets[i].getMISession();
if (miSession != null) {
miSession.addObserver((EventManager)getEventManager());
}
}
} }
public void removeTargets(Target[] targets) { public void removeTargets(Target[] targets) {
ArrayList list = new ArrayList(Arrays.asList(debugTargets)); ProcessManager pMgr = getProcessManager();
for (int i = 0; i < targets.length; ++i) { pMgr.removeTargets(targets);
MISession miSession = targets[i].getMISession();
if (miSession != null) {
miSession.deleteObserver((EventManager)getEventManager());
}
if (currentTarget != null && currentTarget.equals(targets[i])) {
currentTarget = null;
}
list.remove(targets[i]);
}
debugTargets = (Target[]) list.toArray(new Target[list.size()]);
} }
public Target getTarget(MISession miSession) { public Target getTarget(MISession miSession) {
for (int i = 0; i < debugTargets.length; ++i) { ProcessManager pMgr = getProcessManager();
MISession mi = debugTargets[i].getMISession(); return pMgr.getTarget(miSession);
if (mi.equals(miSession)) { }
return debugTargets[i];
} /**
} * @deprecated
// ASSERT: it should not happen. * @see org.eclipse.cdt.debug.core.cdi.ICDISession#getCurrentTarget()
return null; */
public ICDITarget getCurrentTarget() {
ProcessManager pMgr = getProcessManager();
return pMgr.getCurrentTarget();
} }
/** /**
@ -138,6 +119,10 @@ public class Session implements ICDISession, ICDISessionObject {
return props.getProperty(key); return props.getProperty(key);
} }
public ProcessManager getProcessManager() {
return processManager;
}
/** /**
* @see org.eclipse.cdt.debug.core.cdi.ICDISession#getBreakpointManager() * @see org.eclipse.cdt.debug.core.cdi.ICDISession#getBreakpointManager()
*/ */
@ -205,22 +190,17 @@ public class Session implements ICDISession, ICDISessionObject {
* @see org.eclipse.cdt.debug.core.cdi.ICDISession#getTargets() * @see org.eclipse.cdt.debug.core.cdi.ICDISession#getTargets()
*/ */
public ICDITarget[] getTargets() { public ICDITarget[] getTargets() {
return debugTargets; ProcessManager pMgr = getProcessManager();
} return pMgr.getCDITargets();
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDISession#getCurrentTarget()
*/
public ICDITarget getCurrentTarget() {
return currentTarget;
} }
/** /**
* @see org.eclipse.cdt.debug.core.cdi.ICDISession#setCurrentTarget() * @see org.eclipse.cdt.debug.core.cdi.ICDISession#setCurrentTarget()
*/ */
public void setCurrentTarget(ICDITarget target) throws CDIException { public void setCurrentTarget(ICDITarget target) throws CDIException {
ProcessManager pMgr = getProcessManager();
if (target instanceof Target) { if (target instanceof Target) {
currentTarget = (Target)target; pMgr.setCurrentTarget((Target)target);
} else { } else {
throw new CDIException(CdiResources.getString("cdi.Session.Unknown_target")); //$NON-NLS-1$ throw new CDIException(CdiResources.getString("cdi.Session.Unknown_target")); //$NON-NLS-1$
} }
@ -262,8 +242,10 @@ public class Session implements ICDISession, ICDISessionObject {
* @see org.eclipse.cdt.debug.core.cdi.ICDISession#terminate(ICDITarget) * @see org.eclipse.cdt.debug.core.cdi.ICDISession#terminate(ICDITarget)
*/ */
public void terminate() throws CDIException { public void terminate() throws CDIException {
for (int i = 0; i < debugTargets.length; ++i) { ProcessManager pMgr = getProcessManager();
debugTargets[i].terminate(); Target[] targets = pMgr.getTargets();
for (int i = 0; i < targets.length; ++i) {
targets[i].terminate();
} }
//TODO: the ExitEvent is sent by MISession.terminate() //TODO: the ExitEvent is sent by MISession.terminate()
// We nee move it here. // We nee move it here.
@ -281,7 +263,7 @@ public class Session implements ICDISession, ICDISessionObject {
* @see org.eclipse.cdt.debug.core.cdi.ICDISession#addSearchPaths(String[]) * @see org.eclipse.cdt.debug.core.cdi.ICDISession#addSearchPaths(String[])
*/ */
public void addSearchPaths(String[] dirs) throws CDIException { public void addSearchPaths(String[] dirs) throws CDIException {
addSearchPaths(currentTarget, dirs); addSearchPaths(getCurrentTarget(), dirs);
} }
/** /**
* @see org.eclipse.cdt.debug.core.cdi.ICDISession#addSearchPaths(String[]) * @see org.eclipse.cdt.debug.core.cdi.ICDISession#addSearchPaths(String[])
@ -303,7 +285,7 @@ public class Session implements ICDISession, ICDISessionObject {
* @see org.eclipse.cdt.debug.core.cdi.ICDISession#getSessionProcess() * @see org.eclipse.cdt.debug.core.cdi.ICDISession#getSessionProcess()
*/ */
public Process getSessionProcess() throws CDIException { public Process getSessionProcess() throws CDIException {
return getSessionProcess(currentTarget); return getSessionProcess(getCurrentTarget());
} }
/** /**

View file

@ -21,7 +21,6 @@ import org.eclipse.cdt.debug.core.cdi.ICDIVariableManager;
import org.eclipse.cdt.debug.core.cdi.model.ICDIArgument; import org.eclipse.cdt.debug.core.cdi.model.ICDIArgument;
import org.eclipse.cdt.debug.core.cdi.model.ICDIArgumentObject; import org.eclipse.cdt.debug.core.cdi.model.ICDIArgumentObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame; import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread; import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject; import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject;
@ -29,6 +28,7 @@ import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MISession; import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.model.Argument; import org.eclipse.cdt.debug.mi.core.cdi.model.Argument;
import org.eclipse.cdt.debug.mi.core.cdi.model.ArgumentObject; import org.eclipse.cdt.debug.mi.core.cdi.model.ArgumentObject;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; import org.eclipse.cdt.debug.mi.core.cdi.model.Variable;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject; import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
@ -148,9 +148,14 @@ public class VariableManager extends Manager implements ICDIVariableManager {
/** /**
* Check the type * Check the type
*/ */
public void checkType(MISession miSession, String type) throws CDIException { public void checkType(StackFrame frame, String type) throws CDIException {
if (type != null && type.length() > 0) { if (type != null && type.length() > 0) {
Target target = (Target)frame.getTarget();
ICDIThread currentThread = target.getCurrentThread();
ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame();
frame.getThread().setCurrentStackFrame(frame, false);
try { try {
MISession miSession = target.getMISession();
CommandFactory factory = miSession.getCommandFactory(); CommandFactory factory = miSession.getCommandFactory();
MIPType ptype = factory.createMIPType(type); MIPType ptype = factory.createMIPType(type);
miSession.postCommand(ptype); miSession.postCommand(ptype);
@ -160,6 +165,8 @@ public class VariableManager extends Manager implements ICDIVariableManager {
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
} finally {
currentThread.setCurrentStackFrame(currentFrame, false);
} }
} else { } else {
throw new CDIException(CdiResources.getString("cdi.VariableManager.Unknown_type")); //$NON-NLS-1$ throw new CDIException(CdiResources.getString("cdi.VariableManager.Unknown_type")); //$NON-NLS-1$
@ -222,14 +229,13 @@ public class VariableManager extends Manager implements ICDIVariableManager {
Session session = (Session) getSession(); Session session = (Session) getSession();
ICDIThread currentThread = null; ICDIThread currentThread = null;
ICDIStackFrame currentFrame = null; ICDIStackFrame currentFrame = null;
Target target = (Target)argObj.getTarget();
if (stack != null) { if (stack != null) {
ICDITarget currentTarget = session.getCurrentTarget(); currentThread = target.getCurrentThread();
currentThread = currentTarget.getCurrentThread();
currentFrame = currentThread.getCurrentStackFrame(); currentFrame = currentThread.getCurrentStackFrame();
stack.getThread().setCurrentStackFrame(stack, false); stack.getThread().setCurrentStackFrame(stack, false);
} }
try { try {
Target target = (Target)argObj.getTarget();
MISession mi = target.getMISession(); MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
MIVarCreate var = factory.createMIVarCreate(name); MIVarCreate var = factory.createMIVarCreate(name);
@ -260,12 +266,11 @@ public class VariableManager extends Manager implements ICDIVariableManager {
public ICDIArgumentObject[] getArgumentObjects(ICDIStackFrame frame) throws CDIException { public ICDIArgumentObject[] getArgumentObjects(ICDIStackFrame frame) throws CDIException {
List argObjects = new ArrayList(); List argObjects = new ArrayList();
Session session = (Session) getSession(); Session session = (Session) getSession();
ICDITarget currentTarget = session.getCurrentTarget(); Target target = (Target)frame.getTarget();
ICDIThread currentThread = currentTarget.getCurrentThread(); ICDIThread currentThread = target.getCurrentThread();
ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame(); ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame();
frame.getThread().setCurrentStackFrame(frame, false); frame.getThread().setCurrentStackFrame(frame, false);
try { try {
Target target = (Target)frame.getTarget();
MISession mi = target.getMISession(); MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
int depth = frame.getThread().getStackFrameCount(); int depth = frame.getThread().getStackFrameCount();
@ -361,7 +366,7 @@ public class VariableManager extends Manager implements ICDIVariableManager {
if (obj != null) { if (obj != null) {
// throw an exception if not a good type. // throw an exception if not a good type.
Target target = (Target)obj.getTarget(); Target target = (Target)obj.getTarget();
checkType(target.getMISession(), type); checkType((StackFrame)obj.getStackFrame(), type);
VariableObject vo = VariableObject vo =
new VariableObject( new VariableObject(
target, target,
@ -386,12 +391,11 @@ public class VariableManager extends Manager implements ICDIVariableManager {
public ICDIVariableObject[] getLocalVariableObjects(ICDIStackFrame frame) throws CDIException { public ICDIVariableObject[] getLocalVariableObjects(ICDIStackFrame frame) throws CDIException {
List varObjects = new ArrayList(); List varObjects = new ArrayList();
Session session = (Session) getSession(); Session session = (Session) getSession();
ICDITarget currentTarget = session.getCurrentTarget(); Target target = (Target)frame.getTarget();
ICDIThread currentThread = currentTarget.getCurrentThread(); ICDIThread currentThread = target.getCurrentThread();
ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame(); ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame();
frame.getThread().setCurrentStackFrame(frame, false); frame.getThread().setCurrentStackFrame(frame, false);
try { try {
Target target = (Target)frame.getTarget();
MISession mi = target.getMISession(); MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
int level = frame.getLevel(); int level = frame.getLevel();
@ -445,14 +449,13 @@ public class VariableManager extends Manager implements ICDIVariableManager {
ICDIStackFrame stack = varObj.getStackFrame(); ICDIStackFrame stack = varObj.getStackFrame();
ICDIThread currentThread = null; ICDIThread currentThread = null;
ICDIStackFrame currentFrame = null; ICDIStackFrame currentFrame = null;
Target target = (Target)varObj.getTarget();
if (stack != null) { if (stack != null) {
ICDITarget currentTarget = session.getCurrentTarget(); currentThread = target.getCurrentThread();
currentThread = currentTarget.getCurrentThread();
currentFrame = currentThread.getCurrentStackFrame(); currentFrame = currentThread.getCurrentStackFrame();
stack.getThread().setCurrentStackFrame(stack, false); stack.getThread().setCurrentStackFrame(stack, false);
} }
try { try {
Target target = (Target)varObj.getTarget();
MISession mi = target.getMISession(); MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
MIVarCreate var = factory.createMIVarCreate(name); MIVarCreate var = factory.createMIVarCreate(name);

View file

@ -15,6 +15,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary; import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary;
import org.eclipse.cdt.debug.core.cdi.model.ICDISignal; import org.eclipse.cdt.debug.core.cdi.model.ICDISignal;
import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.BreakpointManager; import org.eclipse.cdt.debug.mi.core.cdi.BreakpointManager;
import org.eclipse.cdt.debug.mi.core.cdi.ExpressionManager; import org.eclipse.cdt.debug.mi.core.cdi.ExpressionManager;
import org.eclipse.cdt.debug.mi.core.cdi.RegisterManager; import org.eclipse.cdt.debug.mi.core.cdi.RegisterManager;
@ -43,69 +44,79 @@ public class ChangedEvent implements ICDIChangedEvent {
// Try the Variable manager. // Try the Variable manager.
VariableManager mgr = (VariableManager)session.getVariableManager(); VariableManager mgr = (VariableManager)session.getVariableManager();
String varName = var.getVarName(); String varName = var.getVarName();
source = mgr.getVariable(var.getMISession(), varName); MISession miSession = var.getMISession();
source = mgr.getVariable(miSession, varName);
// Try the Expression manager // Try the Expression manager
if (source == null) { if (source == null) {
ExpressionManager expMgr = (ExpressionManager)session.getExpressionManager(); ExpressionManager expMgr = (ExpressionManager)session.getExpressionManager();
source = expMgr.getExpression(var.getMISession(), varName); source = expMgr.getExpression(miSession, varName);
} }
// Try the Register manager // Try the Register manager
if (source == null) { if (source == null) {
RegisterManager regMgr = (RegisterManager)session.getRegisterManager(); RegisterManager regMgr = (RegisterManager)session.getRegisterManager();
source = regMgr.getRegister(var.getMISession(), varName); source = regMgr.getRegister(miSession, varName);
} }
// Fall back // Fall back
if (source == null) { if (source == null) {
source = new CObject((Target)session.getCurrentTarget()); Target target = session.getTarget(miSession);
source = new CObject(target);
} }
} }
public ChangedEvent(Session s, MIRegisterChangedEvent var) { public ChangedEvent(Session s, MIRegisterChangedEvent reg) {
session = s; session = s;
RegisterManager mgr = (RegisterManager)session.getRegisterManager(); RegisterManager mgr = (RegisterManager)session.getRegisterManager();
int regno = var.getNumber(); MISession miSession = reg.getMISession();
source = mgr.getRegister(var.getMISession(), regno); int regno = reg.getNumber();
source = mgr.getRegister(miSession, regno);
if (source == null) { if (source == null) {
source = new CObject((Target)session.getCurrentTarget()); Target target = session.getTarget(miSession);
source = new CObject(target);
} }
} }
public ChangedEvent(Session s, MIBreakpointChangedEvent bpoint) { public ChangedEvent(Session s, MIBreakpointChangedEvent bpoint) {
session = s; session = s;
BreakpointManager mgr = (BreakpointManager)session.getBreakpointManager(); BreakpointManager mgr = session.getBreakpointManager();
MISession miSession = bpoint.getMISession();
int number = bpoint.getNumber(); int number = bpoint.getNumber();
ICDIBreakpoint breakpoint = mgr.getBreakpoint(bpoint.getMISession(), number); ICDIBreakpoint breakpoint = mgr.getBreakpoint(miSession, number);
if (breakpoint != null) { if (breakpoint != null) {
source = breakpoint; source = breakpoint;
} else { } else {
source = new CObject((Target)session.getCurrentTarget()); Target target = session.getTarget(miSession);
source = new CObject(target);
} }
} }
public ChangedEvent(Session s, MISharedLibChangedEvent slib) { public ChangedEvent(Session s, MISharedLibChangedEvent slib) {
session = s; session = s;
SharedLibraryManager mgr = (SharedLibraryManager)session.getSharedLibraryManager(); SharedLibraryManager mgr = (SharedLibraryManager)session.getSharedLibraryManager();
MISession miSession = slib.getMISession();
String name = slib.getName(); String name = slib.getName();
ICDISharedLibrary lib = mgr.getSharedLibrary(slib.getMISession(), name); ICDISharedLibrary lib = mgr.getSharedLibrary(miSession, name);
if (lib != null) { if (lib != null) {
source = lib; source = lib;
} else { } else {
source = new CObject((Target)session.getCurrentTarget()); Target target = session.getTarget(miSession);
source = new CObject(target);
} }
} }
public ChangedEvent(Session s, MISignalChangedEvent sig) { public ChangedEvent(Session s, MISignalChangedEvent sig) {
session = s; session = s;
SignalManager mgr = (SignalManager)session.getSignalManager(); SignalManager mgr = (SignalManager)session.getSignalManager();
MISession miSession = sig.getMISession();
String name = sig.getName(); String name = sig.getName();
ICDISignal signal = mgr.getSignal(sig.getMISession(), name); ICDISignal signal = mgr.getSignal(miSession, name);
if (signal != null) { if (signal != null) {
source = signal; source = signal;
} else { } else {
source = new CObject((Target)session.getCurrentTarget()); Target target = session.getTarget(miSession);
source = new CObject(target);
} }
} }

View file

@ -13,6 +13,7 @@ package org.eclipse.cdt.debug.mi.core.cdi.event;
import org.eclipse.cdt.debug.core.cdi.event.ICDICreatedEvent; import org.eclipse.cdt.debug.core.cdi.event.ICDICreatedEvent;
import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock; import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock;
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.BreakpointManager; import org.eclipse.cdt.debug.mi.core.cdi.BreakpointManager;
import org.eclipse.cdt.debug.mi.core.cdi.MemoryManager; import org.eclipse.cdt.debug.mi.core.cdi.MemoryManager;
import org.eclipse.cdt.debug.mi.core.cdi.RegisterManager; import org.eclipse.cdt.debug.mi.core.cdi.RegisterManager;
@ -22,6 +23,7 @@ import org.eclipse.cdt.debug.mi.core.cdi.VariableManager;
import org.eclipse.cdt.debug.mi.core.cdi.model.CObject; import org.eclipse.cdt.debug.mi.core.cdi.model.CObject;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointCreatedEvent; import org.eclipse.cdt.debug.mi.core.event.MIBreakpointCreatedEvent;
import org.eclipse.cdt.debug.mi.core.event.MIInferiorCreatedEvent;
import org.eclipse.cdt.debug.mi.core.event.MIMemoryCreatedEvent; import org.eclipse.cdt.debug.mi.core.event.MIMemoryCreatedEvent;
import org.eclipse.cdt.debug.mi.core.event.MIRegisterCreatedEvent; import org.eclipse.cdt.debug.mi.core.event.MIRegisterCreatedEvent;
import org.eclipse.cdt.debug.mi.core.event.MISharedLibCreatedEvent; import org.eclipse.cdt.debug.mi.core.event.MISharedLibCreatedEvent;
@ -37,47 +39,61 @@ public class CreatedEvent implements ICDICreatedEvent {
public CreatedEvent(Session s, MIBreakpointCreatedEvent bpoint) { public CreatedEvent(Session s, MIBreakpointCreatedEvent bpoint) {
session = s; session = s;
BreakpointManager mgr = (BreakpointManager)session.getBreakpointManager(); BreakpointManager mgr = session.getBreakpointManager();
MISession miSession = bpoint.getMISession();
int number = bpoint.getNumber(); int number = bpoint.getNumber();
source = mgr.getBreakpoint(bpoint.getMISession(), number); source = mgr.getBreakpoint(miSession, number);
if (source == null) { if (source == null) {
source = new CObject((Target)session.getCurrentTarget()); Target target = session.getTarget(miSession);
source = new CObject(target);
} }
} }
public CreatedEvent(Session s, MIVarCreatedEvent var) { public CreatedEvent(Session s, MIVarCreatedEvent var) {
session = s; session = s;
VariableManager mgr = (VariableManager)session.getVariableManager(); VariableManager mgr = (VariableManager)session.getVariableManager();
MISession miSession = var.getMISession();
String varName = var.getVarName(); String varName = var.getVarName();
source = mgr.getVariable(var.getMISession(), varName); source = mgr.getVariable(miSession, varName);
if (source == null) { if (source == null) {
source = new CObject((Target)session.getCurrentTarget()); Target target = session.getTarget(miSession);
source = new CObject(target);
} }
} }
public CreatedEvent(Session s, MIRegisterCreatedEvent var) { public CreatedEvent(Session s, MIRegisterCreatedEvent reg) {
session = s; session = s;
RegisterManager mgr = (RegisterManager)session.getRegisterManager(); RegisterManager mgr = (RegisterManager)session.getRegisterManager();
int regno = var.getNumber(); MISession miSession = reg.getMISession();
source = mgr.getRegister(var.getMISession(), regno); int regno = reg.getNumber();
source = mgr.getRegister(miSession, regno);
if (source == null) { if (source == null) {
source = new CObject((Target)session.getCurrentTarget()); Target target = session.getTarget(miSession);
source = new CObject(target);
} }
} }
public CreatedEvent(Session s, MIThreadCreatedEvent ethread) { public CreatedEvent(Session s, MIThreadCreatedEvent cthread) {
session = s; session = s;
Target target = (Target)session.getCurrentTarget(); MISession miSession = cthread.getMISession();
source = target.getThread(ethread.getId()); Target target = session.getTarget(miSession);
source = target.getThread(cthread.getId());
if (source == null) { if (source == null) {
source = new CObject((Target)session.getCurrentTarget()); source = new CObject(target);
} }
} }
public CreatedEvent(Session s, MIInferiorCreatedEvent inferior) {
session = s;
MISession miSession = inferior.getMISession();
source = session.getTarget(miSession);
}
public CreatedEvent(Session s, MIMemoryCreatedEvent mblock) { public CreatedEvent(Session s, MIMemoryCreatedEvent mblock) {
session = s; session = s;
MemoryManager mgr = (MemoryManager)session.getMemoryManager(); MemoryManager mgr = (MemoryManager)session.getMemoryManager();
ICDIMemoryBlock[] blocks = mgr.getMemoryBlocks(mblock.getMISession()); MISession miSession = mblock.getMISession();
ICDIMemoryBlock[] blocks = mgr.getMemoryBlocks(miSession);
for (int i = 0; i < blocks.length; i++) { for (int i = 0; i < blocks.length; i++) {
if (blocks[i].getStartAddress() == mblock.getAddress() && if (blocks[i].getStartAddress() == mblock.getAddress() &&
blocks[i].getLength() == mblock.getLength()) { blocks[i].getLength() == mblock.getLength()) {
@ -86,17 +102,20 @@ public class CreatedEvent implements ICDICreatedEvent {
} }
} }
if (source == null) { if (source == null) {
source = new CObject((Target)session.getCurrentTarget()); Target target = session.getTarget(miSession);
source = new CObject(target);
} }
} }
public CreatedEvent(Session s, MISharedLibCreatedEvent slib) { public CreatedEvent(Session s, MISharedLibCreatedEvent slib) {
session = s; session = s;
SharedLibraryManager mgr = (SharedLibraryManager)session.getSharedLibraryManager(); SharedLibraryManager mgr = (SharedLibraryManager)session.getSharedLibraryManager();
MISession miSession = slib.getMISession();
String name = slib.getName(); String name = slib.getName();
source = mgr.getSharedLibrary(slib.getMISession(), name); source = mgr.getSharedLibrary(miSession, name);
if (source == null) { if (source == null) {
source = new CObject((Target)session.getCurrentTarget()); Target target = session.getTarget(miSession);
source = new CObject(target);
} }
} }

View file

@ -14,6 +14,7 @@ import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.event.ICDIDestroyedEvent; import org.eclipse.cdt.debug.core.cdi.event.ICDIDestroyedEvent;
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary; import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary;
import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.BreakpointManager; import org.eclipse.cdt.debug.mi.core.cdi.BreakpointManager;
import org.eclipse.cdt.debug.mi.core.cdi.ExpressionManager; import org.eclipse.cdt.debug.mi.core.cdi.ExpressionManager;
import org.eclipse.cdt.debug.mi.core.cdi.Session; import org.eclipse.cdt.debug.mi.core.cdi.Session;
@ -36,60 +37,67 @@ public class DestroyedEvent implements ICDIDestroyedEvent {
Session session; Session session;
ICDIObject source; ICDIObject source;
public DestroyedEvent(Session s, MIThreadExitEvent ethread) { public DestroyedEvent(Session s, MIThreadExitEvent cthread) {
session = s; session = s;
source = new Thread((Target)session.getCurrentTarget(), ethread.getId()); Target target = session.getTarget(cthread.getMISession());
source = new Thread(target, cthread.getId());
} }
public DestroyedEvent(Session s, MIVarDeletedEvent var) { public DestroyedEvent(Session s, MIVarDeletedEvent var) {
session = s; session = s;
VariableManager varMgr = (VariableManager)session.getVariableManager(); VariableManager varMgr = (VariableManager)session.getVariableManager();
MISession miSession = var.getMISession();
String varName = var.getVarName(); String varName = var.getVarName();
Variable variable = varMgr.getVariable(var.getMISession(), varName); Variable variable = varMgr.getVariable(miSession, varName);
if (variable!= null) { if (variable!= null) {
source = variable; source = variable;
try { try {
varMgr.removeVariable(var.getMISession(), variable.getMIVar().getVarName()); varMgr.removeVariable(miSession, variable.getMIVar().getVarName());
} catch (CDIException e) { } catch (CDIException e) {
} }
} else { } else {
ExpressionManager expMgr = (ExpressionManager)session.getExpressionManager(); ExpressionManager expMgr = (ExpressionManager)session.getExpressionManager();
variable = expMgr.getExpression(var.getMISession(), varName); variable = expMgr.getExpression(miSession, varName);
if (variable != null) { if (variable != null) {
source = variable; source = variable;
try { try {
expMgr.removeExpression(var.getMISession(), variable.getMIVar().getVarName()); expMgr.removeExpression(miSession, variable.getMIVar().getVarName());
} catch (CDIException e) { } catch (CDIException e) {
} }
} else { } else {
source = new CObject((Target)session.getCurrentTarget()); Target target = session.getTarget(miSession);
source = new CObject(target);
} }
} }
} }
public DestroyedEvent(Session s, MIBreakpointDeletedEvent bpoint) { public DestroyedEvent(Session s, MIBreakpointDeletedEvent bpoint) {
session = s; session = s;
BreakpointManager mgr = (BreakpointManager)session.getBreakpointManager(); BreakpointManager mgr = session.getBreakpointManager();
MISession miSession = bpoint.getMISession();
int number = bpoint.getNumber(); int number = bpoint.getNumber();
Breakpoint breakpoint = mgr.getBreakpoint(bpoint.getMISession(), number); Breakpoint breakpoint = mgr.getBreakpoint(miSession, number);
if (breakpoint != null) { if (breakpoint != null) {
source = breakpoint; source = breakpoint;
mgr.deleteBreakpoint(bpoint.getMISession(), number); mgr.deleteBreakpoint(miSession, number);
} else { } else {
source = new CObject((Target)session.getCurrentTarget()); Target target = session.getTarget(miSession);
source = new CObject(target);
} }
} }
public DestroyedEvent(Session s, MISharedLibUnloadedEvent slib) { public DestroyedEvent(Session s, MISharedLibUnloadedEvent slib) {
session = s; session = s;
SharedLibraryManager mgr = (SharedLibraryManager)session.getSharedLibraryManager(); SharedLibraryManager mgr = (SharedLibraryManager)session.getSharedLibraryManager();
MISession miSession = slib.getMISession();
String name = slib.getName(); String name = slib.getName();
ICDISharedLibrary lib = mgr.getSharedLibrary(slib.getMISession(), name); ICDISharedLibrary lib = mgr.getSharedLibrary(miSession, name);
if (lib != null) { if (lib != null) {
mgr.deleteSharedLibrary(slib.getMISession(), lib); mgr.deleteSharedLibrary(miSession, lib);
source = lib; source = lib;
} else { } else {
source = new CObject((Target)session.getCurrentTarget()); Target target = session.getTarget(miSession);
source = new CObject(target);
} }
} }

View file

@ -14,6 +14,8 @@ package org.eclipse.cdt.debug.mi.core.cdi.event;
import org.eclipse.cdt.debug.core.cdi.event.ICDIDisconnectedEvent; import org.eclipse.cdt.debug.core.cdi.event.ICDIDisconnectedEvent;
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
import org.eclipse.cdt.debug.mi.core.cdi.Session; import org.eclipse.cdt.debug.mi.core.cdi.Session;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
import org.eclipse.cdt.debug.mi.core.event.MIDetachedEvent;
/** /**
*/ */
@ -21,8 +23,9 @@ public class DisconnectedEvent implements ICDIDisconnectedEvent {
ICDIObject source; ICDIObject source;
public DisconnectedEvent(Session session) { public DisconnectedEvent(Session session, MIDetachedEvent detach) {
source = session.getCurrentTarget(); Target target = session.getTarget(detach.getMISession());
source = target;
} }
/** /**

View file

@ -16,6 +16,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
import org.eclipse.cdt.debug.mi.core.cdi.ExitInfo; import org.eclipse.cdt.debug.mi.core.cdi.ExitInfo;
import org.eclipse.cdt.debug.mi.core.cdi.Session; import org.eclipse.cdt.debug.mi.core.cdi.Session;
import org.eclipse.cdt.debug.mi.core.cdi.SignalExitInfo; import org.eclipse.cdt.debug.mi.core.cdi.SignalExitInfo;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
import org.eclipse.cdt.debug.mi.core.event.MIEvent; import org.eclipse.cdt.debug.mi.core.event.MIEvent;
import org.eclipse.cdt.debug.mi.core.event.MIInferiorExitEvent; 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.MIInferiorSignalExitEvent;
@ -53,7 +54,8 @@ public class ExitedEvent implements ICDIExitedEvent {
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEvent#getSource() * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEvent#getSource()
*/ */
public ICDIObject getSource() { public ICDIObject getSource() {
return session.getCurrentTarget(); Target target = session.getTarget(event.getMISession());
return target;
} }
} }

View file

@ -13,6 +13,7 @@ package org.eclipse.cdt.debug.mi.core.cdi.event;
import org.eclipse.cdt.debug.core.cdi.event.ICDIResumedEvent; import org.eclipse.cdt.debug.core.cdi.event.ICDIResumedEvent;
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
import org.eclipse.cdt.debug.mi.core.cdi.Session; import org.eclipse.cdt.debug.mi.core.cdi.Session;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
import org.eclipse.cdt.debug.mi.core.event.MIRunningEvent; import org.eclipse.cdt.debug.mi.core.event.MIRunningEvent;
/** /**
@ -31,7 +32,12 @@ public class ResumedEvent implements ICDIResumedEvent {
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEvent#getSource() * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEvent#getSource()
*/ */
public ICDIObject getSource() { public ICDIObject getSource() {
return session.getCurrentTarget(); // We can send the target as the Source. CDI
// Will assume that all threads are supended for this.
// This is true for gdb when it suspend the inferior
// all threads are suspended.
Target target = session.getTarget(event.getMISession());
return target;
} }
/** /**

View file

@ -13,7 +13,6 @@ package org.eclipse.cdt.debug.mi.core.cdi.event;
import org.eclipse.cdt.debug.core.cdi.ICDISessionObject; import org.eclipse.cdt.debug.core.cdi.ICDISessionObject;
import org.eclipse.cdt.debug.core.cdi.event.ICDISuspendedEvent; import org.eclipse.cdt.debug.core.cdi.event.ICDISuspendedEvent;
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.mi.core.cdi.BreakpointHit; import org.eclipse.cdt.debug.mi.core.cdi.BreakpointHit;
import org.eclipse.cdt.debug.mi.core.cdi.EndSteppingRange; import org.eclipse.cdt.debug.mi.core.cdi.EndSteppingRange;
import org.eclipse.cdt.debug.mi.core.cdi.ErrorInfo; import org.eclipse.cdt.debug.mi.core.cdi.ErrorInfo;
@ -22,6 +21,7 @@ import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryEvent;
import org.eclipse.cdt.debug.mi.core.cdi.SignalReceived; import org.eclipse.cdt.debug.mi.core.cdi.SignalReceived;
import org.eclipse.cdt.debug.mi.core.cdi.WatchpointScope; import org.eclipse.cdt.debug.mi.core.cdi.WatchpointScope;
import org.eclipse.cdt.debug.mi.core.cdi.WatchpointTrigger; import org.eclipse.cdt.debug.mi.core.cdi.WatchpointTrigger;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointHitEvent; 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.MIErrorEvent;
import org.eclipse.cdt.debug.mi.core.event.MIEvent; import org.eclipse.cdt.debug.mi.core.event.MIEvent;
@ -73,7 +73,7 @@ public class SuspendedEvent implements ICDISuspendedEvent {
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEvent#getSource() * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEvent#getSource()
*/ */
public ICDIObject getSource() { public ICDIObject getSource() {
ICDITarget target = session.getCurrentTarget(); Target target = session.getTarget(event.getMISession());
// We can send the target as the Source. CDI // We can send the target as the Source. CDI
// Will assume that all threads are supended for this. // Will assume that all threads are supended for this.
// This is true for gdb when it suspend the inferior // This is true for gdb when it suspend the inferior

View file

@ -1,32 +0,0 @@
/*******************************************************************************
* Copyright (c) 2000, 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.debug.mi.core.cdi.model;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDICatchEvent;
import org.eclipse.cdt.debug.core.cdi.model.ICDICatchpoint;
import org.eclipse.cdt.debug.mi.core.output.MIBreakpoint;
/**
*/
public class Catchpoint extends Breakpoint implements ICDICatchpoint {
public Catchpoint(Target target, MIBreakpoint miBreak) {
super(target, miBreak);
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDICatchpoint#getEvent()
*/
public ICDICatchEvent getEvent() throws CDIException {
return null;
}
}

View file

@ -0,0 +1,62 @@
/**********************************************************************
* Copyright (c) 2002,2003,2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.debug.mi.core.cdi.model;
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
import org.eclipse.cdt.debug.core.cdi.model.ICDIExceptionpoint;
import org.eclipse.cdt.debug.mi.core.output.MIBreakpoint;
/**
* Exceptionpoint
*/
public class Exceptionpoint extends Breakpoint implements ICDIExceptionpoint {
String fClazz;
boolean fStopOnThrow;
boolean fStopOnCatch;
/**
*/
public Exceptionpoint(Target target, String name, boolean stopOnThrow, boolean stopOnCatch) {
super(target, ICDIBreakpoint.REGULAR, null, null, null);
fClazz = name;
fStopOnThrow = stopOnThrow;
fStopOnCatch = stopOnCatch;
}
public String getExceptionName() {
return fClazz;
}
/**
* @param target
* @param miBreak
*/
public Exceptionpoint(Target target, MIBreakpoint miBreak) {
super(target, miBreak);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIExceptionpoint#isStopOnThrow()
*/
public boolean isStopOnThrow() {
return fStopOnThrow;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIExceptionpoint#isStopOnCatch()
*/
public boolean isStopOnCatch() {
return fStopOnCatch;
}
}

View file

@ -107,10 +107,8 @@ public class Thread extends CObject implements ICDIThread {
if (currentFrames == null || currentFrames.size() < depth) { if (currentFrames == null || currentFrames.size() < depth) {
currentFrames = new ArrayList(); currentFrames = new ArrayList();
Target target = (Target)getTarget(); Target target = (Target)getTarget();
Session session = (Session) target.getSession(); ICDIThread currentThread = target.getCurrentThread();
Target currentTarget = (Target) session.getCurrentTarget(); target.setCurrentThread(this, false);
ICDIThread currentThread = currentTarget.getCurrentThread();
currentTarget.setCurrentThread(this, false);
try { try {
MISession mi = target.getMISession(); MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
@ -131,7 +129,7 @@ public class Thread extends CObject implements ICDIThread {
//throw e; //throw e;
//System.out.println(e); //System.out.println(e);
} finally { } finally {
currentTarget.setCurrentThread(currentThread, false); target.setCurrentThread(currentThread, false);
} }
// assign the currentFrame if it was not done yet. // assign the currentFrame if it was not done yet.
if (currentFrame == null) { if (currentFrame == null) {
@ -152,10 +150,8 @@ public class Thread extends CObject implements ICDIThread {
public int getStackFrameCount() throws CDIException { public int getStackFrameCount() throws CDIException {
if (stackdepth == 0) { if (stackdepth == 0) {
Target target = (Target)getTarget(); Target target = (Target)getTarget();
Session session = (Session) (target.getSession()); ICDIThread currentThread = target.getCurrentThread();
Target currentTarget = (Target) session.getCurrentTarget(); target.setCurrentThread(this, false);
ICDIThread currentThread = currentTarget.getCurrentThread();
currentTarget.setCurrentThread(this, false);
try { try {
MISession mi = target.getMISession(); MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
@ -185,7 +181,7 @@ public class Thread extends CObject implements ICDIThread {
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
} finally { } finally {
currentTarget.setCurrentThread(currentThread, false); target.setCurrentThread(currentThread, false);
} }
} }
return stackdepth; return stackdepth;
@ -198,10 +194,8 @@ public class Thread extends CObject implements ICDIThread {
if (currentFrames == null || currentFrames.size() < high) { if (currentFrames == null || currentFrames.size() < high) {
currentFrames = new ArrayList(); currentFrames = new ArrayList();
Target target = (Target) getTarget(); Target target = (Target) getTarget();
Session session = (Session) target.getSession(); ICDIThread currentThread = target.getCurrentThread();
Target currentTarget = (Target) session.getCurrentTarget(); target.setCurrentThread(this, false);
ICDIThread currentThread = currentTarget.getCurrentThread();
currentTarget.setCurrentThread(this, false);
try { try {
int depth = getStackFrameCount(); int depth = getStackFrameCount();
int upperBound; int upperBound;
@ -233,7 +227,7 @@ public class Thread extends CObject implements ICDIThread {
//throw e; //throw e;
//System.out.println(e); //System.out.println(e);
} finally { } finally {
currentTarget.setCurrentThread(currentThread, false); target.setCurrentThread(currentThread, false);
} }
// take time to assign the currentFrame, if it is in the set // take time to assign the currentFrame, if it is in the set
if (currentFrame == null) { if (currentFrame == null) {
@ -266,15 +260,18 @@ public class Thread extends CObject implements ICDIThread {
} }
// Check to see if we are already at this level // Check to see if we are already at this level
ICDIStackFrame current = getCurrentStackFrame(); if (currentFrame != null && currentFrame.getLevel() == frameLevel) {
if (current != null && current.getLevel() == frameLevel) { if (stackframe != null) {
// noop Thread aThread = (Thread)stackframe.getThread();
return; if (aThread != null && aThread.getId() == getId()) {
// noop
return;
}
}
} }
try { try {
Target target = (Target)getTarget(); Target target = (Target)getTarget();
Session session = (Session) target.getSession();
MISession mi = target.getMISession(); MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
// Need the GDB/MI view of level which is the reverse, i.e. the highest level is 0 // Need the GDB/MI view of level which is the reverse, i.e. the highest level is 0
@ -282,7 +279,7 @@ public class Thread extends CObject implements ICDIThread {
int miLevel = getStackFrameCount() - frameLevel; int miLevel = getStackFrameCount() - frameLevel;
MIStackSelectFrame frame = factory.createMIStackSelectFrame(miLevel); MIStackSelectFrame frame = factory.createMIStackSelectFrame(miLevel);
// Set ourself as the current thread first. // Set ourself as the current thread first.
((Target) getTarget()).setCurrentThread(this, doUpdate); target.setCurrentThread(this, doUpdate);
mi.postCommand(frame); mi.postCommand(frame);
MIInfo info = frame.getMIInfo(); MIInfo info = frame.getMIInfo();
if (info == null) { if (info == null) {
@ -293,6 +290,7 @@ public class Thread extends CObject implements ICDIThread {
// some variables like registers. Call an update() // some variables like registers. Call an update()
// To generate changeEvents. // To generate changeEvents.
if (doUpdate) { if (doUpdate) {
Session session = (Session) target.getSession();
RegisterManager regMgr = (RegisterManager) session.getRegisterManager(); RegisterManager regMgr = (RegisterManager) session.getRegisterManager();
if (regMgr.isAutoUpdate()) { if (regMgr.isAutoUpdate()) {
regMgr.update(target); regMgr.update(target);

View file

@ -0,0 +1,29 @@
/**********************************************************************
* Copyright (c) 2002,2003,2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-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);
}
}

View file

@ -7,6 +7,7 @@ package org.eclipse.cdt.debug.mi.core;
import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDISession; import org.eclipse.cdt.debug.core.cdi.ICDISession;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.mi.core.cdi.Session; import org.eclipse.cdt.debug.mi.core.cdi.Session;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
import org.eclipse.cdt.debug.mi.core.command.CommandFactory; import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
@ -34,22 +35,25 @@ public class CygwinGDBDebugger extends GDBDebugger {
boolean failed = false; boolean failed = false;
try { try {
session = (Session) super.createLaunchSession(config, exe); session = (Session) super.createLaunchSession(config, exe);
Target target = (Target)session.getCurrentTarget(); ICDITarget[] targets = session.getTargets();
MISession miSession = target.getMISession(); for (int i = 0; i < targets.length; ++i) {
miSession.setCommandFactory(commandFactory); Target target = (Target)targets[i];
// For windows we need to start the inferior in a new console window MISession miSession = target.getMISession();
// to separate the Inferior std{in,out,err} from gdb std{in,out,err} miSession.setCommandFactory(commandFactory);
try { // For windows we need to start the inferior in a new console window
CommandFactory factory = miSession.getCommandFactory(); // to separate the Inferior std{in,out,err} from gdb std{in,out,err}
MIGDBSet set = factory.createMIGDBSet(new String[] { "new-console" }); //$NON-NLS-1$ try {
miSession.postCommand(set); CommandFactory factory = miSession.getCommandFactory();
MIInfo info = set.getMIInfo(); MIGDBSet set = factory.createMIGDBSet(new String[] { "new-console" }); //$NON-NLS-1$
if (info == null) { miSession.postCommand(set);
throw new MIException(MIPlugin.getResourceString("src.common.No_answer")); //$NON-NLS-1$ MIInfo info = set.getMIInfo();
if (info == null) {
throw new MIException(MIPlugin.getResourceString("src.common.No_answer")); //$NON-NLS-1$
}
} catch (MIException e) {
// We ignore this exception, for example
// on GNU/Linux the new-console is an error.
} }
} catch (MIException e) {
// We ignore this exception, for example
// on GNU/Linux the new-console is an error.
} }
return session; return session;
} catch (CDIException e) { } catch (CDIException e) {
@ -73,8 +77,11 @@ public class CygwinGDBDebugger extends GDBDebugger {
boolean failed = false; boolean failed = false;
try { try {
session = (Session) super.createAttachSession(config, exe, pid); session = (Session) super.createAttachSession(config, exe, pid);
Target target = (Target)session.getCurrentTarget(); ICDITarget[] targets = session.getTargets();
target.getMISession().setCommandFactory(commandFactory); for (int i = 0; i < targets.length; ++i) {
Target target = (Target)targets[i];
target.getMISession().setCommandFactory(commandFactory);
}
initializeLibraries(config, session); initializeLibraries(config, session);
return session; return session;
} catch (CDIException e) { } catch (CDIException e) {
@ -98,8 +105,11 @@ public class CygwinGDBDebugger extends GDBDebugger {
boolean failed = false; boolean failed = false;
try { try {
session = (Session) super.createCoreSession(config, exe, corefile); session = (Session) super.createCoreSession(config, exe, corefile);
Target target = (Target)session.getCurrentTarget(); ICDITarget[] targets = session.getTargets();
target.getMISession().setCommandFactory(commandFactory); for (int i = 0; i < targets.length; ++i) {
Target target = (Target)targets[i];
target.getMISession().setCommandFactory(commandFactory);
}
initializeLibraries(config, session); initializeLibraries(config, session);
return session; return session;
} catch (CDIException e) { } catch (CDIException e) {

View file

@ -54,7 +54,6 @@ public class EventThread extends Thread {
void processSuspendedEvent(MIStoppedEvent stopped) { void processSuspendedEvent(MIStoppedEvent stopped) {
// give a chance also to the underlying inferior. // give a chance also to the underlying inferior.
session.getMIInferior().update(); session.getMIInferior().update();
} }
} }

View file

@ -20,6 +20,7 @@ import org.eclipse.cdt.debug.core.ICDebugger;
import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDISession; import org.eclipse.cdt.debug.core.cdi.ICDISession;
import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager; import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.mi.core.cdi.Session; import org.eclipse.cdt.debug.mi.core.cdi.Session;
import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager; import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
@ -77,21 +78,24 @@ public class GDBServerDebugger implements ICDebugger {
String remote = config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_DEV, "invalid"); //$NON-NLS-1$ String remote = config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_DEV, "invalid"); //$NON-NLS-1$
String remoteBaud = config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_DEV_SPEED, "invalid"); //$NON-NLS-1$ String remoteBaud = config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_DEV_SPEED, "invalid"); //$NON-NLS-1$
session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), -1, null, cwd, gdbinit); session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), -1, null, cwd, gdbinit);
Target target = (Target)session.getCurrentTarget(); ICDITarget[] targets = session.getTargets();
MISession miSession = target.getMISession(); for (int i = 0; i < targets.length; ++i) {
CommandFactory factory = miSession.getCommandFactory(); Target target = (Target)targets[i];
MIGDBSet setRemoteBaud = factory.createMIGDBSet(new String[]{"remotebaud", remoteBaud}); //$NON-NLS-1$ MISession miSession = target.getMISession();
// Set serial line parameters CommandFactory factory = miSession.getCommandFactory();
miSession.postCommand(setRemoteBaud, launchTimeout); MIGDBSet setRemoteBaud = factory.createMIGDBSet(new String[]{"remotebaud", remoteBaud}); //$NON-NLS-1$
MIInfo info = setRemoteBaud.getMIInfo(); // Set serial line parameters
if (info == null) { miSession.postCommand(setRemoteBaud, launchTimeout);
throw new MIException (MIPlugin.getResourceString("src.GDBServerDebugger.Can_not_set_Baud")); //$NON-NLS-1$ MIInfo info = setRemoteBaud.getMIInfo();
} if (info == null) {
MITargetSelect select = factory.createMITargetSelect(new String[] {"remote", remote}); //$NON-NLS-1$ throw new MIException (MIPlugin.getResourceString("src.GDBServerDebugger.Can_not_set_Baud")); //$NON-NLS-1$
miSession.postCommand(select, launchTimeout); }
select.getMIInfo(); MITargetSelect select = factory.createMITargetSelect(new String[] {"remote", remote}); //$NON-NLS-1$
if (info == null) { miSession.postCommand(select, launchTimeout);
throw new MIException (MIPlugin.getResourceString("src.common.No_answer")); //$NON-NLS-1$ select.getMIInfo();
if (info == null) {
throw new MIException (MIPlugin.getResourceString("src.common.No_answer")); //$NON-NLS-1$
}
} }
} }
initializeLibraries(config, session); initializeLibraries(config, session);