1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-03-28 14:56:28 +01:00

Debugger and Source tabs for the Core Build launch configuration. (#950)

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.
This commit is contained in:
ewaterlander 2024-12-10 18:08:08 +01:00 committed by GitHub
parent 9e9be4a5e2
commit f259d60aa3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 170 additions and 63 deletions

View file

@ -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

View file

@ -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>

View file

@ -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,

View file

@ -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

View file

@ -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

View file

@ -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
@ -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

View file

@ -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;
@ -82,9 +79,6 @@ public class CoreBuildLocalDebugLaunchDelegate extends CoreBuildLaunchConfigDele
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);

View file

@ -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

View file

@ -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

View file

@ -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>
@ -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">
@ -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"

View file

@ -1,33 +0,0 @@
/*******************************************************************************
* Copyright (c) 2016 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.cdt.launch.internal.corebuild;
import org.eclipse.cdt.launch.ui.CArgumentsTab;
import org.eclipse.cdt.launch.ui.corebuild.CoreBuildMainTab2;
import org.eclipse.cdt.launch.ui.corebuild.CoreBuildTab;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
import org.eclipse.debug.ui.EnvironmentTab;
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
import org.eclipse.debug.ui.ILaunchConfigurationTab;
public class LocalLaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup {
@Override
public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
ILaunchConfigurationTab mainTab = new CoreBuildMainTab2();
ILaunchConfigurationTab buildTab = new CoreBuildTab();
ILaunchConfigurationTab argumentsTab = new CArgumentsTab();
ILaunchConfigurationTab environmentTab = new EnvironmentTab();
setTabs(new ILaunchConfigurationTab[] { mainTab, buildTab, argumentsTab, environmentTab });
}
}

View file

@ -112,7 +112,7 @@ public class CMainTab2 extends CAbstractMainTab {
}
/**
* @since 10.4
* @since 11.0
*/
protected void setDontCheckProgram(boolean dontCheck) {
fDontCheckProgram = dontCheck;

View file

@ -29,6 +29,12 @@ import org.eclipse.swt.widgets.Text;
*/
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
@ -79,4 +85,8 @@ public class CoreBuildMainTab extends AbstractLaunchConfigurationTab {
return "Main";
}
@Override
public String getId() {
return TAB_ID;
}
}

View file

@ -16,7 +16,7 @@ import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.swt.widgets.Composite;
/**
* @since 10.4
* @since 11.0
*/
public class CoreBuildMainTab2 extends CMainTab2 {

View file

@ -40,6 +40,10 @@ import org.eclipse.swt.widgets.Label;
*/
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;
@ -155,4 +159,8 @@ public class CoreBuildTab extends AbstractLaunchConfigurationTab {
return null;
}
@Override
public String getId() {
return TAB_ID;
}
}