Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Variable expansion bug

I think I've found a bug regarding variable expansion in command strings. Given the following option definition

              command="--option=${myMacro} ${value}"

${myMacro} will not be expanded when the command line is displayed in the tool's "All options:" box, but it is expanded on the commandline. The offending code seems to be in Tool#getToolCommandFlags:

				case IOption.STRING :{
						String strCmd = option.getCommand();
						String val = option.getStringValue();
						IMacroContextInfo info = provider.getMacroContextInfo(BuildMacroProvider.CONTEXT_FILE, new FileContextData(inputFileLocation, outputFileLocation, option, this));
						if(info != null){
							if (val.length() > 0
								&& (val = CdtVariableResolver.resolveToString(val, macroSubstitutor)).length() > 0) {
								sb.append( evaluateCommand( strCmd, val ) );

The "strCmd" is never expanded before being appended to the string displayed in the GUI, causing the GUI to display "${myMacro}" instead the value of ${myMacro}.

Should I add a bugzilla-report on this?


Back to the top