mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 226691
We only support GDB 6.6 and higher, from what I can see, -interpreter-exec is always available (I tried with mi1 m2 and m3 on GDB 6.6). Therefore, we can simplify the launch by removing the CheckInterpreterConsoleStep.
This commit is contained in:
parent
8422bf48dd
commit
ac09808486
3 changed files with 5 additions and 31 deletions
|
@ -24,8 +24,8 @@ import org.eclipse.dd.mi.service.command.AbstractCLIProcess;
|
||||||
*/
|
*/
|
||||||
class GDBCLIProcess extends AbstractCLIProcess {
|
class GDBCLIProcess extends AbstractCLIProcess {
|
||||||
|
|
||||||
public GDBCLIProcess(GDBControl commandControl, boolean useExecConsole) throws IOException {
|
public GDBCLIProcess(GDBControl commandControl) throws IOException {
|
||||||
super(commandControl, useExecConsole);
|
super(commandControl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,6 @@ import org.eclipse.dd.mi.service.command.MIControlDMContext;
|
||||||
import org.eclipse.dd.mi.service.command.MIInferiorProcess;
|
import org.eclipse.dd.mi.service.command.MIInferiorProcess;
|
||||||
import org.eclipse.dd.mi.service.command.MIRunControlEventProcessor;
|
import org.eclipse.dd.mi.service.command.MIRunControlEventProcessor;
|
||||||
import org.eclipse.dd.mi.service.command.commands.MIGDBExit;
|
import org.eclipse.dd.mi.service.command.commands.MIGDBExit;
|
||||||
import org.eclipse.dd.mi.service.command.commands.MIInterpreterExecConsole;
|
|
||||||
import org.eclipse.dd.mi.service.command.output.MIInfo;
|
import org.eclipse.dd.mi.service.command.output.MIInfo;
|
||||||
import org.eclipse.debug.core.DebugException;
|
import org.eclipse.debug.core.DebugException;
|
||||||
import org.osgi.framework.BundleContext;
|
import org.osgi.framework.BundleContext;
|
||||||
|
@ -87,7 +86,6 @@ public class GDBControl extends AbstractMIControl {
|
||||||
private SessionType fSessionType;
|
private SessionType fSessionType;
|
||||||
|
|
||||||
private boolean fConnected = false;
|
private boolean fConnected = false;
|
||||||
private boolean fUseInterpreterConsole;
|
|
||||||
|
|
||||||
private MonitorJob fMonitorJob;
|
private MonitorJob fMonitorJob;
|
||||||
private IPath fGdbPath;
|
private IPath fGdbPath;
|
||||||
|
@ -131,7 +129,6 @@ public class GDBControl extends AbstractMIControl {
|
||||||
new GDBProcessStep(InitializationShutdownStep.Direction.INITIALIZING),
|
new GDBProcessStep(InitializationShutdownStep.Direction.INITIALIZING),
|
||||||
new MonitorJobStep(InitializationShutdownStep.Direction.INITIALIZING),
|
new MonitorJobStep(InitializationShutdownStep.Direction.INITIALIZING),
|
||||||
new CommandMonitoringStep(InitializationShutdownStep.Direction.INITIALIZING),
|
new CommandMonitoringStep(InitializationShutdownStep.Direction.INITIALIZING),
|
||||||
new CheckInterpreterConsoleStep(InitializationShutdownStep.Direction.INITIALIZING),
|
|
||||||
new CommandProcessorsStep(InitializationShutdownStep.Direction.INITIALIZING),
|
new CommandProcessorsStep(InitializationShutdownStep.Direction.INITIALIZING),
|
||||||
new RegisterStep(InitializationShutdownStep.Direction.INITIALIZING),
|
new RegisterStep(InitializationShutdownStep.Direction.INITIALIZING),
|
||||||
};
|
};
|
||||||
|
@ -147,7 +144,6 @@ public class GDBControl extends AbstractMIControl {
|
||||||
final Sequence.Step[] shutdownSteps = new Sequence.Step[] {
|
final Sequence.Step[] shutdownSteps = new Sequence.Step[] {
|
||||||
new RegisterStep(InitializationShutdownStep.Direction.SHUTTING_DOWN),
|
new RegisterStep(InitializationShutdownStep.Direction.SHUTTING_DOWN),
|
||||||
new CommandProcessorsStep(InitializationShutdownStep.Direction.SHUTTING_DOWN),
|
new CommandProcessorsStep(InitializationShutdownStep.Direction.SHUTTING_DOWN),
|
||||||
new CheckInterpreterConsoleStep(InitializationShutdownStep.Direction.SHUTTING_DOWN),
|
|
||||||
new CommandMonitoringStep(InitializationShutdownStep.Direction.SHUTTING_DOWN),
|
new CommandMonitoringStep(InitializationShutdownStep.Direction.SHUTTING_DOWN),
|
||||||
new MonitorJobStep(InitializationShutdownStep.Direction.SHUTTING_DOWN),
|
new MonitorJobStep(InitializationShutdownStep.Direction.SHUTTING_DOWN),
|
||||||
new GDBProcessStep(InitializationShutdownStep.Direction.SHUTTING_DOWN),
|
new GDBProcessStep(InitializationShutdownStep.Direction.SHUTTING_DOWN),
|
||||||
|
@ -509,32 +505,13 @@ public class GDBControl extends AbstractMIControl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected class CheckInterpreterConsoleStep extends InitializationShutdownStep {
|
|
||||||
CheckInterpreterConsoleStep(Direction direction) { super(direction); }
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initialize(final RequestMonitor requestMonitor) {
|
|
||||||
MIInterpreterExecConsole<MIInfo> cmd = new MIInterpreterExecConsole<MIInfo>(fControlDmc, "echo"); //$NON-NLS-1$
|
|
||||||
GDBControl.this.queueCommand(
|
|
||||||
cmd,
|
|
||||||
new DataRequestMonitor<MIInfo>(getExecutor(), null) {
|
|
||||||
@Override
|
|
||||||
protected void handleCompleted() {
|
|
||||||
fUseInterpreterConsole = isSuccess();
|
|
||||||
requestMonitor.done();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected class CommandProcessorsStep extends InitializationShutdownStep {
|
protected class CommandProcessorsStep extends InitializationShutdownStep {
|
||||||
CommandProcessorsStep(Direction direction) { super(direction); }
|
CommandProcessorsStep(Direction direction) { super(direction); }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize(final RequestMonitor requestMonitor) {
|
public void initialize(final RequestMonitor requestMonitor) {
|
||||||
try {
|
try {
|
||||||
fCLIProcess = new GDBCLIProcess(GDBControl.this, fUseInterpreterConsole);
|
fCLIProcess = new GDBCLIProcess(GDBControl.this);
|
||||||
}
|
}
|
||||||
catch(IOException e) {
|
catch(IOException e) {
|
||||||
requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, IDsfStatusConstants.REQUEST_FAILED, "Failed to create CLI Process", e)); //$NON-NLS-1$
|
requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, IDsfStatusConstants.REQUEST_FAILED, "Failed to create CLI Process", e)); //$NON-NLS-1$
|
||||||
|
|
|
@ -67,8 +67,6 @@ public abstract class AbstractCLIProcess extends Process
|
||||||
private final PipedInputStream fMIInLogPipe;
|
private final PipedInputStream fMIInLogPipe;
|
||||||
private final PipedOutputStream fMIOutLogPipe;
|
private final PipedOutputStream fMIOutLogPipe;
|
||||||
|
|
||||||
private final boolean fUseExecConsole;
|
|
||||||
|
|
||||||
private boolean fDisposed = false;
|
private boolean fDisposed = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -88,10 +86,9 @@ public abstract class AbstractCLIProcess extends Process
|
||||||
private int fPrompt = 1; // 1 --> Primary prompt "(gdb)"; 2 --> Secondary Prompt ">"
|
private int fPrompt = 1; // 1 --> Primary prompt "(gdb)"; 2 --> Secondary Prompt ">"
|
||||||
|
|
||||||
@ConfinedToDsfExecutor("fSession#getExecutor")
|
@ConfinedToDsfExecutor("fSession#getExecutor")
|
||||||
public AbstractCLIProcess(AbstractMIControl commandControl, boolean useExecConsole) throws IOException {
|
public AbstractCLIProcess(AbstractMIControl commandControl) throws IOException {
|
||||||
fSession = commandControl.getSession();
|
fSession = commandControl.getSession();
|
||||||
fCommandControl = commandControl;
|
fCommandControl = commandControl;
|
||||||
fUseExecConsole = useExecConsole;
|
|
||||||
|
|
||||||
commandControl.addEventListener(this);
|
commandControl.addEventListener(this);
|
||||||
commandControl.addCommandListener(this);
|
commandControl.addCommandListener(this);
|
||||||
|
@ -294,7 +291,7 @@ public abstract class AbstractCLIProcess extends Process
|
||||||
if (secondary) {
|
if (secondary) {
|
||||||
cmd = new RawCommand(getCommandControl().getControlDMContext(), str);
|
cmd = new RawCommand(getCommandControl().getControlDMContext(), str);
|
||||||
}
|
}
|
||||||
else if (fUseExecConsole && ! CLIEventProcessor.isSteppingOperation(str))
|
else if (! CLIEventProcessor.isSteppingOperation(str))
|
||||||
{
|
{
|
||||||
cmd = new ProcessMIInterpreterExecConsole(getCommandControl().getControlDMContext(), str);
|
cmd = new ProcessMIInterpreterExecConsole(getCommandControl().getControlDMContext(), str);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue