diff options
author | Vincent Guignot | 2017-05-23 08:15:14 +0000 |
---|---|---|
committer | Jonah Graham | 2017-05-23 08:47:59 +0000 |
commit | e74222b86c8ad35cc1534f370ca11587d8365efb (patch) | |
tree | 2b5c2d270b2fbef5714ebd55c24f502cff654aef | |
parent | 3147cc4732f3ab65a1326461e73fee462fbf3a55 (diff) | |
download | org.eclipse.cdt-e74222b86c8ad35cc1534f370ca11587d8365efb.tar.gz org.eclipse.cdt-e74222b86c8ad35cc1534f370ca11587d8365efb.tar.xz org.eclipse.cdt-e74222b86c8ad35cc1534f370ca11587d8365efb.zip |
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>
-rw-r--r-- | dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIGDBSetSolibSearchPath.java | 16 |
1 files 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(); } } |