mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 09:15:38 +02:00
Bug 412471 - Incorrect handling of empty string as program argument in
debug mode Change-Id: I6e8ebb74b29e34e36bd3a23db88b66b6442b2889 Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com> Reviewed-on: https://git.eclipse.org/r/15438
This commit is contained in:
parent
2a61b0709c
commit
9685809373
2 changed files with 17 additions and 7 deletions
|
@ -343,11 +343,15 @@ public class MICommand<V extends MIInfo> implements ICommand<V> {
|
||||||
builder.append('"');
|
builder.append('"');
|
||||||
}
|
}
|
||||||
|
|
||||||
// an empty parameter can be passed with two single quotes
|
// Although this change makes sense, it could have impacts on many
|
||||||
if (builder.length() == 0) {
|
// different commands we send to GDB. The risk outways the benefits,
|
||||||
builder.append("''"); //$NON-NLS-1$
|
// 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();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Ericsson - Initial API and implementation
|
* Ericsson - Initial API and implementation
|
||||||
* Sergey Prigogin (Google)
|
* Sergey Prigogin (Google)
|
||||||
|
* Marc Khouzam (Ericsson) - Support empty arguments (bug 412471)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.dsf.mi.service.command.commands;
|
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];
|
String[] cmdArray = new String[arguments.length + 1];
|
||||||
cmdArray[0] = "args"; //$NON-NLS-1$
|
cmdArray[0] = "args"; //$NON-NLS-1$
|
||||||
for (int i = 0; i < arguments.length; i++) {
|
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);
|
setParameters(cmdArray);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue