Skip to main content
summaryrefslogtreecommitdiffstats
blob: 544883c6cf7af47a4ec6c90ca1a8de49d7aebfe4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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"; //$NON-NLS-1$
		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();
	}
	
}

Back to the top