From 1a4736c7250c39c8ac436dd31425cc3f8f7f112b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Svensson?= Date: Mon, 22 Jun 2020 21:15:11 +0200 Subject: [PATCH] Bug 564553: Fetch the path to GDB from GdbLaunch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to present the same path to the binary as actually launched, fetch the path from the GdbLaunch instance rather than reading the attribute from the launch configuration. Change-Id: I9f973a590136167d1c8d19b6af52378c95645e35 Signed-off-by: Torbjörn Svensson --- .../guide/deprecated_API_removals.html | 11 +++++++++++ .../org.eclipse.cdt.dsf.gdb.ui/META-INF/MANIFEST.MF | 2 +- .../org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF | 2 +- .../cdt/dsf/gdb/launching/GdbLaunchDelegate.java | 13 +++++++++---- .../META-INF/MANIFEST.MF | 2 +- .../META-INF/MANIFEST.MF | 2 +- .../core/internal/launching/LLDBLaunchDelegate.java | 12 ------------ 7 files changed, 24 insertions(+), 20 deletions(-) diff --git a/doc/org.eclipse.cdt.doc.isv/guide/deprecated_API_removals.html b/doc/org.eclipse.cdt.doc.isv/guide/deprecated_API_removals.html index ce76a6ee7e8..4317734ce8d 100644 --- a/doc/org.eclipse.cdt.doc.isv/guide/deprecated_API_removals.html +++ b/doc/org.eclipse.cdt.doc.isv/guide/deprecated_API_removals.html @@ -40,6 +40,7 @@
  • Arduino plug-ins and features removed.
  • Remove LRParser, XLC and UPC.
  • Remove org.eclipse.cdt.utils.Platform.
  • +
  • DSF and DSF-GDB API Changes.
  • Planned Removals after June 2022 @@ -187,6 +188,16 @@ See Bug 564123.

    +

    9. DSF and DSF-GDB API Changes

    +

    + DSF and DSF-GDB have had some small API changes, but they are still breaking changes and are listed here: +

    +

    +

    Future Deletions

    diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/META-INF/MANIFEST.MF b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/META-INF/MANIFEST.MF index 4271f55c258..f1d4ee7af35 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/META-INF/MANIFEST.MF +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/META-INF/MANIFEST.MF @@ -12,7 +12,7 @@ Require-Bundle: org.eclipse.ui, org.eclipse.cdt.dsf.ui, org.eclipse.debug.ui, org.eclipse.cdt.debug.core, - org.eclipse.cdt.dsf.gdb;bundle-version="[5.5.0,6.0.0)", + org.eclipse.cdt.dsf.gdb;bundle-version="[6.0.0,7.0.0)", org.eclipse.cdt.debug.ui, org.eclipse.cdt.core, org.eclipse.cdt.ui, diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF b/dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF index cf7f7e5db79..0a52c3645e2 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-SymbolicName: org.eclipse.cdt.dsf.gdb;singleton:=true -Bundle-Version: 5.8.200.qualifier +Bundle-Version: 6.0.0.qualifier Bundle-Activator: org.eclipse.cdt.dsf.gdb.internal.GdbPlugin Bundle-Localization: plugin Require-Bundle: org.eclipse.core.runtime, diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java index 9f16f8aae23..c8e85a89532 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java @@ -206,7 +206,7 @@ public class GdbLaunchDelegate extends AbstractCLaunchDelegate2 { launch.initializeControl(); // Add the GDB process object to the launch. - launch.addCLIProcess(getCLILabel(config, gdbVersion)); + launch.addCLIProcess(getCLILabel(launch, config, gdbVersion)); monitor.worked(1); @@ -266,10 +266,15 @@ public class GdbLaunchDelegate extends AbstractCLaunchDelegate2 { /** * Return the label to be used for the CLI node - * @since 4.6 + * @since 6.0 */ - protected String getCLILabel(ILaunchConfiguration config, String gdbVersion) throws CoreException { - return LaunchUtils.getGDBPath(config).toString().trim() + " (" + gdbVersion + ")"; //$NON-NLS-1$ //$NON-NLS-2$ + protected String getCLILabel(GdbLaunch launch, ILaunchConfiguration config, String gdbVersion) + throws CoreException { + IPath gdbPath = launch.getGDBPath(); + if (gdbPath == null) { + gdbPath = LaunchUtils.getGDBPath(config); + } + return gdbPath.toString().trim() + " (" + gdbVersion + ")"; //$NON-NLS-1$ //$NON-NLS-2$ } /** diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/META-INF/MANIFEST.MF b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/META-INF/MANIFEST.MF index b3c564b9617..2d00f57eacb 100644 --- a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/META-INF/MANIFEST.MF +++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/META-INF/MANIFEST.MF @@ -13,7 +13,7 @@ Require-Bundle: org.eclipse.ui, org.eclipse.core.variables, org.eclipse.ui.ide, org.eclipse.cdt.debug.core, - org.eclipse.cdt.dsf.gdb;bundle-version="[5.5.0,6.0.0)", + org.eclipse.cdt.dsf.gdb;bundle-version="[6.0.0,7.0.0)", org.eclipse.cdt.dsf.gdb.ui Bundle-ActivationPolicy: lazy Bundle-Vendor: %providerName diff --git a/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/META-INF/MANIFEST.MF b/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/META-INF/MANIFEST.MF index c45ed6ab50a..b09bc3d75e2 100644 --- a/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/META-INF/MANIFEST.MF +++ b/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-SymbolicName: org.eclipse.cdt.llvm.dsf.lldb.core;singleton:=true -Bundle-Version: 1.100.0.qualifier +Bundle-Version: 1.100.100.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Localization: plugin Require-Bundle: org.eclipse.debug.core, diff --git a/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/launching/LLDBLaunchDelegate.java b/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/launching/LLDBLaunchDelegate.java index 54c27cb6c53..e54a667fbce 100644 --- a/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/launching/LLDBLaunchDelegate.java +++ b/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/launching/LLDBLaunchDelegate.java @@ -44,18 +44,6 @@ public class LLDBLaunchDelegate extends GdbLaunchDelegate { super(requireCProject); } - /* - * TODO: The fact that both getCLILabel and GdbLaunch.getGDBPath have to be - * overridden and made consistent seems error prone. getCLILabel should call - * GdbLaunch.getGDBPath somehow by default. This is something that should be - * looked into in dsf-gdb. - */ - @Override - protected String getCLILabel(ILaunchConfiguration config, String gdbVersion) throws CoreException { - return LLDBLaunch.getLLDBPath(config).toString().trim() + " (" + Messages.LLDBLaunchDelegate_mimicking_gdb //$NON-NLS-1$ - + " gdb " + gdbVersion + ")"; //$NON-NLS-1$ //$NON-NLS-2$ - } - @Override protected IDsfDebugServicesFactory newServiceFactory(ILaunchConfiguration config, String version) { return new LLDBServiceFactory(version, config);