mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-10 18:45:26 +02:00
This commit was manufactured by cvs2svn to create branch 'cdt_1_2'.
Cherrypick from master 2003-12-18 23:23:03 UTC Alain Magloire <alain@qnx.com> 'The -gdb-set environment is not describe properly': debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetEnvironment.java
This commit is contained in:
parent
7e1e7be0aa
commit
3def1b75b9
1 changed files with 46 additions and 0 deletions
|
@ -0,0 +1,46 @@
|
||||||
|
/*
|
||||||
|
*(c) Copyright QNX Software Systems Ltd. 2002.
|
||||||
|
* All Rights Reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.eclipse.cdt.debug.mi.core.command;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* -gdb-set
|
||||||
|
*
|
||||||
|
* Set an internal GDB variable.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class MIGDBSetEnvironment extends MIGDBSet {
|
||||||
|
|
||||||
|
public MIGDBSetEnvironment(String[] paths) {
|
||||||
|
super(paths);
|
||||||
|
// Overload the parameter
|
||||||
|
String[] newPaths = new String[paths.length + 1];
|
||||||
|
newPaths[0] = "environment";
|
||||||
|
System.arraycopy(paths, 0, newPaths, 1, paths.length);
|
||||||
|
setParameters(newPaths);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* According to the help.:
|
||||||
|
* Set environment variable value to give the program.
|
||||||
|
* Arguments are VAR VALUE where VAR is variable name and VALUE is value.
|
||||||
|
* VALUES of environment variables are uninterpreted strings.
|
||||||
|
* This does not affect the program until the next "run" command.
|
||||||
|
*
|
||||||
|
* So pass the strings raw without interpretation.
|
||||||
|
*/
|
||||||
|
protected String parametersToString() {
|
||||||
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
if (parameters != null) {
|
||||||
|
for (int i = 0; i < parameters.length; i++) {
|
||||||
|
buffer.append(' ').append(parameters[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return buffer.toString().trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue