Skip to content

Commit

Permalink
Debugger and Source tabs for the Core Build launch configuration. (#950)
Browse files Browse the repository at this point in the history
The launch configuration for local Core Build projects got the
Debugger and Source tabs in debug mode. Now the user can set the stop
at startup, a specific debugger, and all other Debug options as we
know from Managed Build projects.

The GdbLaunch class automatically picks up all the debug settings from
these new tabs. No additional code was needed for that.

The composition of Core Build tab groups is now fully done via the
launchConfigurationTabGroups extension-point.

This change relates to #758. It affects all Core Build projects,
including CMake projects.
  • Loading branch information
ewaterlander authored Dec 10, 2024
1 parent 9e9be4a commit f259d60
Show file tree
Hide file tree
Showing 15 changed files with 170 additions and 63 deletions.
2 changes: 1 addition & 1 deletion debug/org.eclipse.cdt.debug.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.debug.core; singleton:=true
Bundle-Version: 8.8.700.qualifier
Bundle-Version: 8.8.800.qualifier
Bundle-Activator: org.eclipse.cdt.debug.core.CDebugCorePlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Expand Down
2 changes: 0 additions & 2 deletions debug/org.eclipse.cdt.debug.core/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,7 @@
<extension
point="org.eclipse.debug.core.launchConfigurationTypes">
<launchConfigurationType
delegate="org.eclipse.cdt.debug.internal.core.launch.CoreBuildLocalRunLaunchDelegate"
id="org.eclipse.cdt.debug.core.localCoreBuildLaunchConfigType"
modes="run"
name="%localApplicationLaunch.name"
public="false">
</launchConfigurationType>
Expand Down
2 changes: 1 addition & 1 deletion dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.cdt.dsf.gdb.ui;singleton:=true
Bundle-Version: 2.8.400.qualifier
Bundle-Version: 2.8.500.qualifier
Bundle-Activator: org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
Expand Down
1 change: 1 addition & 0 deletions dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ launchTab.debugger.name=Debugger
launchTab.sourceLookup.name=Source
launchTab.common.name=Common
launchTab.environment.name=Environment
launchTab.buildsettings.name=Build Settings

breakpoints.property.filter=Filter
tracepoints.property.common=Common
Expand Down
69 changes: 69 additions & 0 deletions dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,75 @@
<associatedDelegate delegate="org.eclipse.cdt.dsf.gdb.launch.coreCLaunch"/>
<placement after="org.eclipse.debug.ui.sourceLookupTab"/>
</tab>
<tab
class="org.eclipse.cdt.launch.ui.corebuild.CoreBuildMainTab2"
group="org.eclipse.cdt.launch.launchConfigurationTabGroup.local"
id="org.eclipse.cdt.cdi.launch.localCoreBuild.mainTab"
name="%launchTab.main.name">
<associatedDelegate
delegate="org.eclipse.cdt.dsf.gdb.coreBuildLocalDebug">
</associatedDelegate>
</tab>
<tab
class="org.eclipse.cdt.launch.ui.corebuild.CoreBuildTab"
group="org.eclipse.cdt.launch.launchConfigurationTabGroup.local"
id="org.eclipse.cdt.cdi.launch.localCoreBuild.buildSettingsTab"
name="%launchTab.buildsettings.name">
<associatedDelegate
delegate="org.eclipse.cdt.dsf.gdb.coreBuildLocalDebug">
</associatedDelegate>
<placement
after="org.eclipse.cdt.cdi.launch.mainTab">
</placement>
</tab>
<tab
class="org.eclipse.cdt.launch.ui.CArgumentsTab"
group="org.eclipse.cdt.launch.launchConfigurationTabGroup.local"
id="org.eclipse.cdt.cdi.launch.localCoreBuild.argumentsTab"
name="%launchTab.arguments.name">
<associatedDelegate
delegate="org.eclipse.cdt.dsf.gdb.coreBuildLocalDebug">
</associatedDelegate>
<placement
after="org.eclipse.cdt.cdi.launch.buildSettingsTab">
</placement>
</tab>
<tab
class="org.eclipse.debug.ui.EnvironmentTab"
group="org.eclipse.cdt.launch.launchConfigurationTabGroup.local"
id="org.eclipse.cdt.cdi.launch.localCoreBuild.environmentTab"
name="%launchTab.environment.name">
<associatedDelegate
delegate="org.eclipse.cdt.dsf.gdb.coreBuildLocalDebug">
</associatedDelegate>
<placement
after="org.eclipse.cdt.cdi.launch.argumentsTab">
</placement>
</tab>
<tab
class="org.eclipse.cdt.dsf.gdb.internal.ui.launching.LocalApplicationCDebuggerTab"
group="org.eclipse.cdt.launch.launchConfigurationTabGroup.local"
id="org.eclipse.cdt.cdi.launch.localCoreBuild.debugTab"
name="%launchTab.debugger.name">
<associatedDelegate
delegate="org.eclipse.cdt.dsf.gdb.coreBuildLocalDebug">
</associatedDelegate>
<placement
after="org.eclipse.debug.ui.environmentTab">
</placement>
</tab>
<tab
class="org.eclipse.debug.ui.sourcelookup.SourceLookupTab"
group="org.eclipse.cdt.launch.launchConfigurationTabGroup.local"
id="org.eclipse.cdt.cdi.launch.localCoreBuild.sourceLookupTab"
name="%launchTab.sourceLookup.name">
<associatedDelegate
delegate="org.eclipse.cdt.dsf.gdb.coreBuildLocalDebug">
</associatedDelegate>
<placement
after="org.eclipse.cdt.dsf.gdb.launch.debuggerTab">
</placement>
</tab>
</extension>
<extension point="org.eclipse.core.runtime.adapters">
<!-- Extenders providing their own subclass of GdbAdapterFactory must also extend GdbLaunch
Expand Down
25 changes: 9 additions & 16 deletions dsf-gdb/org.eclipse.cdt.dsf.gdb/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@
sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer">
</launchDelegate>
<launchDelegate
delegate="org.eclipse.cdt.dsf.gdb.internal.launching.CoreBuildLocalDebugLaunchDelegate"
id="org.eclipse.cdt.dsf.gdb.coreBuildLocalDebug"
modes="debug"
name="%coreBuildLocalDebug.name"
sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer"
type="org.eclipse.cdt.debug.core.localCoreBuildLaunchConfigType">
</launchDelegate>
</extension>

<extension
Expand Down Expand Up @@ -85,22 +94,6 @@
</bundle>
</component>
</extension>
<extension
point="org.eclipse.debug.core.launchDelegates">
<launchDelegate
delegate="org.eclipse.cdt.dsf.gdb.internal.launching.CoreBuildLocalDebugLaunchDelegate"
id="org.eclipse.cdt.dsf.gdb.coreBuildLocalDebug"
modes="debug"
name="%coreBuildLocalDebug.name"
sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer"
type="org.eclipse.cdt.debug.core.localCoreBuildLaunchConfigType">
<modeCombination
modes="debug"
perspective="org.eclipse.debug.ui.DebugPerspective">
</modeCombination>
</launchDelegate>
</extension>
<extension
point="org.eclipse.launchbar.core.launchTargetTypes">
<launchTargetType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.internal.launching;

import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ExecutionException;

import org.eclipse.cdt.core.build.ICBuildConfiguration;
import org.eclipse.cdt.core.build.IToolChain;
import org.eclipse.cdt.core.model.IBinary;
import org.eclipse.cdt.debug.core.launch.CoreBuildLaunchConfigDelegate;
import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
Expand Down Expand Up @@ -82,9 +79,6 @@ public void launch(ILaunchConfiguration configuration, String mode, ILaunch laun
envProps.putAll(buildEnv);
gdbLaunch.setInitialEnvironment(envProps);

IToolChain toolChain = buildConfig.getToolChain();
Path gdbPath = toolChain.getCommandPath(Paths.get("gdb")); //$NON-NLS-1$
gdbLaunch.setGDBPath(gdbPath != null ? gdbPath.toString() : "gdb"); //$NON-NLS-1$
String gdbVersion = gdbLaunch.getGDBVersion();

IBinary exeFile = getBinary(buildConfig);
Expand Down
2 changes: 1 addition & 1 deletion launch/org.eclipse.cdt.launch/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.launch; singleton:=true
Bundle-Version: 10.4.700.qualifier
Bundle-Version: 11.0.0.qualifier
Bundle-Activator: org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Expand Down
1 change: 1 addition & 0 deletions launch/org.eclipse.cdt.launch/plugin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ LocalCDTLaunch.name=Run Process
LocalCDTLaunch.description=Execute the specified process

MainLaunchTab.name=Main
BuildSettingsLaunchTab.name=Build Settings
ArgumentsLaunchTab.name=Arguments
EnvironmentLaunchTab.name=Environment
SourceLookupLaunchTab.name=Source
Expand Down
68 changes: 67 additions & 1 deletion launch/org.eclipse.cdt.launch/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer">
</launchDelegate>
<launchDelegate
delegate="org.eclipse.cdt.debug.internal.core.launch.CoreBuildLocalRunLaunchDelegate"
delegateDescription="%LocalCDTLaunch.description"
id="org.eclipse.cdt.cdi.launch.localCoreBuildCLaunch"
modes="run"
name="%LocalCDTLaunch.name"
sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer"
type="org.eclipse.cdt.debug.core.localCoreBuildLaunchConfigType">
</launchDelegate>

</extension>

Expand Down Expand Up @@ -53,6 +63,51 @@
<associatedDelegate delegate="org.eclipse.cdt.cdi.launch.localCLaunch"/>
<placement after="org.eclipse.debug.ui.environmentTab"/>
</tab>
<tab
class="org.eclipse.cdt.launch.ui.corebuild.CoreBuildMainTab2"
group="org.eclipse.cdt.launch.launchRunConfigurationTabGroup.local"
id="org.eclipse.cdt.cdi.launch.runLocalCoreBuild.mainTab"
name="%MainLaunchTab.name">
<associatedDelegate
delegate="org.eclipse.cdt.cdi.launch.localCoreBuildCLaunch">
</associatedDelegate>
</tab>
<tab
class="org.eclipse.cdt.launch.ui.corebuild.CoreBuildTab"
group="org.eclipse.cdt.launch.launchRunConfigurationTabGroup.local"
id="org.eclipse.cdt.cdi.launch.runLocalCoreBuild.buildSettingsTab"
name="%BuildSettingsLaunchTab.name">
<associatedDelegate
delegate="org.eclipse.cdt.cdi.launch.localCoreBuildCLaunch">
</associatedDelegate>
<placement
after="org.eclipse.cdt.cdi.launch.mainTab">
</placement>
</tab>
<tab
class="org.eclipse.cdt.launch.ui.CArgumentsTab"
group="org.eclipse.cdt.launch.launchRunConfigurationTabGroup.local"
id="org.eclipse.cdt.cdi.launch.runLocalCoreBuild.argumentsTab"
name="%ArgumentsLaunchTab.name">
<associatedDelegate
delegate="org.eclipse.cdt.cdi.launch.localCoreBuildCLaunch">
</associatedDelegate>
<placement
after="org.eclipse.cdt.cdi.launch.buildSettingsTab">
</placement>
</tab>
<tab
class="org.eclipse.debug.ui.EnvironmentTab"
group="org.eclipse.cdt.launch.launchRunConfigurationTabGroup.local"
id="org.eclipse.cdt.cdi.launch.runLocalCoreBuild.environmentTab"
name="%EnvironmentLaunchTab.name">
<associatedDelegate
delegate="org.eclipse.cdt.cdi.launch.localCoreBuildCLaunch">
</associatedDelegate>
<placement
after="org.eclipse.cdt.cdi.launch.argumentsTab">
</placement>
</tab>
</extension>
<extension
point="org.eclipse.debug.core.statusHandlers">
Expand Down Expand Up @@ -109,9 +164,20 @@
<extension
point="org.eclipse.debug.ui.launchConfigurationTabGroups">
<launchConfigurationTabGroup
class="org.eclipse.cdt.launch.internal.corebuild.LocalLaunchConfigurationTabGroup"
class="org.eclipse.cdt.debug.internal.ui.launch.PlaceHolderLaunchConfigurationTabGroup"
id="org.eclipse.cdt.launch.launchConfigurationTabGroup.local"
type="org.eclipse.cdt.debug.core.localCoreBuildLaunchConfigType">
<launchMode
mode="debug">
</launchMode>
</launchConfigurationTabGroup>
<launchConfigurationTabGroup
class="org.eclipse.cdt.debug.internal.ui.launch.PlaceHolderLaunchConfigurationTabGroup"
id="org.eclipse.cdt.launch.launchRunConfigurationTabGroup.local"
type="org.eclipse.cdt.debug.core.localCoreBuildLaunchConfigType">
<launchMode
mode="run">
</launchMode>
</launchConfigurationTabGroup>
<launchConfigurationTabGroup
class="org.eclipse.cdt.launch.internal.corebuild.GenericLaunchConfigTabGroup"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public CMainTab2(int flags) {
}

/**
* @since 10.4
* @since 11.0
*/
protected void setDontCheckProgram(boolean dontCheck) {
fDontCheckProgram = dontCheck;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
*/
public class CoreBuildMainTab extends AbstractLaunchConfigurationTab {

/**
* @since 11.0
*/
// Same as CoreBuildMainTab2/CMainTab2
public static final String TAB_ID = "org.eclipse.cdt.cdi.launch.mainTab"; //$NON-NLS-1$

private Text projectName;

@Override
Expand Down Expand Up @@ -79,4 +85,8 @@ public String getName() {
return "Main";
}

@Override
public String getId() {
return TAB_ID;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.eclipse.swt.widgets.Composite;

/**
* @since 10.4
* @since 11.0
*/
public class CoreBuildMainTab2 extends CMainTab2 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
*/
public class CoreBuildTab extends AbstractLaunchConfigurationTab {

/**
* @since 11.0
*/
public static final String TAB_ID = "org.eclipse.cdt.cdi.launch.buildSettingsTab"; //$NON-NLS-1$
private Composite container;
private IProject activeProject;
private ILaunchConfigurationTab activeTab;
Expand Down Expand Up @@ -155,4 +159,8 @@ private ILaunchConfigurationTab getTab(IProject project) {
return null;
}

@Override
public String getId() {
return TAB_ID;
}
}

0 comments on commit f259d60

Please sign in to comment.