From eba5a5fe782ff6fc9a66f141e7a2eb53e7c2a0c6 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Mon, 18 Aug 2008 00:37:33 +0000 Subject: [PATCH] Bug 244336 Use the new --thread/--frame in a centralized location. Added supportsThreadAndFrameOptions() to MICommand to allow subclasses such as CLICommand and RawCommand to override and rely on -thread-select and -stack-select-frame. Cleanup of MICommands that had --thread/--stack implemented directly in the class. MIStackNS is no longer needed, and its only remaining difference (checking if the thread is suspended) has been merged into MIStack. --- .../service/GdbDebugServicesFactory.java | 9 +- .../service/GdbDebugServicesFactoryNS.java | 7 - .../service/command/GDBControl.java | 15 +- .../eclipse/dd/mi/service/MIRunControlNS.java | 14 +- .../org/eclipse/dd/mi/service/MIStack.java | 45 +- .../org/eclipse/dd/mi/service/MIStackNS.java | 678 ------------------ .../mi/service/command/AbstractMIControl.java | 97 ++- .../service/command/commands/CLICommand.java | 4 + .../service/command/commands/MICommand.java | 30 +- .../command/commands/MIExecContinue.java | 6 +- .../command/commands/MIExecInterrupt.java | 10 +- .../service/command/commands/MIExecNext.java | 16 +- .../commands/MIExecNextInstruction.java | 16 +- .../command/commands/MIExecReturn.java | 2 +- .../service/command/commands/MIExecStep.java | 16 +- .../commands/MIExecStepInstruction.java | 16 +- .../service/command/commands/MIExecUntil.java | 19 +- .../command/commands/MIStackInfoDepth.java | 21 +- .../commands/MIStackListArguments.java | 27 +- .../command/commands/MIStackListFrames.java | 18 +- .../command/commands/MIStackListLocals.java | 14 +- .../command/commands/MIStackSelectFrame.java | 4 - .../command/commands/MITargetSelect.java | 4 +- .../command/commands/MIThreadSelect.java | 9 +- .../service/command/commands/RawCommand.java | 3 + 25 files changed, 155 insertions(+), 945 deletions(-) delete mode 100644 plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIStackNS.java diff --git a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/GdbDebugServicesFactory.java b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/GdbDebugServicesFactory.java index cac53fbfb63..006eeca64a4 100644 --- a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/GdbDebugServicesFactory.java +++ b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/GdbDebugServicesFactory.java @@ -72,8 +72,13 @@ public class GdbDebugServicesFactory extends AbstractDsfDebugServicesFactory { return new MIBreakpoints(session); } - protected ICommandControl createCommandControl(DsfSession session, ILaunchConfiguration config) { - return new GDBControl(session, config); + protected ICommandControl createCommandControl(DsfSession session, ILaunchConfiguration config) { + boolean useThreadAndFrameOptions = false; + if ("6.8".compareTo(fVersion) < 0) { //$NON-NLS-1$ + useThreadAndFrameOptions = true; + } + + return new GDBControl(session, config, useThreadAndFrameOptions); } @Override diff --git a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/GdbDebugServicesFactoryNS.java b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/GdbDebugServicesFactoryNS.java index 6eb3734a327..67403730f92 100644 --- a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/GdbDebugServicesFactoryNS.java +++ b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/GdbDebugServicesFactoryNS.java @@ -12,10 +12,8 @@ package org.eclipse.dd.gdb.internal.provisional.service; import org.eclipse.dd.dsf.debug.service.IProcesses; import org.eclipse.dd.dsf.debug.service.IRunControl; -import org.eclipse.dd.dsf.debug.service.IStack; import org.eclipse.dd.dsf.service.DsfSession; import org.eclipse.dd.mi.service.MIRunControlNS; -import org.eclipse.dd.mi.service.MIStackNS; public class GdbDebugServicesFactoryNS extends GdbDebugServicesFactory { @@ -30,11 +28,6 @@ public class GdbDebugServicesFactoryNS extends GdbDebugServicesFactory { // } return new GDBProcesses(session); } - - @Override - protected IStack createStackService(DsfSession session) { - return new MIStackNS(session); - } @Override protected IRunControl createRunControlService(DsfSession session) { 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 16f70235513..9418cd8e8c3 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 @@ -120,8 +120,8 @@ public class GDBControl extends AbstractMIControl { private PTY fPty; - public GDBControl(DsfSession session, ILaunchConfiguration config) { - super(session, "gdbcontrol[" + ++fgInstanceCounter + "]"); //$NON-NLS-1$ //$NON-NLS-2$ + public GDBControl(DsfSession session, ILaunchConfiguration config, boolean useThreadAndFrameOptions) { + super(session, "gdbcontrol[" + ++fgInstanceCounter + "]", useThreadAndFrameOptions); //$NON-NLS-1$ //$NON-NLS-2$ fSessionType = LaunchUtils.getSessionType(config); fAttach = LaunchUtils.getIsAttach(config); fGdbPath = LaunchUtils.getGDBPath(config); @@ -133,17 +133,6 @@ public class GDBControl extends AbstractMIControl { fControlDmc = new GDBControlDMContext(session.getId(), getId()); } - @Deprecated - public GDBControl(DsfSession session, IPath gdbPath, IPath execPath, SessionType sessionType, boolean attach, int gdbLaunchTimeout) { - super(session, "gdbcontrol[" + ++fgInstanceCounter + "]"); //$NON-NLS-1$ //$NON-NLS-2$ - fSessionType = sessionType; - fAttach = attach; - fGdbPath = gdbPath; - fExecPath = execPath; - fGDBLaunchTimeout = gdbLaunchTimeout; - fControlDmc = new GDBControlDMContext(session.getId(), getId()); - } - @Override protected BundleContext getBundleContext() { return GdbPlugin.getBundleContext(); diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRunControlNS.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRunControlNS.java index d08f626d779..3fe172d3991 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRunControlNS.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRunControlNS.java @@ -389,11 +389,11 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl return; } - MIExecInterrupt cmd = new MIExecInterrupt(context, true); + MIExecInterrupt cmd = new MIExecInterrupt(context); fConnection.queueCommand(cmd, new DataRequestMonitor(getExecutor(), rm)); } - private void doSuspendContainer(IExecutionDMContext context, final RequestMonitor rm) { + private void doSuspendContainer(IContainerDMContext context, final RequestMonitor rm) { MIExecInterrupt cmd = new MIExecInterrupt(context, true); fConnection.queueCommand(cmd, new DataRequestMonitor(getExecutor(), rm)); } @@ -475,7 +475,7 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl } threadState.fResumePending = true; - MIExecContinue cmd = new MIExecContinue(context, context.getThreadId()); + MIExecContinue cmd = new MIExecContinue(context); fConnection.queueCommand(cmd, new DataRequestMonitor(getExecutor(), rm)); } @@ -545,11 +545,11 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl switch (stepType) { case STEP_INTO: - fConnection.queueCommand(new MIExecStep(dmc, true), + fConnection.queueCommand(new MIExecStep(dmc), new DataRequestMonitor(getExecutor(), rm)); break; case STEP_OVER: - fConnection.queueCommand(new MIExecNext(dmc, true), + fConnection.queueCommand(new MIExecNext(dmc), new DataRequestMonitor(getExecutor(), rm)); break; case STEP_RETURN: @@ -571,11 +571,11 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl } break; case INSTRUCTION_STEP_INTO: - fConnection.queueCommand(new MIExecStepInstruction(dmc, true), + fConnection.queueCommand(new MIExecStepInstruction(dmc), new DataRequestMonitor(getExecutor(), rm)); break; case INSTRUCTION_STEP_OVER: - fConnection.queueCommand(new MIExecNextInstruction(dmc, true), + fConnection.queueCommand(new MIExecNextInstruction(dmc), new DataRequestMonitor(getExecutor(), rm)); break; default: diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIStack.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIStack.java index 9730c0bcf7e..1b3103d6034 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIStack.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIStack.java @@ -27,6 +27,7 @@ import org.eclipse.dd.dsf.concurrent.RequestMonitor; import org.eclipse.dd.dsf.datamodel.AbstractDMContext; import org.eclipse.dd.dsf.datamodel.DMContexts; import org.eclipse.dd.dsf.datamodel.IDMContext; +import org.eclipse.dd.dsf.debug.service.IRunControl; import org.eclipse.dd.dsf.debug.service.IStack; import org.eclipse.dd.dsf.debug.service.IStack2; import org.eclipse.dd.dsf.debug.service.IRunControl.IExecutionDMContext; @@ -123,6 +124,7 @@ public class MIStack extends AbstractDsfService private CommandCache fMICommandCache; private MIStoppedEvent fCachedStoppedEvent; + private IRunControl fRunControl; public MIStack(DsfSession session) { @@ -150,7 +152,8 @@ public class MIStack extends AbstractDsfService AbstractMIControl miControl = getServicesTracker().getService(AbstractMIControl.class); fMICommandCache = new CommandCache(getSession(), miControl); fMICommandCache.setContextAvailable(miControl.getControlDMContext(), true); - + fRunControl = getServicesTracker().getService(IRunControl.class); + getSession().addServiceEventListener(this, null); register(new String[]{IStack.class.getName(), MIStack.class.getName()}, new Hashtable()); rm.done(); @@ -215,6 +218,13 @@ public class MIStack extends AbstractDsfService return; } + // Make sure the thread is stopped + if (!fRunControl.isSuspended(execDmc)) { + rm.setData(new IFrameDMContext[0]); + rm.done(); + return; + } + if (startIndex == 0 && endIndex == 0) { // Try to retrieve the top stack frame from the cached stopped event. if (fCachedStoppedEvent != null && @@ -604,19 +614,26 @@ public class MIStack extends AbstractDsfService public void getStackDepth(IDMContext dmc, final int maxDepth, final DataRequestMonitor rm) { IMIExecutionDMContext execDmc = DMContexts.getAncestorOfType(dmc, IMIExecutionDMContext.class); if (execDmc != null) { - MIStackInfoDepth depthCommand = null; - if (maxDepth > 0) depthCommand = new MIStackInfoDepth(execDmc, maxDepth); - else depthCommand = new MIStackInfoDepth(execDmc); - - fMICommandCache.execute( - depthCommand, - new DataRequestMonitor(getExecutor(), rm) { - @Override - protected void handleSuccess() { - rm.setData(getData().getDepth()); - rm.done(); - } - }); + // Make sure the thread is stopped + if (!fRunControl.isSuspended(execDmc)) { + rm.setData(0); + rm.done(); + return; + } + + MIStackInfoDepth depthCommand = null; + if (maxDepth > 0) depthCommand = new MIStackInfoDepth(execDmc, maxDepth); + else depthCommand = new MIStackInfoDepth(execDmc); + + fMICommandCache.execute( + depthCommand, + new DataRequestMonitor(getExecutor(), rm) { + @Override + protected void handleSuccess() { + rm.setData(getData().getDepth()); + rm.done(); + } + }); } else { rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, INVALID_HANDLE, "Invalid context", null)); //$NON-NLS-1$ rm.done(); diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIStackNS.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIStackNS.java deleted file mode 100644 index d1b1758433e..00000000000 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIStackNS.java +++ /dev/null @@ -1,678 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2008 Wind River Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Wind River Systems - initial API and implementation - * Ericsson - Modified for handling of multiple execution contexts - *******************************************************************************/ -package org.eclipse.dd.mi.service; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.List; - -import org.eclipse.cdt.core.IAddress; -import org.eclipse.cdt.utils.Addr32; -import org.eclipse.cdt.utils.Addr64; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.dd.dsf.concurrent.CountingRequestMonitor; -import org.eclipse.dd.dsf.concurrent.DataRequestMonitor; -import org.eclipse.dd.dsf.concurrent.RequestMonitor; -import org.eclipse.dd.dsf.datamodel.AbstractDMContext; -import org.eclipse.dd.dsf.datamodel.DMContexts; -import org.eclipse.dd.dsf.datamodel.IDMContext; -import org.eclipse.dd.dsf.debug.service.IRunControl; -import org.eclipse.dd.dsf.debug.service.IStack; -import org.eclipse.dd.dsf.debug.service.IStack2; -import org.eclipse.dd.dsf.debug.service.IRunControl.IExecutionDMContext; -import org.eclipse.dd.dsf.debug.service.IRunControl.IResumedDMEvent; -import org.eclipse.dd.dsf.debug.service.IRunControl.ISuspendedDMEvent; -import org.eclipse.dd.dsf.debug.service.IRunControl.StateChangeReason; -import org.eclipse.dd.dsf.debug.service.command.CommandCache; -import org.eclipse.dd.dsf.service.AbstractDsfService; -import org.eclipse.dd.dsf.service.DsfServiceEventHandler; -import org.eclipse.dd.dsf.service.DsfSession; -import org.eclipse.dd.mi.internal.MIPlugin; -import org.eclipse.dd.mi.service.command.AbstractMIControl; -import org.eclipse.dd.mi.service.command.commands.MIStackInfoDepth; -import org.eclipse.dd.mi.service.command.commands.MIStackListArguments; -import org.eclipse.dd.mi.service.command.commands.MIStackListFrames; -import org.eclipse.dd.mi.service.command.commands.MIStackListLocals; -import org.eclipse.dd.mi.service.command.events.IMIDMEvent; -import org.eclipse.dd.mi.service.command.events.MIEvent; -import org.eclipse.dd.mi.service.command.events.MIStoppedEvent; -import org.eclipse.dd.mi.service.command.output.MIArg; -import org.eclipse.dd.mi.service.command.output.MIFrame; -import org.eclipse.dd.mi.service.command.output.MIStackInfoDepthInfo; -import org.eclipse.dd.mi.service.command.output.MIStackListArgumentsInfo; -import org.eclipse.dd.mi.service.command.output.MIStackListFramesInfo; -import org.eclipse.dd.mi.service.command.output.MIStackListLocalsInfo; -import org.osgi.framework.BundleContext; - -public class MIStackNS extends AbstractDsfService - implements IStack2 -{ - protected static class MIFrameDMC extends AbstractDMContext - implements IFrameDMContext - { - private final int fLevel; - // public MIFrameDMC(MIStack service, int level) { - public MIFrameDMC(String sessionId, IExecutionDMContext execDmc, int level) { - super(sessionId, new IDMContext[] { execDmc }); - fLevel = level; - } - - public int getLevel() { return fLevel; } - - @Override - public boolean equals(Object other) { - return super.baseEquals(other) && ((MIFrameDMC)other).fLevel == fLevel; - } - - @Override - public int hashCode() { - return super.baseHashCode() ^ fLevel; - } - - @Override - public String toString() { - return baseToString() + ".frame[" + fLevel + "]"; //$NON-NLS-1$ //$NON-NLS-2$ - } - } - - protected static class MIVariableDMC extends AbstractDMContext - implements IVariableDMContext - { - public enum Type { ARGUMENT, LOCAL } - final private Type fType; - final private int fIndex; - - public MIVariableDMC(MIStackNS service, IFrameDMContext frame, Type type, int index) { - super(service, new IDMContext[] { frame }); - fIndex = index; - fType = type; - } - - public int getIndex() { return fIndex; } - public Type getType() { return fType; } - - @Override - public boolean equals(Object other) { - return super.baseEquals(other) && - ((MIVariableDMC)other).fType == fType && - ((MIVariableDMC)other).fIndex == fIndex; - } - - @Override - public int hashCode() { - int typeFactor = 0; - if (fType == Type.LOCAL) typeFactor = 2; - else if (fType == Type.ARGUMENT) typeFactor = 3; - return super.baseHashCode() ^ typeFactor ^ fIndex; - } - - @Override - public String toString() { - return baseToString() + ".variable(" + fType + ")[" + fIndex + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - } - } - - private CommandCache fMICommandCache; - private MIStoppedEvent fCachedStoppedEvent; - private IRunControl fRunControl; - - public MIStackNS(DsfSession session) - { - super(session); - } - - @Override - protected BundleContext getBundleContext() - { - return MIPlugin.getBundleContext(); - } - - @Override - public void initialize(final RequestMonitor rm) { - super.initialize( - new RequestMonitor(getExecutor(), rm) { - @Override - protected void handleSuccess() { - doInitialize(rm); - } - }); - } - - private void doInitialize(RequestMonitor rm) { - AbstractMIControl miControl = getServicesTracker().getService(AbstractMIControl.class); - fMICommandCache = new CommandCache(getSession(), miControl); - fMICommandCache.setContextAvailable(miControl.getControlDMContext(), true); - fRunControl = getServicesTracker().getService(IRunControl.class); - - getSession().addServiceEventListener(this, null); - register(new String[]{IStack.class.getName(), MIStackNS.class.getName()}, new Hashtable()); - rm.done(); - } - - @Override - public void shutdown(RequestMonitor rm) - { - unregister(); - getSession().removeServiceEventListener(this); - fMICommandCache.reset(); - super.shutdown(rm); - } - - @SuppressWarnings("unchecked") - public void getModelData(IDMContext dmc, DataRequestMonitor rm) { - if (dmc instanceof MIFrameDMC) { - getFrameData((MIFrameDMC)dmc, (DataRequestMonitor)rm); - // getFrameData invokes rm - } else if (dmc instanceof MIVariableDMC) { - getVariableData((MIVariableDMC)dmc, (DataRequestMonitor)rm); - // getVariablesData invokes rm - } else { - rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, INVALID_HANDLE, "Unknown DMC type", null)); //$NON-NLS-1$ - rm.done(); - } - } - - /** - * Creates a frame context. This method is intended to be used by other MI - * services and sub-classes which need to create a frame context directly. - *

- * Sub-classes can override this method to provide custom stack frame - * context implementation. - *

- * @param execDmc Execution context that this frame is to be a child of. - * @param level Level of the new context. - * @return A new frame context. - */ - public IFrameDMContext createFrameDMContext(IExecutionDMContext execDmc, int level) { - return new MIFrameDMC(getSession().getId(), execDmc, level); - } - - public void getFrames(final IDMContext ctx, final DataRequestMonitor rm) { - getFrames(ctx, 0, ALL_FRAMES, rm); - } - - public void getFrames(final IDMContext ctx, final int startIndex, final int endIndex, final DataRequestMonitor rm) { - - // Make sure we have an execution context (ideally a thread) - final IMIExecutionDMContext execDmc = DMContexts.getAncestorOfType(ctx, IMIExecutionDMContext.class); - if (execDmc == null) { - rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, INVALID_HANDLE, "Invalid context " + ctx, null)); //$NON-NLS-1$ - rm.done(); - return; - } - - // Make sure the indices are OK - if (startIndex < 0 || endIndex > 0 && endIndex < startIndex) { - rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, INVALID_HANDLE, "Invalid stack frame range [" + startIndex + ',' + endIndex + ']', null)); //$NON-NLS-1$ - rm.done(); - return; - } - - // Make sure the thread is stopped - if (!fRunControl.isSuspended(execDmc)) { - rm.setData(new IFrameDMContext[0]); - rm.done(); - return; - } - - // Case of retrieving the top stack frame from the cached stopped event. - if (startIndex == 0 && endIndex == 0) { - if (fCachedStoppedEvent != null && fCachedStoppedEvent.getFrame() != null && - execDmc.equals(fCachedStoppedEvent.getDMContext())) - { - rm.setData(new IFrameDMContext[] { createFrameDMContext(execDmc, fCachedStoppedEvent.getFrame().getLevel()) }); - rm.done(); - return; - } - } - - // Select the proper MI command variant - final MIStackListFrames miStackListCmd; - final int firstIndex; - if (endIndex >= 0) { - miStackListCmd = new MIStackListFrames(execDmc, true, startIndex, endIndex); - firstIndex = startIndex; - } else { - miStackListCmd = new MIStackListFrames(execDmc, true); - firstIndex = 0; - } - - // And go... - fMICommandCache.execute( - miStackListCmd, - new DataRequestMonitor(getExecutor(), rm) { - @Override - protected void handleSuccess() { - rm.setData(getFrames(execDmc, getData(), firstIndex, endIndex, startIndex)); - rm.done(); - } - }); - } - - public void getTopFrame(final IDMContext ctx, final DataRequestMonitor rm) { - final IMIExecutionDMContext execDmc = DMContexts.getAncestorOfType(ctx, IMIExecutionDMContext.class); - if (execDmc == null) { - rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, INVALID_HANDLE, "Invalid context" + ctx, null)); //$NON-NLS-1$ - rm.done(); - return; - } - - // Try to retrieve the top stack frame from the cached stopped event. - if (fCachedStoppedEvent != null && - fCachedStoppedEvent.getFrame() != null && - execDmc.equals(fCachedStoppedEvent.getDMContext())) - { - rm.setData(createFrameDMContext(execDmc, fCachedStoppedEvent.getFrame().getLevel())); - rm.done(); - return; - } - - // If stopped event is not available or doesn't contain frame info, - // query top stack frame - getFrames( - ctx, - 0, - 0, - new DataRequestMonitor(getExecutor(), rm) { - @Override - protected void handleSuccess() { - rm.setData(getData()[0]); - rm.done(); - } - }); - } - - //private MIFrameDMC[] getFrames(DsfMIStackListFramesInfo info) { - private IFrameDMContext[] getFrames(IMIExecutionDMContext execDmc, MIStackListFramesInfo info, int firstIndex, int lastIndex, int startIndex) { - int length = info.getMIFrames().length; - if (lastIndex > 0) { - int limit= lastIndex - startIndex + 1; - if (limit < length) { - length = limit; - } - } - IFrameDMContext[] frameDMCs = new MIFrameDMC[length]; - for (int i = 0; i < length; i++) { - //frameDMCs[i] = new MIFrameDMC(this, info.getMIFrames()[i].getLevel()); - final MIFrame frame= info.getMIFrames()[i + startIndex - firstIndex]; - assert startIndex + i == frame.getLevel(); - frameDMCs[i] = createFrameDMContext(execDmc, frame.getLevel()); - } - return frameDMCs; - } - - - - public void getFrameData(final IFrameDMContext frameDmc, final DataRequestMonitor rm) { - if (!(frameDmc instanceof MIFrameDMC)) { - rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, INVALID_HANDLE, "Invalid context type " + frameDmc, null)); //$NON-NLS-1$ - rm.done(); - return; - } - - final MIFrameDMC miFrameDmc = (MIFrameDMC)frameDmc; - - IMIExecutionDMContext execDmc = DMContexts.getAncestorOfType(frameDmc, IMIExecutionDMContext.class); - if (execDmc == null) { - rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, INVALID_HANDLE, "No execution context found in " + frameDmc, null)); //$NON-NLS-1$ - rm.done(); - return; - } - - /** - * Base class for the IFrameDMData object that uses an MIFrame object to - * provide the data. Sub-classes must provide the MIFrame object - */ - abstract class FrameData implements IFrameDMData - { - abstract protected MIFrame getMIFrame(); - - public IAddress getAddress() { - String addr = getMIFrame().getAddress(); - if (addr.startsWith("0x")) { //$NON-NLS-1$ - addr = addr.substring(2); - } - if (addr.length() <= 8) { - return new Addr32(getMIFrame().getAddress()); - } else { - return new Addr64(getMIFrame().getAddress()); - } - } - - public int getColumn() { return 0; } - - public String getFile() { return getMIFrame().getFile(); } - public int getLine() { return getMIFrame().getLine(); } - public String getFunction() { return getMIFrame().getFunction(); } - - @Override - public String toString() { return getMIFrame().toString(); } - } - - // If requested frame is the top stack frame, try to retrieve it from - // the stopped event data. - class FrameDataFromStoppedEvent extends FrameData { - private final MIStoppedEvent fEvent; - FrameDataFromStoppedEvent(MIStoppedEvent event) { fEvent = event; } - @Override - protected MIFrame getMIFrame() { return fEvent.getFrame(); } - } - - // Retrieve the top stack frame from the stopped event only if the selected thread is the one on which stopped event - // is raised - if (fCachedStoppedEvent != null && - execDmc.equals(fCachedStoppedEvent.getDMContext()) && - miFrameDmc.fLevel == 0 && - fCachedStoppedEvent.getFrame() != null) - { - rm.setData(new FrameDataFromStoppedEvent(fCachedStoppedEvent)); - rm.done(); - return; - } - - // If not, retrieve the full list of frame data. - class FrameDataFromMIStackFrameListInfo extends FrameData { - private MIStackListFramesInfo fFrameDataCacheInfo; - private int fFrameIndex; - - FrameDataFromMIStackFrameListInfo(MIStackListFramesInfo info, int index) { - fFrameDataCacheInfo = info; - fFrameIndex = index; - } - - @Override - protected MIFrame getMIFrame() { return fFrameDataCacheInfo.getMIFrames()[fFrameIndex]; } - } - - fMICommandCache.execute( - new MIStackListFrames(execDmc, true), - new DataRequestMonitor(getExecutor(), rm) { - @Override - protected void handleSuccess() { - // Find the index to the correct MI frame object. - int idx = findFrameIndex(getData().getMIFrames(), miFrameDmc.fLevel); - if (idx == -1) { - rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, INVALID_HANDLE, "Invalid frame " + frameDmc, null)); //$NON-NLS-1$ - rm.done(); - return; - } - - // Create the data object. - rm.setData(new FrameDataFromMIStackFrameListInfo(getData(), idx)); - rm.done(); - } - }); - } - - public void getArguments(final IFrameDMContext frameDmc, final DataRequestMonitor rm) { - final IMIExecutionDMContext execDmc = DMContexts.getAncestorOfType(frameDmc, IMIExecutionDMContext.class); - if (execDmc == null) { - rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, INVALID_HANDLE, "No execution context found in " + frameDmc, null)); //$NON-NLS-1$ - rm.done(); - return; - } - - - // If requested frame is the top stack frame, try to retrieve it from - // the stopped event data. - if (frameDmc.getLevel() == 0 && - fCachedStoppedEvent != null && - fCachedStoppedEvent.getFrame() != null && - execDmc.equals(fCachedStoppedEvent.getDMContext()) && - fCachedStoppedEvent.getFrame().getArgs() != null) - { - rm.setData(makeVariableDMCs( - frameDmc, MIVariableDMC.Type.ARGUMENT, fCachedStoppedEvent.getFrame().getArgs().length)); - rm.done(); - return; - } - - // If not, retrieve the full list of frame data. - fMICommandCache.execute( - new MIStackListArguments(execDmc, true, true), - new DataRequestMonitor(getExecutor(), rm) { - @Override - protected void handleSuccess() { - // Find the index to the correct MI frame object. - // Note: this is a short-cut, but it won't work once we implement retrieving - // partial lists of stack frames. - int idx = frameDmc.getLevel(); - if (idx == -1 || idx >= getData().getMIFrames().length) { - rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, INVALID_STATE, "Invalid frame " + frameDmc, null)); //$NON-NLS-1$ - rm.done(); - return; - } - - // Create the variable array out of MIArg array. - MIArg[] args = getData().getMIFrames()[idx].getArgs(); - if (args == null) args = new MIArg[0]; - rm.setData(makeVariableDMCs(frameDmc, MIVariableDMC.Type.ARGUMENT, args.length)); - rm.done(); - } - }); - } - - public void getVariableData(IVariableDMContext variableDmc, final DataRequestMonitor rm) { - if (!(variableDmc instanceof MIVariableDMC)) { - rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, INVALID_HANDLE, "Invalid context type " + variableDmc, null)); //$NON-NLS-1$ - rm.done(); - return; - } - final MIVariableDMC miVariableDmc = (MIVariableDMC)variableDmc; - - // Extract the frame DMC from the variable DMC. - final MIFrameDMC frameDmc = DMContexts.getAncestorOfType(variableDmc, MIFrameDMC.class); - if (frameDmc == null) { - rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, INVALID_HANDLE, "No frame context found in " + variableDmc, null)); //$NON-NLS-1$ - rm.done(); - return; - } - - final IMIExecutionDMContext execDmc = DMContexts.getAncestorOfType(frameDmc, IMIExecutionDMContext.class); - if (execDmc == null) { - rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, INVALID_HANDLE, "No execution context found in " + frameDmc, null)); //$NON-NLS-1$ - rm.done(); - return; - } - - /** - * Same as with frame objects, this is a base class for the IVariableDMData object that uses an MIArg object to - * provide the data. Sub-classes must supply the MIArg object. - */ - class VariableData implements IVariableDMData { - private MIArg dsfMIArg; - VariableData(MIArg arg){ - dsfMIArg = arg; - } - public String getName() { return dsfMIArg.getName(); } - public String getValue() { return dsfMIArg.getValue(); } - @Override - public String toString() { return dsfMIArg.toString(); } - } - - // Check if the stopped event can be used to extract the variable value. - if (execDmc != null && miVariableDmc.fType == MIVariableDMC.Type.ARGUMENT && - frameDmc.fLevel == 0 && fCachedStoppedEvent != null && fCachedStoppedEvent.getFrame() != null && - execDmc.equals(fCachedStoppedEvent.getDMContext()) && - fCachedStoppedEvent.getFrame().getArgs() != null) - { - if (miVariableDmc.fIndex >= fCachedStoppedEvent.getFrame().getArgs().length) { - rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, -1, "Invalid variable " + miVariableDmc, null)); //$NON-NLS-1$ - rm.done(); - return; - } - - rm.setData(new VariableData(fCachedStoppedEvent.getFrame().getArgs()[miVariableDmc.fIndex])); - rm.done(); - return; - } - - if (miVariableDmc.fType == MIVariableDMC.Type.ARGUMENT){ - fMICommandCache.execute( - new MIStackListArguments(execDmc, true, true), - new DataRequestMonitor(getExecutor(), rm) { - @Override - protected void handleSuccess() { - // Find the correct frame and argument - if ( frameDmc.fLevel >= getData().getMIFrames().length || - miVariableDmc.fIndex >= getData().getMIFrames()[frameDmc.fLevel].getArgs().length ) - { - rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, INVALID_HANDLE, "Invalid variable " + miVariableDmc, null)); //$NON-NLS-1$ - rm.done(); - return; - } - - // Create the data object. - rm.setData(new VariableData(getData().getMIFrames()[frameDmc.fLevel].getArgs()[miVariableDmc.fIndex])); - rm.done(); - }}); - }//if - if (miVariableDmc.fType == MIVariableDMC.Type.LOCAL){ - fMICommandCache.execute( - new MIStackListLocals(frameDmc, true, true), - new DataRequestMonitor(getExecutor(), rm) { - @Override - protected void handleSuccess() { - - // Create the data object. - MIArg[] locals = getData().getLocals(); - if (locals.length > miVariableDmc.fIndex) { - rm.setData(new VariableData(locals[miVariableDmc.fIndex])); - } else { - rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, INVALID_HANDLE, "Invalid variable " + miVariableDmc, null)); //$NON-NLS-1$ - } - rm.done(); - } - }); - - }//if - - } - - private MIVariableDMC[] makeVariableDMCs(IFrameDMContext frame, MIVariableDMC.Type type, int count) { - MIVariableDMC[] variables = new MIVariableDMC[count]; - for (int i = 0; i < count; i++) { - variables[i]= new MIVariableDMC(this, frame, type, i); - } - return variables; - } - - private int findFrameIndex(MIFrame[] frames, int level) { - for (int idx = 0; idx < frames.length; idx++) { - if (frames[idx].getLevel() == level) { - return idx; - } - } - return -1; - } - - - public void getLocals(final IFrameDMContext frameDmc, final DataRequestMonitor rm) { - - final List localsList = new ArrayList(); - - final CountingRequestMonitor countingRm = new CountingRequestMonitor(getExecutor(), rm) { - @Override - protected void handleSuccess() { - rm.setData( localsList.toArray(new IVariableDMContext[localsList.size()]) ); - rm.done(); - } - }; - countingRm.setDoneCount(2); - - getArguments( - frameDmc, - new DataRequestMonitor(getExecutor(), countingRm) { - @Override - protected void handleSuccess() { - localsList.addAll( Arrays.asList(getData()) ); - countingRm.done(); - } - }); - - fMICommandCache.execute( - new MIStackListLocals(frameDmc, true, true), - new DataRequestMonitor(getExecutor(), countingRm) { - @Override - protected void handleSuccess() { - localsList.addAll( Arrays.asList( - makeVariableDMCs(frameDmc, MIVariableDMC.Type.LOCAL, getData().getLocals().length)) ); - countingRm.done(); - } - }); - } - - public void getStackDepth(IDMContext dmc, final int maxDepth, final DataRequestMonitor rm) { - - // Make sure we have an execution context (ideally a thread) - final IMIExecutionDMContext execDmc = DMContexts.getAncestorOfType(dmc, IMIExecutionDMContext.class); - if (execDmc == null) { - rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, INVALID_HANDLE, "Invalid context", null)); //$NON-NLS-1$ - rm.done(); - return; - } - - // Make sure the thread is stopped - if (!fRunControl.isSuspended(execDmc)) { - rm.setData(0); - rm.done(); - return; - } - - // Select the proper MI command variant - MIStackInfoDepth depthCommand = null; - if (maxDepth > 0) { - depthCommand = new MIStackInfoDepth(execDmc, true, maxDepth); - } - else { - depthCommand = new MIStackInfoDepth(execDmc); - } - - // And go... - fMICommandCache.execute( - depthCommand, - new DataRequestMonitor(getExecutor(), rm) { - @Override - protected void handleSuccess() { - rm.setData(getData().getDepth()); - rm.done(); - } - }); - } - - // IServiceEventListener - @DsfServiceEventHandler - public void eventDispatched(IResumedDMEvent e) { - fMICommandCache.setContextAvailable(e.getDMContext(), false); - if (e.getReason() != StateChangeReason.STEP) { - fCachedStoppedEvent = null; - fMICommandCache.reset(); - } - } - - @DsfServiceEventHandler - public void eventDispatched(ISuspendedDMEvent e) { - fMICommandCache.setContextAvailable(e.getDMContext(), true); - fMICommandCache.reset(); - } - - @DsfServiceEventHandler - public void eventDispatched(IMIDMEvent e) { - MIEvent miEvent = e.getMIEvent(); - if (miEvent instanceof MIStoppedEvent) { - fCachedStoppedEvent = (MIStoppedEvent)miEvent; - } - } - -} diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/AbstractMIControl.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/AbstractMIControl.java index bc5830e23ed..4ac33dc628c 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/AbstractMIControl.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/AbstractMIControl.java @@ -75,8 +75,13 @@ public abstract class AbstractMIControl extends AbstractDsfService private TxThread fTxThread; private RxThread fRxThread; - private int fCurrentStackLevel = -1; - private int fCurrentThreadId = -1; + // MI did not always support the --thread/--frame options + // This boolean is used to know if we should use -thread-select and -stack-select-frame instead + private boolean fUseThreadAndFrameOptions; + // currentStackLevel and currentThreadId are only necessary when + // we must use -thread-select and -stack-select-frame + private int fCurrentStackLevel = -1; + private String fCurrentThreadId = null; private final BlockingQueue fTxCommands = new LinkedBlockingQueue(); @@ -112,11 +117,13 @@ public abstract class AbstractMIControl extends AbstractDsfService public AbstractMIControl(DsfSession session) { super(session); fId = ""; //$NON-NLS-1$ + fUseThreadAndFrameOptions = false; } - public AbstractMIControl(DsfSession session, String id) { + public AbstractMIControl(DsfSession session, String id, boolean useThreadAndFrameOptions) { super(session); fId = id; + fUseThreadAndFrameOptions = useThreadAndFrameOptions; } /** @@ -250,36 +257,42 @@ public abstract class AbstractMIControl extends AbstractDsfService if (handle != null) { processCommandSent(handle); - // Identify target thread/frame (we might have to update them at the target) - final IDMContext targetContext = handle.fCommand.getContext(); - final int targetThread = (handle.getThreadId() != null) ? handle.getThreadId().intValue() : -1; - final int targetFrame = (handle.getStackFrameId() != null) ? handle.getStackFrameId().intValue() : -1; + // Older debuggers didn't support the --thread/--frame options + // Also, not all commands support those options (e.g., CLI commands) + if (!fUseThreadAndFrameOptions || !handle.getCommand().supportsThreadAndFrameOptions()) { + // Without the --thread/--frame, we need to send the proper + // -thread-select and -stack-frame-select before sending the command + + final IDMContext targetContext = handle.fCommand.getContext(); + final String targetThread = handle.getThreadId(); + final int targetFrame = handle.getStackFrameId(); - // The thread-select and frame-select make sense only if the thread is stopped. - // Some non-stop commands don't require the thread to be stopped so we send the - // command anyway. - IRunControl runControl = getServicesTracker().getService(IRunControl.class); - IMIExecutionDMContext execDmc = DMContexts.getAncestorOfType(targetContext, IMIExecutionDMContext.class); - if (runControl != null && execDmc != null && runControl.isSuspended(execDmc)) { - // Before the command is sent, Check the Thread Id and send it to - // the queue only if the id has been changed. - if (targetThread > 0 && targetThread != fCurrentThreadId) { - fCurrentThreadId = targetThread; - resetCurrentStackLevel(); - CommandHandle cmdHandle = new CommandHandle(new MIThreadSelect(execDmc), null); - cmdHandle.generateTokenId(); - fTxCommands.add(cmdHandle); - } + // The thread-select and frame-select make sense only if the thread is stopped. + IRunControl runControl = getServicesTracker().getService(IRunControl.class); + IMIExecutionDMContext execDmc = DMContexts.getAncestorOfType(targetContext, IMIExecutionDMContext.class); + if (runControl != null && execDmc != null && runControl.isSuspended(execDmc)) { + // Before the command is sent, Check the Thread Id and send it to + // the queue only if the id has been changed. Also, don't send a threadId of 0, + // because that id is only used internally for single-threaded programs + if (targetThread != null && !targetThread.equals("0") && !targetThread.equals(fCurrentThreadId)) { //$NON-NLS-1$ + fCurrentThreadId = targetThread; + resetCurrentStackLevel(); + CommandHandle cmdHandle = new CommandHandle(new MIThreadSelect(targetContext, targetThread), null); + cmdHandle.generateTokenId(); + fTxCommands.add(cmdHandle); + } - // Before the command is sent, Check the Stack level and send it to - // the queue only if the level has been changed. - if (targetFrame != -1 && targetFrame != fCurrentStackLevel) { - fCurrentStackLevel = targetFrame; - CommandHandle cmdHandle = new CommandHandle(new MIStackSelectFrame(execDmc, targetFrame), null); - cmdHandle.generateTokenId(); - fTxCommands.add(cmdHandle); - } + // Before the command is sent, Check the Stack level and send it to + // the queue only if the level has been changed. + if (targetFrame >= 0 && targetFrame != fCurrentStackLevel) { + fCurrentStackLevel = targetFrame; + CommandHandle cmdHandle = new CommandHandle(new MIStackSelectFrame(targetContext, targetFrame), null); + cmdHandle.generateTokenId(); + fTxCommands.add(cmdHandle); + } + } } + handle.generateTokenId(); fTxCommands.add(handle); } @@ -449,18 +462,17 @@ public abstract class AbstractMIControl extends AbstractDsfService public void generateTokenId() { fTokenId = getNewTokenId(); } public Integer getTokenId() { return fTokenId; } - //public String getThreadId() { return null; } - public Integer getStackFrameId() { + public int getStackFrameId() { IFrameDMContext frameCtx = DMContexts.getAncestorOfType(fCommand.getContext(), IFrameDMContext.class); if(frameCtx != null) return frameCtx.getLevel(); - return null; + return -1; } - public Integer getThreadId() { + public String getThreadId() { IMIExecutionDMContext execCtx = DMContexts.getAncestorOfType(fCommand.getContext(), IMIExecutionDMContext.class); if(execCtx != null) - return execCtx.getThreadId(); + return Integer.toString(execCtx.getThreadId()); return null; } @@ -516,8 +528,15 @@ public abstract class AbstractMIControl extends AbstractDsfService /* * Construct the new command and push this command out the pipeline. */ - - final String str = commandHandle.getTokenId() + commandHandle.getCommand().constructCommand(); + + final String str; + // Not all commands support the --thread/--frame options (e.g., CLI commands) + if (fUseThreadAndFrameOptions && commandHandle.getCommand().supportsThreadAndFrameOptions()) { + str = commandHandle.getTokenId() + commandHandle.getCommand().constructCommand(commandHandle.getThreadId(), + commandHandle.getStackFrameId()); + } else { + str = commandHandle.getTokenId() + commandHandle.getCommand().constructCommand(); + } try { if (fOutputStream != null) { @@ -763,8 +782,10 @@ public abstract class AbstractMIControl extends AbstractDsfService } } + // we keep track of currentStackLevel and currentThreadId because in + // some cases we must use -thread-select and -stack-select-frame public void resetCurrentThreadLevel(){ - fCurrentThreadId = -1; + fCurrentThreadId = null; } public void resetCurrentStackLevel(){ diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/CLICommand.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/CLICommand.java index d817934babe..664a1e4aac6 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/CLICommand.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/CLICommand.java @@ -23,4 +23,8 @@ public class CLICommand extends MICommand public CLICommand(IDMContext ctx, String oper) { super(ctx, oper); } + + @Override + public boolean supportsThreadAndFrameOptions() { return false; } + } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MICommand.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MICommand.java index 91c8e41dd45..39b1a4e5d17 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MICommand.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MICommand.java @@ -43,19 +43,11 @@ public class MICommand implements ICommand { /* * Constructors. */ - - /*public DsfMICommand(String operation) { - this(operation, empty, empty); - }*/ - + public MICommand(IDMContext ctx, String operation) { this(ctx, operation, empty, empty); } - /*public DsfMICommand(String operation, String[] options) { - this(operation, options, empty); - }*/ - public MICommand(IDMContext ctx, String operation, String[] options) { this(ctx, operation, options, empty); } @@ -137,10 +129,27 @@ public class MICommand implements ICommand { } /* - * Returns the constructed command. + * Returns the constructed command without using the --thread/--frame options. */ public String constructCommand() { + return constructCommand(null, -1); + } + /* + * Returns the constructed command potentially using the --thread/--frame options. + */ + public String constructCommand(String threadId, int frameId) { StringBuffer command = new StringBuffer(getOperation()); + + // Add the --thread option + if (threadId != null) { + command.append(" --thread " + threadId); //$NON-NLS-1$ + + // Add the --frame option, but only if we are using the --thread option + if (frameId >= 0) { + command.append(" --frame " + frameId); //$NON-NLS-1$ + } + } + String opt = optionsToString(); if (opt.length() > 0) { command.append(' ').append(opt); @@ -225,6 +234,7 @@ public class MICommand implements ICommand { return false; } + public boolean supportsThreadAndFrameOptions() { return true; } /** * Compare commands based on the MI command string that they generate, diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecContinue.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecContinue.java index 2d3aea84d00..180dc319d1f 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecContinue.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecContinue.java @@ -17,7 +17,7 @@ import org.eclipse.dd.mi.service.command.output.MIInfo; /** * - * -exec-continue [--thread ] + * -exec-continue [--all] * * Asynchronous command. Resumes the execution of the inferior program * until a breakpoint is encountered, or until the inferior exits. @@ -35,8 +35,4 @@ public class MIExecContinue extends MICommand setParameters(new String[] { "--all" }); //$NON-NLS-1$ } } - - public MIExecContinue(IExecutionDMContext dmc, int threadId) { - super(dmc, "-exec-continue", new String[] { "--thread", Integer.toString(threadId) }); //$NON-NLS-1$ //$NON-NLS-2$ - } } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecInterrupt.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecInterrupt.java index 35643e96d8a..a031fc02207 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecInterrupt.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecInterrupt.java @@ -14,12 +14,11 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.IRunControl.IExecutionDMContext; -import org.eclipse.dd.mi.service.IMIExecutionDMContext; import org.eclipse.dd.mi.service.command.output.MIInfo; /** * - * -exec-interrupt [ --thread | --all ] + * -exec-interrupt [--all] * * Asynchronous command. Interrupts the background execution of the * target. Note how the token associated with the stop message is the one @@ -41,11 +40,4 @@ public class MIExecInterrupt extends MICommand setParameters(new String[] { "--all" }); //$NON-NLS-1$ } } - - public MIExecInterrupt(IMIExecutionDMContext dmc, boolean setThread) { - super(dmc, "-exec-interrupt"); //$NON-NLS-1$ - if (setThread) { - setParameters(new String[] { "--thread", Integer.toString(dmc.getThreadId()) }); //$NON-NLS-1$ - } - } } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecNext.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecNext.java index 22684c18cb4..308045079df 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecNext.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecNext.java @@ -14,12 +14,11 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.IRunControl.IExecutionDMContext; -import org.eclipse.dd.mi.service.IMIExecutionDMContext; import org.eclipse.dd.mi.service.command.output.MIInfo; /** * - * -exec-next [--thread ] [count] + * -exec-next [count] * * Asynchronous command. Resumes execution of the inferior program, * stopping when the beginning of the next source line is reached. @@ -34,17 +33,4 @@ public class MIExecNext extends MICommand public MIExecNext(IExecutionDMContext dmc, int count) { super(dmc, "-exec-next", new String[] { Integer.toString(count) }); //$NON-NLS-1$ } - - public MIExecNext(IMIExecutionDMContext dmc, boolean setThread) { - this(dmc, setThread, 1); - } - - public MIExecNext(IMIExecutionDMContext dmc, boolean setThread, int count) { - super(dmc, "-exec-next"); //$NON-NLS-1$ - if (setThread) { - setParameters(new String[] { "--thread", Integer.toString(dmc.getThreadId()), Integer.toString(count) }); //$NON-NLS-1$ - } else { - setParameters(new String[] { Integer.toString(count) }); - } - } } \ No newline at end of file diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecNextInstruction.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecNextInstruction.java index 78dd5994558..fb7fa49e8d4 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecNextInstruction.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecNextInstruction.java @@ -13,12 +13,11 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.IRunControl.IExecutionDMContext; -import org.eclipse.dd.mi.service.IMIExecutionDMContext; import org.eclipse.dd.mi.service.command.output.MIInfo; /** * - * -exec-next-instruction + * -exec-next-instruction [count] * * Asynchronous command. Executes one machine instruction. If the * instruction is a function call continues until the function returns. If @@ -35,17 +34,4 @@ public class MIExecNextInstruction extends MICommand public MIExecNextInstruction(IExecutionDMContext dmc, int count) { super(dmc, "-exec-next-instruction", new String[] { Integer.toString(count) }); //$NON-NLS-1$ } - - public MIExecNextInstruction(IMIExecutionDMContext dmc, boolean setThread) { - this(dmc, setThread, 1); - } - - public MIExecNextInstruction(IMIExecutionDMContext dmc, boolean setThread, int count) { - super(dmc, "-exec-next-instruction"); //$NON-NLS-1$ - if (setThread) { - setParameters(new String[] { "--thread", Integer.toString(dmc.getThreadId()), Integer.toString(count) }); //$NON-NLS-1$ - } else { - setParameters(new String[] { Integer.toString(count) }); - } - } } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecReturn.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecReturn.java index 8aad9a89a50..01788dd4db7 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecReturn.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecReturn.java @@ -17,7 +17,7 @@ import org.eclipse.dd.mi.service.command.output.MIInfo; /** * - * -exec-return [args] + * -exec-return [arg] * *

* Makes current function return immediately. Doesn't execute the diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecStep.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecStep.java index aff568b481a..5f13f8b4b92 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecStep.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecStep.java @@ -14,12 +14,11 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.IRunControl.IExecutionDMContext; -import org.eclipse.dd.mi.service.IMIExecutionDMContext; import org.eclipse.dd.mi.service.command.output.MIInfo; /** * - * -exec-step [--thread ] [count] + * -exec-step [count] * * Asynchronous command. Resumes execution of the inferior program, * stopping when the beginning of the next source line is reached, if the @@ -36,17 +35,4 @@ public class MIExecStep extends MICommand public MIExecStep(IExecutionDMContext dmc, int count) { super(dmc, "-exec-step", new String[] { Integer.toString(count) }); //$NON-NLS-1$ } - - public MIExecStep(IMIExecutionDMContext dmc, boolean setThread) { - this(dmc, setThread, 1); - } - - public MIExecStep(IMIExecutionDMContext dmc, boolean setThread, int count) { - super(dmc, "-exec-step"); //$NON-NLS-1$ - if (setThread) { - setParameters(new String[] { "--thread", Integer.toString(dmc.getThreadId()), Integer.toString(count) }); //$NON-NLS-1$ - } else { - setParameters(new String[] { Integer.toString(count) }); - } - } } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecStepInstruction.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecStepInstruction.java index aef3a6f4f56..df10980d0f5 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecStepInstruction.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecStepInstruction.java @@ -13,12 +13,11 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.IRunControl.IExecutionDMContext; -import org.eclipse.dd.mi.service.IMIExecutionDMContext; import org.eclipse.dd.mi.service.command.output.MIInfo; /** * - * -exec-step-instruction [--thread ] [count] + * -exec-step-instruction [count] * Asynchronous command. Resumes the inferior which executes one * machine instruction. The output, once GDB has stopped, will vary @@ -36,17 +35,4 @@ public class MIExecStepInstruction extends MICommand public MIExecStepInstruction(IExecutionDMContext dmc, int count) { super(dmc, "-exec-step-instruction", new String[] { Integer.toString(count) }); //$NON-NLS-1$ } - - public MIExecStepInstruction(IMIExecutionDMContext dmc, boolean setThread) { - this(dmc, setThread, 1); - } - - public MIExecStepInstruction(IMIExecutionDMContext dmc, boolean setThread, int count) { - super(dmc, "-exec-step-instruction"); //$NON-NLS-1$ - if (setThread) { - setParameters(new String[] { "--thread", Integer.toString(dmc.getThreadId()), Integer.toString(count) }); //$NON-NLS-1$ - } else { - setParameters(new String[] { Integer.toString(count) }); - } - } } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecUntil.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecUntil.java index 8f09706aa2e..46e37c1078b 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecUntil.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecUntil.java @@ -14,12 +14,11 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.IRunControl.IExecutionDMContext; -import org.eclipse.dd.mi.service.IMIExecutionDMContext; import org.eclipse.dd.mi.service.command.output.MIInfo; /** * - * -exec-until [--thread ] [ LOCATION ] + * -exec-until [ LOCATION ] * * Asynchronous command. Executes the inferior until the LOCATION * specified in the argument is reached. If there is no argument, the @@ -37,20 +36,4 @@ public class MIExecUntil extends MICommand public MIExecUntil(IExecutionDMContext dmc, String loc) { super(dmc, "-exec-until", new String[] { loc }); //$NON-NLS-1$ } - - public MIExecUntil(IMIExecutionDMContext dmc, boolean setThread) { - super(dmc, "-exec-until"); //$NON-NLS-1$ - if (setThread) { - setParameters(new String[] { "--thread", Integer.toString(dmc.getThreadId()) }); //$NON-NLS-1$ - } - } - - public MIExecUntil(IMIExecutionDMContext dmc, boolean setThread, String loc) { - super(dmc, "-exec-until"); //$NON-NLS-1$ - if (setThread) { - setParameters(new String[] { "--thread", Integer.toString(dmc.getThreadId()), loc }); //$NON-NLS-1$ - } else { - setParameters(new String[] { loc }); - } - } } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIStackInfoDepth.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIStackInfoDepth.java index 1bffb4120cb..b7f2a476340 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIStackInfoDepth.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIStackInfoDepth.java @@ -17,7 +17,7 @@ import org.eclipse.dd.mi.service.command.output.MIStackInfoDepthInfo; /** * - * -stack-info-depth [--thread ] [maxDepth] + * -stack-info-depth [maxDepth] * * */ @@ -25,28 +25,11 @@ public class MIStackInfoDepth extends MICommand { public MIStackInfoDepth(IMIExecutionDMContext ctx) { - this(ctx, false); - } - - public MIStackInfoDepth(IMIExecutionDMContext ctx, boolean setThread) { super(ctx, "-stack-info-depth"); //$NON-NLS-1$ - if (setThread) { - setParameters(new String[] { "--thread", Integer.toString(ctx.getThreadId()) }); //$NON-NLS-1$ - } } public MIStackInfoDepth(IMIExecutionDMContext ctx, int maxDepth) { - this(ctx, false, maxDepth); - } - - public MIStackInfoDepth(IMIExecutionDMContext ctx, boolean setThread, int maxDepth) { - super(ctx, "-stack-info-depth"); //$NON-NLS-1$ - if (setThread) { - setParameters(new String[] { "--thread", Integer.toString(ctx.getThreadId()), Integer.toString(maxDepth) }); //$NON-NLS-1$ - } - else { - setParameters(new String[] { Integer.toString(maxDepth) }); - } + super(ctx, "-stack-info-depth", new String[]{Integer.toString(maxDepth)}); //$NON-NLS-1$ } @Override diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIStackListArguments.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIStackListArguments.java index c7b1c774ad8..700eb2684c5 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIStackListArguments.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIStackListArguments.java @@ -20,7 +20,7 @@ import org.eclipse.dd.mi.service.command.output.MIStackListArgumentsInfo; /** * - * -stack-list-arguments [--thread ] SHOW-VALUES + * -stack-list-arguments SHOW-VALUES * [ LOW-FRAME HIGH-FRAME ] * * Display a list of the arguments for the frames between LOW-FRAME and @@ -35,16 +35,7 @@ import org.eclipse.dd.mi.service.command.output.MIStackListArgumentsInfo; public class MIStackListArguments extends MICommand { public MIStackListArguments(IMIExecutionDMContext execDmc, boolean showValues) { - this(execDmc, false, showValues); - } - - public MIStackListArguments(IMIExecutionDMContext execDmc, boolean setThread, boolean showValues) { - super(execDmc, "-stack-list-arguments"); //$NON-NLS-1$ - if (setThread) { - setParameters(new String[] { "--thread", Integer.toString(execDmc.getThreadId()), showValues ? "1" : "0" } ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - } else { - setParameters(new String[] { showValues ? "1" : "0" } ); //$NON-NLS-1$ //$NON-NLS-2$ - } + super(execDmc, "-stack-list-arguments", new String[] { showValues ? "1" : "0" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } public MIStackListArguments(IFrameDMContext frameDmc, boolean showValues) { @@ -52,18 +43,8 @@ public class MIStackListArguments extends MICommand } public MIStackListArguments(IMIExecutionDMContext execDmc, boolean showValues, int low, int high) { - this(execDmc, false, showValues, low, high); - } - - public MIStackListArguments(IMIExecutionDMContext execDmc, boolean setThread, boolean showValues, int low, int high) { - super(execDmc, "-stack-list-arguments"); //$NON-NLS-1$ - if (setThread) { - setParameters(new String[] { "--thread", Integer.toString(execDmc.getThreadId()), //$NON-NLS-1$ - showValues ? "1" : "0", Integer.toString(low), Integer.toString(high) } ); //$NON-NLS-1$ //$NON-NLS-2$ - } else { - setParameters(new String[] { - showValues ? "1" : "0", Integer.toString(low), Integer.toString(high) } ); //$NON-NLS-1$ //$NON-NLS-2$ - } + super(execDmc, "-stack-list-arguments", //$NON-NLS-1$ + new String[] {showValues ? "1" : "0", Integer.toString(low), Integer.toString(high)}); //$NON-NLS-1$ //$NON-NLS-2$ } @Override diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIStackListFrames.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIStackListFrames.java index 9b578ae5b30..e2a1a620220 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIStackListFrames.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIStackListFrames.java @@ -54,27 +54,11 @@ import org.eclipse.dd.mi.service.command.output.MIStackListFramesInfo; public class MIStackListFrames extends MICommand { public MIStackListFrames(IMIExecutionDMContext execDmc) { - this(execDmc, false); - } - - public MIStackListFrames(IMIExecutionDMContext execDmc, boolean setThread) { super(execDmc, "-stack-list-frames"); //$NON-NLS-1$ - if (setThread) { - setParameters(new String[] { "--thread", Integer.toString(execDmc.getThreadId()) } ); //$NON-NLS-1$ - } } public MIStackListFrames(IMIExecutionDMContext execDmc, int low, int high) { - this(execDmc, false, low, high); - } - - public MIStackListFrames(IMIExecutionDMContext execDmc, boolean setThread, int low, int high) { - super(execDmc, "-stack-list-frames"); //$NON-NLS-1$ - if (setThread) { - setParameters(new String[] { "--thread", Integer.toString(execDmc.getThreadId()), Integer.toString(low), Integer.toString(high) } ); //$NON-NLS-1$ - } else { - setParameters(new String[] { Integer.toString(low), Integer.toString(high) } ); - } + super(execDmc, "-stack-list-frames", new String[] { Integer.toString(low), Integer.toString(high) }); //$NON-NLS-1$ } @Override diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIStackListLocals.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIStackListLocals.java index 9dbfbb90ec7..a26ed496440 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIStackListLocals.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIStackListLocals.java @@ -13,9 +13,7 @@ package org.eclipse.dd.mi.service.command.commands; -import org.eclipse.dd.dsf.datamodel.DMContexts; import org.eclipse.dd.dsf.debug.service.IStack.IFrameDMContext; -import org.eclipse.dd.mi.service.IMIExecutionDMContext; import org.eclipse.dd.mi.service.command.output.MIOutput; import org.eclipse.dd.mi.service.command.output.MIStackListLocalsInfo; @@ -32,19 +30,9 @@ public class MIStackListLocals extends MICommand { public MIStackListLocals(IFrameDMContext frameCtx, boolean printValues) { - this(frameCtx, false, printValues); + super(frameCtx, "-stack-list-locals", new String[] { printValues ? "1" : "0" } ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } - public MIStackListLocals(IFrameDMContext frameCtx, boolean setThread, boolean printValues) { - super(frameCtx, "-stack-list-locals"); //$NON-NLS-1$ - IMIExecutionDMContext execDmc = DMContexts.getAncestorOfType(frameCtx, IMIExecutionDMContext.class); - if (setThread && execDmc != null) { - setParameters(new String[] { "--thread", Integer.toString(execDmc.getThreadId()), printValues ? "1" : "0" } ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - } else { - setParameters(new String[] { printValues ? "1" : "0" } ); //$NON-NLS-1$ //$NON-NLS-2$ - } - } - @Override public MIStackListLocalsInfo getResult(MIOutput out) { return new MIStackListLocalsInfo(out); diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIStackSelectFrame.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIStackSelectFrame.java index 5518359ba1c..033379cb773 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIStackSelectFrame.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIStackSelectFrame.java @@ -28,8 +28,4 @@ public class MIStackSelectFrame extends MICommand { public MIStackSelectFrame(IDMContext ctx, int frameNum) { super(ctx, "-stack-select-frame", new String[]{Integer.toString(frameNum)}, new String[0]); //$NON-NLS-1$ } - - public MIStackSelectFrame(IDMContext ctx, int threadNum, int frameNum) { - super(ctx, "-stack-select-frame", new String[]{ "--thread", Integer.toString(threadNum), Integer.toString(frameNum) }); //$NON-NLS-1$ //$NON-NLS-2$ - } } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MITargetSelect.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MITargetSelect.java index e0071c19626..2d55e7bc333 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MITargetSelect.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MITargetSelect.java @@ -19,11 +19,11 @@ import org.eclipse.dd.mi.service.command.output.MIInfo; public class MITargetSelect extends MICommand { public MITargetSelect(IDMContext ctx, String host, String port) { - super(ctx, "-target-select extended-remote " + host + ":" + port); //$NON-NLS-1$ //$NON-NLS-2$ + super(ctx, "-target-select extended-remote", new String[] {host + ":" + port}); //$NON-NLS-1$ //$NON-NLS-2$ } public MITargetSelect(IDMContext ctx, String serialDevice) { - super(ctx, "-target-select extended-remote " + serialDevice); //$NON-NLS-1$ + super(ctx, "-target-select extended-remote", new String[] {serialDevice}); //$NON-NLS-1$ } } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIThreadSelect.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIThreadSelect.java index 5a3a50569d9..0f1fce70f2b 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIThreadSelect.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIThreadSelect.java @@ -13,7 +13,6 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.datamodel.IDMContext; -import org.eclipse.dd.mi.service.IMIExecutionDMContext; import org.eclipse.dd.mi.service.command.output.MIInfo; @@ -28,12 +27,12 @@ import org.eclipse.dd.mi.service.command.output.MIInfo; public class MIThreadSelect extends MICommand { - @Deprecated public MIThreadSelect(IDMContext ctx, int threadNum) { super(ctx, "-thread-select", new String[]{Integer.toString(threadNum)}); //$NON-NLS-1$ } - - public MIThreadSelect(IMIExecutionDMContext ctx) { - super(ctx, "-thread-select", new String[]{Integer.toString(ctx.getThreadId())}); //$NON-NLS-1$ + + public MIThreadSelect(IDMContext ctx, String threadNum) { + super(ctx, "-thread-select", new String[]{threadNum}); //$NON-NLS-1$ } + } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/RawCommand.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/RawCommand.java index 2e5c86fe787..0e7fcaea216 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/RawCommand.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/RawCommand.java @@ -27,6 +27,9 @@ public class RawCommand extends MICommand { fRaw = operation; } + @Override + public boolean supportsThreadAndFrameOptions() { return false; } + /* (non-Javadoc) * @see org.eclipse.cdt.debug.mi.core.command.Command#getMIOutput() */