From ac0980848602e2fb0c67a71a6b4fa281a52e3a1a Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Sat, 12 Apr 2008 00:50:15 +0000 Subject: [PATCH] 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. --- .../service/command/GDBCLIProcess.java | 4 +-- .../service/command/GDBControl.java | 25 +------------------ .../service/command/AbstractCLIProcess.java | 7 ++---- 3 files changed, 5 insertions(+), 31 deletions(-) diff --git a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBCLIProcess.java b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBCLIProcess.java index 10b95f8bb27..366c257538e 100644 --- a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBCLIProcess.java +++ b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBCLIProcess.java @@ -24,8 +24,8 @@ import org.eclipse.dd.mi.service.command.AbstractCLIProcess; */ class GDBCLIProcess extends AbstractCLIProcess { - public GDBCLIProcess(GDBControl commandControl, boolean useExecConsole) throws IOException { - super(commandControl, useExecConsole); + public GDBCLIProcess(GDBControl commandControl) throws IOException { + super(commandControl); } diff --git a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBControl.java b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBControl.java index 5c3f2417712..9eb3786b1c0 100644 --- a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBControl.java +++ b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBControl.java @@ -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.MIRunControlEventProcessor; 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.debug.core.DebugException; import org.osgi.framework.BundleContext; @@ -87,7 +86,6 @@ public class GDBControl extends AbstractMIControl { private SessionType fSessionType; private boolean fConnected = false; - private boolean fUseInterpreterConsole; private MonitorJob fMonitorJob; private IPath fGdbPath; @@ -131,7 +129,6 @@ public class GDBControl extends AbstractMIControl { new GDBProcessStep(InitializationShutdownStep.Direction.INITIALIZING), new MonitorJobStep(InitializationShutdownStep.Direction.INITIALIZING), new CommandMonitoringStep(InitializationShutdownStep.Direction.INITIALIZING), - new CheckInterpreterConsoleStep(InitializationShutdownStep.Direction.INITIALIZING), new CommandProcessorsStep(InitializationShutdownStep.Direction.INITIALIZING), new RegisterStep(InitializationShutdownStep.Direction.INITIALIZING), }; @@ -147,7 +144,6 @@ public class GDBControl extends AbstractMIControl { final Sequence.Step[] shutdownSteps = new Sequence.Step[] { new RegisterStep(InitializationShutdownStep.Direction.SHUTTING_DOWN), new CommandProcessorsStep(InitializationShutdownStep.Direction.SHUTTING_DOWN), - new CheckInterpreterConsoleStep(InitializationShutdownStep.Direction.SHUTTING_DOWN), new CommandMonitoringStep(InitializationShutdownStep.Direction.SHUTTING_DOWN), new MonitorJobStep(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 cmd = new MIInterpreterExecConsole(fControlDmc, "echo"); //$NON-NLS-1$ - GDBControl.this.queueCommand( - cmd, - new DataRequestMonitor(getExecutor(), null) { - @Override - protected void handleCompleted() { - fUseInterpreterConsole = isSuccess(); - requestMonitor.done(); - } - } - ); - } - } - protected class CommandProcessorsStep extends InitializationShutdownStep { CommandProcessorsStep(Direction direction) { super(direction); } @Override public void initialize(final RequestMonitor requestMonitor) { try { - fCLIProcess = new GDBCLIProcess(GDBControl.this, fUseInterpreterConsole); + fCLIProcess = new GDBCLIProcess(GDBControl.this); } catch(IOException e) { requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, IDsfStatusConstants.REQUEST_FAILED, "Failed to create CLI Process", e)); //$NON-NLS-1$ diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/AbstractCLIProcess.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/AbstractCLIProcess.java index 6a0ecedc0be..e5041e85f56 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/AbstractCLIProcess.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/AbstractCLIProcess.java @@ -67,8 +67,6 @@ public abstract class AbstractCLIProcess extends Process private final PipedInputStream fMIInLogPipe; private final PipedOutputStream fMIOutLogPipe; - private final boolean fUseExecConsole; - 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 ">" @ConfinedToDsfExecutor("fSession#getExecutor") - public AbstractCLIProcess(AbstractMIControl commandControl, boolean useExecConsole) throws IOException { + public AbstractCLIProcess(AbstractMIControl commandControl) throws IOException { fSession = commandControl.getSession(); fCommandControl = commandControl; - fUseExecConsole = useExecConsole; commandControl.addEventListener(this); commandControl.addCommandListener(this); @@ -294,7 +291,7 @@ public abstract class AbstractCLIProcess extends Process if (secondary) { cmd = new RawCommand(getCommandControl().getControlDMContext(), str); } - else if (fUseExecConsole && ! CLIEventProcessor.isSteppingOperation(str)) + else if (! CLIEventProcessor.isSteppingOperation(str)) { cmd = new ProcessMIInterpreterExecConsole(getCommandControl().getControlDMContext(), str); }