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 eac7c3a9f1d..28e9a92d2c9 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 @@ -343,11 +343,15 @@ public class MICommand implements ICommand { builder.append('"'); } - // an empty parameter can be passed with two single quotes - if (builder.length() == 0) { - builder.append("''"); //$NON-NLS-1$ - } - +// Although this change makes sense, it could have impacts on many +// different commands we send to GDB. The risk outways the benefits, +// so we comment it out. See bugs 412471 and 414959 for details. +// +// // an empty parameter can be passed with two single quotes +// if (builder.length() == 0) { +// builder.append("''"); //$NON-NLS-1$ +// } +// return builder.toString(); } } 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 13b34a8c8d9..620de2d873e 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Ericsson and others. + * Copyright (c) 2008, 2013 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 @@ -8,6 +8,7 @@ * Contributors: * Ericsson - Initial API and implementation * Sergey Prigogin (Google) + * Marc Khouzam (Ericsson) - Support empty arguments (bug 412471) *******************************************************************************/ package org.eclipse.cdt.dsf.mi.service.command.commands; @@ -34,7 +35,12 @@ public class MIGDBSetArgs extends MIGDBSet { String[] cmdArray = new String[arguments.length + 1]; cmdArray[0] = "args"; //$NON-NLS-1$ for (int i = 0; i < arguments.length; i++) { - cmdArray[i + 1] = arguments[i]; + if (arguments[i].isEmpty()) { + // An empty parameter can be passed with two single quotes + cmdArray[i + 1] = "''"; //$NON-NLS-1$ + } else { + cmdArray[i + 1] = arguments[i]; + } } setParameters(cmdArray); }