diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/BuildRunnerHelper.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/BuildRunnerHelper.java index 970b36d7d9b..b45139adf79 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/BuildRunnerHelper.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/BuildRunnerHelper.java @@ -227,14 +227,14 @@ public class BuildRunnerHelper implements Closeable { if (workingDirectoryURI != null) { pathFromURI = EFSExtensionManager.getDefault().getPathFromURI(workingDirectoryURI); } - if(pathFromURI == null) { + if (pathFromURI == null) { // fallback to CWD pathFromURI = System.getProperty("user.dir"); //$NON-NLS-1$ } IPath workingDirectory = new Path(pathFromURI); String errMsg = null; - monitor.subTask(CCorePlugin.getFormattedString("BuildRunnerHelper.invokingCommand", launcher.getCommandLine())); //$NON-NLS-1$ + monitor.subTask(CCorePlugin.getFormattedString("BuildRunnerHelper.invokingCommand", guessCommandLine(buildCommand.toString(), args))); //$NON-NLS-1$ Process p = launcher.execute(buildCommand, args, envp, workingDirectory, monitor); monitor.worked(TICKS_EXECUTE_PROGRAM); if (p != null) { @@ -453,6 +453,19 @@ public class BuildRunnerHelper implements Closeable { errorParserManager.processLine(msg); } + /** + * Compose command line that presumably will be run by launcher. + */ + private static String guessCommandLine(String command, String[] args) { + StringBuffer buf = new StringBuffer(command + ' '); + if (args != null) { + for (String arg : args) { + buf.append(arg); + buf.append(' '); + } + } + return buf.toString().trim(); + } /** * Print a message to the console info output. Note that this message is colored * with the color assigned to "Info" stream.