From e74222b86c8ad35cc1534f370ca11587d8365efb Mon Sep 17 00:00:00 2001 From: Vincent Guignot Date: Tue, 23 May 2017 10:15:14 +0200 Subject: [PATCH] Bug 516227: solib-search-path with space fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../commands/MIGDBSetSolibSearchPath.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIGDBSetSolibSearchPath.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIGDBSetSolibSearchPath.java index fc5403df0e8..e82a0ceb3ce 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIGDBSetSolibSearchPath.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIGDBSetSolibSearchPath.java @@ -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 * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,6 +7,7 @@ * * Contributors: * Ericsson - Initial API and implementation + * Ingenico - solib-search-path with space fails (Bug 516227) *******************************************************************************/ package org.eclipse.cdt.dsf.mi.service.command.commands; @@ -23,9 +24,12 @@ public class MIGDBSetSolibSearchPath extends MIGDBSet * @since 1.1 */ public MIGDBSetSolibSearchPath(ICommandControlDMContext ctx, String[] paths) { - super(ctx, null); - // Overload the parameter - String sep = System.getProperty("path.separator", ":"); //$NON-NLS-1$ //$NON-NLS-2$ + super(ctx, + new String[] {"solib-search-path", concat(paths, System.getProperty("path.separator", ":"))}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + x-> new MINoChangeAdjustable(x)); + } + + private static String concat(String[] paths, String sep) { StringBuilder buffer = new StringBuilder(); for (int i = 0; i < paths.length; i++) { if (buffer.length() == 0) { @@ -34,7 +38,7 @@ public class MIGDBSetSolibSearchPath extends MIGDBSet buffer.append(sep).append(paths[i]); } } - String[] p = new String [] {"solib-search-path", buffer.toString()}; //$NON-NLS-1$ - setParameters(p); + + return buffer.toString(); } }