1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-02 22:05:44 +02:00

Qt - cleanup build cases. Add method to GDBLaunch.

Clean up cases when Qt installs aren't registered for a given
config. Fix bug on first scanner info request in build config.
Clean up the Qt Run launch delegate in extension.

Also added a method to GDBLaunch to allow subclasses to override
what the default gdb path is.

Change-Id: Icf158633e1c1327cc87ce59c1605bb26258f8708
This commit is contained in:
Doug Schaefer 2016-02-02 16:42:06 -05:00 committed by Gerrit Code Review @ Eclipse.org
parent 11e522d33d
commit b6dc71f442
4 changed files with 34 additions and 21 deletions

View file

@ -155,8 +155,10 @@ public abstract class CBuildConfiguration extends PlatformObject {
} }
public void clearScannerInfoCache() throws CoreException { public void clearScannerInfoCache() throws CoreException {
if (scannerInfoCache != null) {
scannerInfoCache.clear(); scannerInfoCache.clear();
} }
}
public Collection<CConsoleParser> getConsoleParsers() throws CoreException { public Collection<CConsoleParser> getConsoleParsers() throws CoreException {
IToolChain toolChain = getToolChain(); IToolChain toolChain = getToolChain();

View file

@ -437,28 +437,39 @@ public class GdbLaunch extends DsfLaunch implements ITerminate, IDisconnect, ITr
super.launchRemoved(launch); super.launchRemoved(launch);
} }
/**
* Get the default GDB path if not specified in the launch or launch config.
*
* @since 5.0
*/
protected String getDefaultGDBPath() {
return Platform.getPreferencesService().getString(GdbPlugin.PLUGIN_ID,
IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_COMMAND,
IGDBLaunchConfigurationConstants.DEBUGGER_DEBUG_NAME_DEFAULT, null);
}
/** /**
* Returns the path to gdb. * Returns the path to gdb.
* *
* @since 5.0 * @since 5.0
*/ */
public IPath getGDBPath() { public IPath getGDBPath() {
String defaultGdbCommand = Platform.getPreferencesService().getString(GdbPlugin.PLUGIN_ID,
IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_COMMAND,
IGDBLaunchConfigurationConstants.DEBUGGER_DEBUG_NAME_DEFAULT, null);
IPath retVal = new Path(defaultGdbCommand);
try { try {
String gdb = getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME); String gdb = getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME);
if (gdb == null) { if (gdb == null) {
gdb = getLaunchConfiguration().getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, gdb = getLaunchConfiguration().getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME,
defaultGdbCommand); getDefaultGDBPath());
} }
if (gdb != null) {
gdb = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(gdb, false); gdb = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(gdb, false);
retVal = new Path(gdb); return new Path(gdb);
} catch (CoreException e) { } else {
return null;
}
} catch (CoreException e) {
GdbPlugin.log(e.getStatus());
return null;
} }
return retVal;
} }
/** /**

View file

@ -185,27 +185,22 @@
<extension <extension
point="org.eclipse.debug.core.launchConfigurationTypes"> point="org.eclipse.debug.core.launchConfigurationTypes">
<launchConfigurationType <launchConfigurationType
delegate="org.eclipse.cdt.internal.qt.core.launch.QtLocalRunLaunchConfigDelegate"
id="org.eclipse.cdt.qt.core.launchConfigurationType" id="org.eclipse.cdt.qt.core.launchConfigurationType"
modes="run"
name="Qt Local Application" name="Qt Local Application"
public="true"> public="true"
sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer">
</launchConfigurationType> </launchConfigurationType>
</extension> </extension>
<extension <extension
point="org.eclipse.debug.core.launchDelegates"> point="org.eclipse.debug.core.launchDelegates">
<launchDelegate
delegate="org.eclipse.cdt.internal.qt.core.launch.QtLocalRunLaunchConfigDelegate"
id="org.eclipse.cdt.qt.core.launchDelegate.run.local"
modes="run"
name="Qt Local Run launcher"
type="org.eclipse.cdt.qt.core.launchConfigurationType">
</launchDelegate>
<launchDelegate <launchDelegate
delegate="org.eclipse.cdt.internal.qt.core.launch.QtLocalDebugLaunchConfigDelegate" delegate="org.eclipse.cdt.internal.qt.core.launch.QtLocalDebugLaunchConfigDelegate"
id="org.eclipse.cdt.qt.core.launchDelegate.debug.local" id="org.eclipse.cdt.qt.core.launchDelegate.debug.local"
modes="debug" modes="debug"
name="Qt Local Debug launcher" name="Qt Local Debug launcher"
sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer"
type="org.eclipse.cdt.qt.core.launchConfigurationType"> type="org.eclipse.cdt.qt.core.launchConfigurationType">
</launchDelegate> </launchDelegate>
</extension> </extension>

View file

@ -27,6 +27,8 @@ import org.eclipse.core.resources.IResourceChangeListener;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdapterFactory; import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.core.target.ILaunchTarget;
import org.eclipse.launchbar.core.target.ILaunchTargetManager; import org.eclipse.launchbar.core.target.ILaunchTargetManager;
@ -147,7 +149,10 @@ public class QtBuildConfigurationFactory implements IAdapterFactory {
} }
} }
} }
return null;
// No appropriate Qt Install
throw new CoreException(
new Status(IStatus.ERROR, Activator.ID, "No appropriate Qt SDK found for target " + target.getId()));
} }
public static class Cleanup implements IResourceChangeListener { public static class Cleanup implements IResourceChangeListener {