mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +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:
parent
11e522d33d
commit
b6dc71f442
4 changed files with 34 additions and 21 deletions
|
@ -155,7 +155,9 @@ public abstract class CBuildConfiguration extends PlatformObject {
|
|||
}
|
||||
|
||||
public void clearScannerInfoCache() throws CoreException {
|
||||
scannerInfoCache.clear();
|
||||
if (scannerInfoCache != null) {
|
||||
scannerInfoCache.clear();
|
||||
}
|
||||
}
|
||||
|
||||
public Collection<CConsoleParser> getConsoleParsers() throws CoreException {
|
||||
|
|
|
@ -437,28 +437,39 @@ public class GdbLaunch extends DsfLaunch implements ITerminate, IDisconnect, ITr
|
|||
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.
|
||||
*
|
||||
* @since 5.0
|
||||
*/
|
||||
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 {
|
||||
String gdb = getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME);
|
||||
if (gdb == null) {
|
||||
gdb = getLaunchConfiguration().getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME,
|
||||
defaultGdbCommand);
|
||||
getDefaultGDBPath());
|
||||
}
|
||||
if (gdb != null) {
|
||||
gdb = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(gdb, false);
|
||||
return new Path(gdb);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
gdb = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(gdb, false);
|
||||
retVal = new Path(gdb);
|
||||
} catch (CoreException e) {
|
||||
GdbPlugin.log(e.getStatus());
|
||||
return null;
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -185,27 +185,22 @@
|
|||
<extension
|
||||
point="org.eclipse.debug.core.launchConfigurationTypes">
|
||||
<launchConfigurationType
|
||||
delegate="org.eclipse.cdt.internal.qt.core.launch.QtLocalRunLaunchConfigDelegate"
|
||||
id="org.eclipse.cdt.qt.core.launchConfigurationType"
|
||||
modes="run"
|
||||
name="Qt Local Application"
|
||||
public="true">
|
||||
public="true"
|
||||
sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
|
||||
sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer">
|
||||
</launchConfigurationType>
|
||||
</extension>
|
||||
<extension
|
||||
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
|
||||
delegate="org.eclipse.cdt.internal.qt.core.launch.QtLocalDebugLaunchConfigDelegate"
|
||||
id="org.eclipse.cdt.qt.core.launchDelegate.debug.local"
|
||||
modes="debug"
|
||||
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">
|
||||
</launchDelegate>
|
||||
</extension>
|
||||
|
|
|
@ -27,6 +27,8 @@ import org.eclipse.core.resources.IResourceChangeListener;
|
|||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IAdapterFactory;
|
||||
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.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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue