From 412b53da8a7b57f1f46c6bd7aa86250de139d193 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Tue, 30 Nov 2010 00:39:43 +0000 Subject: [PATCH] Bug 329724 - DSF-GDB launcher fails if there are newlines between command line arguments --- .../command/commands/MIGDBSetArgs.java | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIGDBSetArgs.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIGDBSetArgs.java index f0d78f8650e..39b8a6eb660 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIGDBSetArgs.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIGDBSetArgs.java @@ -7,6 +7,7 @@ * * Contributors: * Ericsson - Initial API and implementation + * Sergey Prigogin (Google) *******************************************************************************/ package org.eclipse.cdt.dsf.mi.service.command.commands; @@ -14,30 +15,35 @@ package org.eclipse.cdt.dsf.mi.service.command.commands; import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; /** - * * -gdb-set args ARGS * * Set the inferior program arguments, to be used in the next `-exec-run'. * @since 1.1 - * */ -public class MIGDBSetArgs extends MIGDBSet -{ +public class MIGDBSetArgs extends MIGDBSet { public MIGDBSetArgs(ICommandControlDMContext dmc) { - super(dmc, new String[] {"args"}); //$NON-NLS-1$ + this(dmc, new String[0]); } - - public MIGDBSetArgs(ICommandControlDMContext dmc, String arguments) { + + /** + * @since 4.0 + */ + public MIGDBSetArgs(ICommandControlDMContext dmc, String[] arguments) { super(dmc, null); - // We do not want to quote the arguments of this command so we must - // split them into individual strings - String[] argArray = arguments.split(" "); //$NON-NLS-1$ - String[] cmdArray = new String[argArray.length + 1]; + String[] cmdArray = new String[arguments.length + 1]; cmdArray[0] = "args"; //$NON-NLS-1$ - for (int i=0; i