mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-19 15:05:36 +02:00
Bug 241985
This commit is contained in:
parent
85fd860849
commit
52be905ca0
3 changed files with 71 additions and 40 deletions
|
@ -40,8 +40,13 @@ public class ServicesLaunchSequence extends Sequence {
|
|||
//
|
||||
// Create the connection.
|
||||
//
|
||||
fCommandControl = new GDBControl(fSession, LaunchUtils.getGDBPath(fLaunch.getLaunchConfiguration()),
|
||||
fExecPath, fSessionType, fAttach, 30);
|
||||
fCommandControl = fLaunch.getServiceFactory().createService(fSession, GDBControl.class);
|
||||
|
||||
fCommandControl.setAttach(fAttach);
|
||||
fCommandControl.setExecPath(fExecPath);
|
||||
fCommandControl.setGdbPath(LaunchUtils.getGDBPath(fLaunch.getLaunchConfiguration()));
|
||||
fCommandControl.setSessionType(fSessionType);
|
||||
|
||||
fCommandControl.initialize(requestMonitor);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -22,7 +22,9 @@ import org.eclipse.dd.dsf.debug.service.IRegisters;
|
|||
import org.eclipse.dd.dsf.debug.service.IRunControl;
|
||||
import org.eclipse.dd.dsf.debug.service.ISourceLookup;
|
||||
import org.eclipse.dd.dsf.debug.service.IStack;
|
||||
import org.eclipse.dd.dsf.debug.service.command.ICommandControl;
|
||||
import org.eclipse.dd.dsf.service.DsfSession;
|
||||
import org.eclipse.dd.gdb.internal.provisional.service.command.GDBControl;
|
||||
import org.eclipse.dd.mi.service.CSourceLookup;
|
||||
import org.eclipse.dd.mi.service.ExpressionService;
|
||||
import org.eclipse.dd.mi.service.MIBreakpoints;
|
||||
|
@ -35,10 +37,14 @@ import org.eclipse.dd.mi.service.MIStack;
|
|||
|
||||
public class GdbDebugServicesFactory extends AbstractDsfDebugServicesFactory {
|
||||
|
||||
private final String fVersion;
|
||||
|
||||
public GdbDebugServicesFactory(String version) {
|
||||
fVersion = version;
|
||||
}
|
||||
|
||||
|
||||
public String getVersion() { return fVersion; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <V> V createService(DsfSession session, Class<V> clazz) {
|
||||
|
@ -49,58 +55,62 @@ public class GdbDebugServicesFactory extends AbstractDsfDebugServicesFactory {
|
|||
return super.createService(session, clazz);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IDisassembly createDisassemblyService(DsfSession session) {
|
||||
return new MIDisassembly(session);
|
||||
protected MIBreakpointsManager createBreakpointManagerService(DsfSession session) {
|
||||
return new MIBreakpointsManager(session, CDebugCorePlugin.PLUGIN_ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IRegisters createRegistersService(DsfSession session) {
|
||||
return new MIRegisters(session);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected IBreakpoints createBreakpointService(DsfSession session) {
|
||||
return new MIBreakpoints(session);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ISourceLookup createSourceLookupService(DsfSession session) {
|
||||
return new CSourceLookup(session);
|
||||
protected ICommandControl createCommandControl(DsfSession session) {
|
||||
return new GDBControl(session);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IDisassembly createDisassemblyService(DsfSession session) {
|
||||
return new MIDisassembly(session);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IExpressions createExpressionService(DsfSession session) {
|
||||
return new ExpressionService(session);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IMemory createMemoryService(DsfSession session) {
|
||||
return new MIMemory(session);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IModules createModulesService(DsfSession session) {
|
||||
return new MIModules(session);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IProcesses createProcessesService(DsfSession session) {
|
||||
return new GDBProcesses(session);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IRegisters createRegistersService(DsfSession session) {
|
||||
return new MIRegisters(session);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IRunControl createRunControlService(DsfSession session) {
|
||||
return new GDBRunControl(session);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ISourceLookup createSourceLookupService(DsfSession session) {
|
||||
return new CSourceLookup(session);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IStack createStackService(DsfSession session) {
|
||||
return new MIStack(session);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IModules createModulesService(DsfSession session) {
|
||||
return new MIModules(session);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IMemory createMemoryService(DsfSession session) {
|
||||
return new MIMemory(session);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IRunControl createRunControlService(DsfSession session) {
|
||||
return new GDBRunControl(session);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IProcesses createProcessesService(DsfSession session) {
|
||||
return new GDBProcesses(session);
|
||||
}
|
||||
|
||||
protected MIBreakpointsManager createBreakpointManagerService(DsfSession session) {
|
||||
return new MIBreakpointsManager(session, CDebugCorePlugin.PLUGIN_ID);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ public class GDBControl extends AbstractMIControl {
|
|||
private IPath fExecPath;
|
||||
private Process fProcess;
|
||||
private int fGDBExitValue;
|
||||
final private int fGDBLaunchTimeout;
|
||||
private int fGDBLaunchTimeout = 30;
|
||||
|
||||
private MIRunControlEventProcessor fMIEventProcessor;
|
||||
private CLIEventProcessor fCLICommandProcessor;
|
||||
|
@ -112,6 +112,22 @@ public class GDBControl extends AbstractMIControl {
|
|||
|
||||
private PTY fPty;
|
||||
|
||||
public GDBControl(DsfSession session) {
|
||||
super(session);
|
||||
fControlDmc = new GDBControlDMContext(session.getId(), "gdbcontrol[" + ++fgInstanceCounter + "]"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
public void setGdbPath(IPath path) { fGdbPath = path; }
|
||||
|
||||
public void setExecPath(IPath path) { fExecPath = path; }
|
||||
|
||||
public void setSessionType(SessionType type) { fSessionType = type; }
|
||||
|
||||
public void setAttach(boolean attach) { fAttach = attach; }
|
||||
|
||||
public void setLaunchTimeout(int timeout) { fGDBLaunchTimeout = timeout; }
|
||||
|
||||
@Deprecated
|
||||
public GDBControl(DsfSession session, IPath gdbPath, IPath execPath, SessionType sessionType, boolean attach, int gdbLaunchTimeout) {
|
||||
super(session);
|
||||
fSessionType = sessionType;
|
||||
|
|
Loading…
Add table
Reference in a new issue