1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-10 09:45:39 +02:00

miscellaneous clean ups

This commit is contained in:
Alain Magloire 2004-10-26 20:12:27 +00:00
parent 91086ed28f
commit 475911cb82
7 changed files with 16 additions and 44 deletions

View file

@ -252,26 +252,9 @@ public class Session implements ICDISession, ICDISessionObject {
eMgr.fireEvents(new ICDIEvent[] { new DestroyedEvent(this) }); eMgr.fireEvents(new ICDIEvent[] { new DestroyedEvent(this) });
eMgr.removeEventListeners(); eMgr.removeEventListeners();
} }
/**
* @deprecated
* @see org.eclipse.cdt.debug.core.cdi.ICDISession#terminate(ICDITarget)
*/
public void terminate(ICDITarget target) throws CDIException {
((Target)target).getMISession().terminate();
}
/** public void addSearchPaths(Target target, String[] dirs) throws CDIException {
* @deprecated MISession miSession = target.getMISession();
* @see org.eclipse.cdt.debug.core.cdi.ICDISession#addSearchPaths(String[])
*/
public void addSearchPaths(String[] dirs) throws CDIException {
addSearchPaths(getCurrentTarget(), dirs);
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDISession#addSearchPaths(String[])
*/
public void addSearchPaths(ICDITarget target, String[] dirs) throws CDIException {
MISession miSession = ((Target)target).getMISession();
CommandFactory factory = miSession.getCommandFactory(); CommandFactory factory = miSession.getCommandFactory();
MIEnvironmentDirectory dir = factory.createMIEnvironmentDirectory(dirs); MIEnvironmentDirectory dir = factory.createMIEnvironmentDirectory(dirs);
try { try {
@ -290,10 +273,7 @@ public class Session implements ICDISession, ICDISessionObject {
return getSessionProcess(getCurrentTarget()); return getSessionProcess(getCurrentTarget());
} }
/** public Process getSessionProcess(ICDITarget target) {
* @see org.eclipse.cdt.debug.core.cdi.ICDISession#getSessionProcess()
*/
public Process getSessionProcess(ICDITarget target) throws CDIException {
MISession miSession = ((Target)target).getMISession(); MISession miSession = ((Target)target).getMISession();
return miSession.getSessionProcess(); return miSession.getSessionProcess();
} }

View file

@ -22,7 +22,7 @@ public class SignalReceived extends SessionObject implements ICDISignalReceived
ICDISignal signal; ICDISignal signal;
public SignalReceived(Session session, MISignalEvent event) { public SignalReceived(Session session, MISignalEvent event) {
super(session); super(session);
SignalManager mgr = (SignalManager)session.getSignalManager(); SignalManager mgr = session.getSignalManager();
signal = mgr.getSignal(event.getMISession(), event.getName()); signal = mgr.getSignal(event.getMISession(), event.getName());
} }

View file

@ -108,7 +108,7 @@ public class ChangedEvent implements ICDIChangedEvent {
public ChangedEvent(Session s, MISignalChangedEvent sig) { public ChangedEvent(Session s, MISignalChangedEvent sig) {
session = s; session = s;
SignalManager mgr = (SignalManager)session.getSignalManager(); SignalManager mgr = session.getSignalManager();
MISession miSession = sig.getMISession(); MISession miSession = sig.getMISession();
String name = sig.getName(); String name = sig.getName();
ICDISignal signal = mgr.getSignal(miSession, name); ICDISignal signal = mgr.getSignal(miSession, name);

View file

@ -166,7 +166,7 @@ public class VariableObject extends CObject implements ICDIVariableObject {
if (frame == null) { if (frame == null) {
frame = target.getCurrentThread().getCurrentStackFrame(); frame = target.getCurrentThread().getCurrentStackFrame();
} }
SourceManager sourceMgr = (SourceManager) session.getSourceManager(); SourceManager sourceMgr = session.getSourceManager();
String nametype = sourceMgr.getTypeName(this, getQualifiedName()); String nametype = sourceMgr.getTypeName(this, getQualifiedName());
try { try {
type = sourceMgr.getType(this, nametype); type = sourceMgr.getType(this, nametype);

View file

@ -35,8 +35,8 @@ public abstract class DerivedType extends Type implements ICDIDerivedType {
public void setComponentType(String name) { public void setComponentType(String name) {
Target target = (Target)getTarget(); Target target = (Target)getTarget();
Session session = (Session)(target.getSession()); Session session = (Session)target.getSession();
SourceManager sourceMgr = (SourceManager)session.getSourceManager(); SourceManager sourceMgr = session.getSourceManager();
try { try {
derivedType = sourceMgr.getType(getVariableObject(), name); derivedType = sourceMgr.getType(getVariableObject(), name);
} catch (CDIException e) { } catch (CDIException e) {

View file

@ -12,7 +12,6 @@
package org.eclipse.cdt.debug.mi.core; package org.eclipse.cdt.debug.mi.core;
import org.eclipse.cdt.core.IBinaryParser.IBinaryExecutable; import org.eclipse.cdt.core.IBinaryParser.IBinaryExecutable;
import org.eclipse.cdt.debug.core.cdi.ICDISession;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; 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;
@ -24,10 +23,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfiguration;
/** /**
* @author User * Cygwin debugger extension point.
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/ */
public class CygwinGDBCDIDebugger extends GDBCDIDebugger { public class CygwinGDBCDIDebugger extends GDBCDIDebugger {
static final CygwinCommandFactory commandFactory = new CygwinCommandFactory(); static final CygwinCommandFactory commandFactory = new CygwinCommandFactory();
@ -37,7 +33,7 @@ public class CygwinGDBCDIDebugger extends GDBCDIDebugger {
} }
public Session createLaunchSession(ILaunchConfiguration config, IBinaryExecutable exe, IProgressMonitor monitor) throws CoreException { public Session createLaunchSession(ILaunchConfiguration config, IBinaryExecutable exe, IProgressMonitor monitor) throws CoreException {
Session session = (Session) super.createLaunchSession(config, exe, monitor); Session session = super.createLaunchSession(config, exe, monitor);
ICDITarget[] targets = session.getTargets(); ICDITarget[] targets = session.getTargets();
for (int i = 0; i < targets.length; ++i) { for (int i = 0; i < targets.length; ++i) {
Target target = (Target)targets[i]; Target target = (Target)targets[i];
@ -62,7 +58,7 @@ public class CygwinGDBCDIDebugger extends GDBCDIDebugger {
} }
public Session createAttachSession(ILaunchConfiguration config, IBinaryExecutable exe, IProgressMonitor monitor) throws CoreException { public Session createAttachSession(ILaunchConfiguration config, IBinaryExecutable exe, IProgressMonitor monitor) throws CoreException {
Session session = (Session) super.createAttachSession(config, exe, monitor); Session session = super.createAttachSession(config, exe, monitor);
ICDITarget[] targets = session.getTargets(); ICDITarget[] targets = session.getTargets();
for (int i = 0; i < targets.length; ++i) { for (int i = 0; i < targets.length; ++i) {
Target target = (Target)targets[i]; Target target = (Target)targets[i];
@ -73,7 +69,7 @@ public class CygwinGDBCDIDebugger extends GDBCDIDebugger {
} }
public Session createCoreSession(ILaunchConfiguration config, IBinaryExecutable exe, IProgressMonitor monitor) throws CoreException { public Session createCoreSession(ILaunchConfiguration config, IBinaryExecutable exe, IProgressMonitor monitor) throws CoreException {
Session session = (Session) super.createCoreSession(config, exe, monitor); Session session = super.createCoreSession(config, exe, monitor);
ICDITarget[] targets = session.getTargets(); ICDITarget[] targets = session.getTargets();
for (int i = 0; i < targets.length; ++i) { for (int i = 0; i < targets.length; ++i) {
Target target = (Target)targets[i]; Target target = (Target)targets[i];

View file

@ -27,7 +27,6 @@ import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; 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.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
@ -79,13 +78,10 @@ public class GDBCDIDebugger implements ICDIDebugger {
if (dsession != null) { if (dsession != null) {
ICDITarget[] dtargets = dsession.getTargets(); ICDITarget[] dtargets = dsession.getTargets();
for (int i = 0; i < dtargets.length; i++) { for (int i = 0; i < dtargets.length; i++) {
if (dtargets[i] instanceof Target) { Process debugger = dsession.getSessionProcess(dtargets[i]);
Target target = (Target)dtargets[i]; if (debugger != null) {
Process debugger = target.getMISession().getSessionProcess(); IProcess debuggerProcess = DebugPlugin.newProcess(launch, debugger, renderDebuggerProcessLabel());
if (debugger != null ) { launch.addProcess(debuggerProcess);
IProcess debuggerProcess = DebugPlugin.newProcess(launch, debugger, renderDebuggerProcessLabel());
launch.addProcess(debuggerProcess);
}
} }
} }
} }