1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Merge remote-tracking branch 'cdt/master' into sd90

This commit is contained in:
Andrew Gvozdev 2013-02-18 14:27:11 -05:00
commit eba69424ae
5 changed files with 38 additions and 3 deletions

View file

@ -326,9 +326,9 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
@Override @Override
protected URI getBuildDirURI(URI mappedRootURI) { protected URI getBuildDirURI(URI mappedRootURI) {
// Do not calculate buildDirURI for each line
if (buildDirURI == null) { if (buildDirURI == null) {
buildDirURI = super.getBuildDirURI(mappedRootURI); // do not use build directory from MBS which could be not-existent when the provider runs
buildDirURI = currentProject != null ? currentProject.getLocationURI() : null;
} }
return buildDirURI; return buildDirURI;
} }
@ -353,7 +353,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
super.startup(cfgDescription, cwdTracker); super.startup(cfgDescription, cwdTracker);
mappedRootURI = null; mappedRootURI = null;
buildDirURI = super.getBuildDirURI(mappedRootURI); buildDirURI = getBuildDirURI(mappedRootURI);
} }
@Override @Override

View file

@ -1331,6 +1331,34 @@ public class CCorePlugin extends Plugin {
log(createStatus(e)); log(createStatus(e));
} }
/**
* Print a message in the log
*
* @param severity - desired severity of the message in the log,
* one of {@link IStatus#INFO}, {@link IStatus#WARNING} or {@link IStatus#ERROR}
* @param msg - message
*
* @since 5.5
* @noreference This method is not intended to be referenced by clients.
*/
public static void log(int severity, String msg) {
log(new Status(severity, PLUGIN_ID, msg));
}
/**
* Print a message in the log accompanied by stack trace
*
* @param severity - desired severity of the message in the log,
* one of {@link IStatus#INFO}, {@link IStatus#WARNING} or {@link IStatus#ERROR}
* @param msg - message
*
* @since 5.5
* @noreference This method is not intended to be referenced by clients.
*/
public static void logStackTrace(int severity, String msg) {
log(new Status(severity, PLUGIN_ID, msg, new Exception()));
}
/** /**
* @noreference This method is not intended to be referenced by clients. * @noreference This method is not intended to be referenced by clients.
*/ */

View file

@ -25,6 +25,7 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
import org.eclipse.osgi.util.NLS; import org.eclipse.osgi.util.NLS;
@ -184,6 +185,10 @@ public class CommandLauncher implements ICommandLauncher {
} }
File dir = workingDirectory != null ? workingDirectory.toFile() : null; File dir = workingDirectory != null ? workingDirectory.toFile() : null;
if (dir != null && !dir.isDirectory()) {
CCorePlugin.logStackTrace(IStatus.ERROR, NLS.bind(Messages.CommandLauncher_InvalidWorkingDirectory, dir));
dir = null;
}
try { try {
fProcess = ProcessFactory.getFactory().exec(fCommandArgs, env, dir); fProcess = ProcessFactory.getFactory().exec(fCommandArgs, env, dir);

View file

@ -17,6 +17,7 @@ public class Messages extends NLS {
public static String Util_unexpectedError; public static String Util_unexpectedError;
public static String Addr_valueOutOfRange; public static String Addr_valueOutOfRange;
public static String CommandLauncher_CommandCancelled; public static String CommandLauncher_CommandCancelled;
public static String CommandLauncher_InvalidWorkingDirectory;
public static String CommandLauncher_ProgramNotFoundInPath; public static String CommandLauncher_ProgramNotFoundInPath;
public static String convention_illegalIdentifier; public static String convention_illegalIdentifier;
public static String convention_invalid; public static String convention_invalid;

View file

@ -48,6 +48,7 @@ Util_unexpectedError=Unexpected error
Addr_valueOutOfRange=Address is outside valid range. Addr_valueOutOfRange=Address is outside valid range.
CommandLauncher_CommandCancelled=Command canceled CommandLauncher_CommandCancelled=Command canceled
CommandLauncher_InvalidWorkingDirectory=Launch attempt in non existent working directory "{0}"
CommandLauncher_ProgramNotFoundInPath=Error: Program "{0}" not found in PATH CommandLauncher_ProgramNotFoundInPath=Error: Program "{0}" not found in PATH
XmlUtil_InternalErrorLoading=Internal error while trying to load XML document XmlUtil_InternalErrorLoading=Internal error while trying to load XML document