1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 01:36:01 +02:00

Bug 516227: solib-search-path with space fails

If the solib-search-path path contains a space, CDT adds doubles quote
to escape the space (in MIStandardParameterAdjustable class) . But Gdb
client doesn’t understand the double quotes path.
This patch do not add double quotes when the path contains spaces.

Change-Id: I080be17023647dfac2b00296cdd54c7f9499102a
Signed-off-by: Vincent Guignot <vincent.guignot@ingenico.com>
This commit is contained in:
Vincent Guignot 2017-05-23 10:15:14 +02:00 committed by Jonah Graham
parent 3147cc4732
commit e74222b86c

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2009, 2016 Ericsson and others. * Copyright (c) 2009, 2017 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
@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* Ericsson - Initial API and implementation * Ericsson - Initial API and implementation
* Ingenico - solib-search-path with space fails (Bug 516227)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.dsf.mi.service.command.commands; package org.eclipse.cdt.dsf.mi.service.command.commands;
@ -23,9 +24,12 @@ public class MIGDBSetSolibSearchPath extends MIGDBSet
* @since 1.1 * @since 1.1
*/ */
public MIGDBSetSolibSearchPath(ICommandControlDMContext ctx, String[] paths) { public MIGDBSetSolibSearchPath(ICommandControlDMContext ctx, String[] paths) {
super(ctx, null); super(ctx,
// Overload the parameter new String[] {"solib-search-path", concat(paths, System.getProperty("path.separator", ":"))}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
String sep = System.getProperty("path.separator", ":"); //$NON-NLS-1$ //$NON-NLS-2$ x-> new MINoChangeAdjustable(x));
}
private static String concat(String[] paths, String sep) {
StringBuilder buffer = new StringBuilder(); StringBuilder buffer = new StringBuilder();
for (int i = 0; i < paths.length; i++) { for (int i = 0; i < paths.length; i++) {
if (buffer.length() == 0) { if (buffer.length() == 0) {
@ -34,7 +38,7 @@ public class MIGDBSetSolibSearchPath extends MIGDBSet
buffer.append(sep).append(paths[i]); buffer.append(sep).append(paths[i]);
} }
} }
String[] p = new String [] {"solib-search-path", buffer.toString()}; //$NON-NLS-1$
setParameters(p); return buffer.toString();
} }
} }