diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java index 7bf9bb7b584..1106648527a 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java @@ -323,7 +323,7 @@ public class GDBControl extends AbstractMIControl implements IGDBControl { // When doing remote debugging, we use -exec-continue instead of -exec-run execCommand = getCommandFactory().createMIExecContinue(containerDmc); } else { - execCommand = getCommandFactory().createMIExecRun(containerDmc, new String[0]); + execCommand = getCommandFactory().createMIExecRun(containerDmc); } boolean stopInMain = false; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl_7_0.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl_7_0.java index a5aada80d7e..3e75f2e6e9f 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl_7_0.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl_7_0.java @@ -364,7 +364,7 @@ public class GDBControl_7_0 extends AbstractMIControl implements IGDBControl { // When doing remote debugging, we use -exec-continue instead of -exec-run fExecCommand = getCommandFactory().createMIExecContinue(fContainerDmc); } else { - fExecCommand = getCommandFactory().createMIExecRun(fContainerDmc, new String[0]); + fExecCommand = getCommandFactory().createMIExecRun(fContainerDmc); } rm.done(); }}, diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIBreakAfter.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIBreakAfter.java index 92dcd8ad205..3bd00025ae0 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIBreakAfter.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIBreakAfter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Ericsson and others. + * Copyright (c) 2007, 2010 Ericsson 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 @@ -26,7 +26,6 @@ import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; public class MIBreakAfter extends MICommand { public MIBreakAfter(IBreakpointsTargetDMContext ctx, int breakpoint, int ignoreCount) { - super(ctx, "-break-after"); //$NON-NLS-1$ - setParameters(new String[] { Integer.toString(breakpoint), Integer.toString(ignoreCount) }); + super(ctx, "-break-after", new String[] { Integer.toString(breakpoint), Integer.toString(ignoreCount) }); //$NON-NLS-1$ } } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MICommand.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MICommand.java index a389d372ea7..c865b62b6dc 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MICommand.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MICommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 QNX Software Systems and others. + * Copyright (c) 2000, 2010 QNX Software 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 @@ -48,8 +48,8 @@ public class MICommand implements ICommand { this(ctx, operation, empty, empty); } - public MICommand(IDMContext ctx, String operation, String[] options) { - this(ctx, operation, options, empty); + public MICommand(IDMContext ctx, String operation, String[] params) { + this(ctx, operation, empty, params); } public MICommand(IDMContext ctx, String operation, String[] options, String[] params) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIEnvironmentDirectory.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIEnvironmentDirectory.java index 2539cd953bc..e7621b526a5 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIEnvironmentDirectory.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIEnvironmentDirectory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005, 2008 QNX Software Systems and others. + * Copyright (c) 2000, 2010 QNX Software 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 @@ -25,23 +25,10 @@ import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; public class MIEnvironmentDirectory extends MICommand { public MIEnvironmentDirectory(IDMContext ctx, String[] paths, boolean reset) { - super(ctx, "-environment-directory"); //$NON-NLS-1$ + super(ctx, "-environment-directory", paths); //$NON-NLS-1$ - String[] options; if (reset) { - if (paths == null) { - options = new String[] {"-r"}; //$NON-NLS-1$ - } else { - options = new String[paths.length + 1]; - options[0] = "-r"; //$NON-NLS-1$ - for (int i = 1; i < options.length; i++) { - options[i] = paths[i-1]; - } - } - } else { - options = paths; + setOptions(new String[] {"-r"}); //$NON-NLS-1$ } - - setOptions(options); } } \ No newline at end of file diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIExecRun.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIExecRun.java index 3d4ed3a1118..993d5ea24cd 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIExecRun.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIExecRun.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 QNX Software Systems and others. + * Copyright (c) 2000, 2010 QNX Software 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 @@ -18,12 +18,14 @@ import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; /** * - * -exec-run + * -exec-run [ARGS] * * Asynchronous command. Starts execution of the inferior from the * beginning. The inferior executes until either a breakpoint is * encountered or the program exits. * + * ARGS will be passed to the inferior. This option is not documented. + * */ public class MIExecRun extends MICommand { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIInterpreterExec.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIInterpreterExec.java index 9e5690e79a2..96140b773f2 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIInterpreterExec.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIInterpreterExec.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 QNX Software Systems and others. + * Copyright (c) 2000, 2010 QNX Software 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 @@ -38,7 +38,7 @@ public class MIInterpreterExec extends MICommand { * @param oper */ public MIInterpreterExec(IDMContext ctx, String interpreter, String cmd) { - super(ctx, "-interpreter-exec", new String[]{interpreter}, new String[] {cmd}); //$NON-NLS-1$ + super(ctx, "-interpreter-exec", new String[] {interpreter, cmd}); //$NON-NLS-1$ } } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIStackSelectFrame.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIStackSelectFrame.java index 6df31568792..2303559e5c7 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIStackSelectFrame.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIStackSelectFrame.java @@ -26,7 +26,7 @@ import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; 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$ + super(ctx, "-stack-select-frame", new String[]{Integer.toString(frameNum)}); //$NON-NLS-1$ } @Override diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIThreadSelect.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIThreadSelect.java index d0639a7eab3..181b797c0e2 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIThreadSelect.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIThreadSelect.java @@ -28,7 +28,7 @@ import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; public class MIThreadSelect extends MICommand { public MIThreadSelect(IDMContext ctx, int threadNum) { - super(ctx, "-thread-select", new String[]{Integer.toString(threadNum)}); //$NON-NLS-1$ + this(ctx, Integer.toString(threadNum)); } /** diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIVarUpdate.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIVarUpdate.java index 2adc1d0e142..62068ab38e0 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIVarUpdate.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIVarUpdate.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 QNX Software Systems and others. + * Copyright (c) 2000, 2010 QNX Software 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 @@ -35,7 +35,7 @@ public class MIVarUpdate extends MICommand { * @since 1.1 */ public MIVarUpdate(ICommandControlDMContext dmc, String name) { - super(dmc, "-var-update", new String[] { "1" }, new String[] { name }); //$NON-NLS-1$//$NON-NLS-2$ + super(dmc, "-var-update", new String[] { "1", name }); //$NON-NLS-1$//$NON-NLS-2$ } @Override