1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

[263689] Special handling of -environment-cd for MacOS

This commit is contained in:
Marc Khouzam 2010-03-04 19:34:09 +00:00
parent fdc4d93925
commit e585f18abd

View file

@ -16,7 +16,21 @@ import org.eclipse.cdt.dsf.mi.service.command.commands.MIEnvironmentCD;
public class MacOSMIEnvironmentCD extends MIEnvironmentCD {
// We need to send the following format:
// -environment-cd "\"/path/without/any/spaces\"" or -environment-cd /path/without/any/spaces
// -environment-cd "\"/path/with spaces\""
public MacOSMIEnvironmentCD(ICommandControlDMContext ctx, String path) {
super(ctx, '\"' + path + '\"');
super(ctx, (path == null) ? null : "\"\\\"" + path + "\\\"\""); //$NON-NLS-1$ //$NON-NLS-2$
}
@Override
protected String parametersToString() {
// Apple's GDB is very picky. We override the parameter formatting
// so that we can control exactly what will be sent to GDB.
StringBuffer buffer = new StringBuffer();
for (String parameter : getParameters()) {
buffer.append(' ').append(parameter);
}
return buffer.toString().trim();
}
}