mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-05 15:25:49 +02:00
Bug 566462: Eliminate deprecated GDB hardware debug API
Change-Id: Ie0d5fa1beafaa0a203a9f4f043835b401cc6929d
This commit is contained in:
parent
07b50ba2a2
commit
5188547f31
7 changed files with 20 additions and 34 deletions
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2019 Kichwa Coders Ltd and others.
|
||||
* Copyright (c) 2019, 2020 Kichwa Coders Ltd and others.
|
||||
*
|
||||
* This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License 2.0
|
||||
|
@ -10,6 +10,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* John Dallaway - Use 'reset and halt' command (Bug 535163)
|
||||
* John Dallaway - Eliminate deprecated API (Bug 566462)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.dap.gdbjtag;
|
||||
|
||||
|
@ -59,6 +60,8 @@ public class DapGdbJtagLaunchDelegate extends DapLaunchDelegate {
|
|||
// preRunCommands field
|
||||
public static final String PRE_RUN_COMMANDS = "preRunCommands"; //$NON-NLS-1$
|
||||
|
||||
private static final String ATTR_JTAG_DEVICE = "org.eclipse.cdt.debug.gdbjtag.core.jtagDevice"; //$NON-NLS-1$
|
||||
|
||||
@Override
|
||||
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor,
|
||||
boolean targetDebugAdapter, Map<String, Object> params) throws CoreException {
|
||||
|
@ -349,7 +352,6 @@ public class DapGdbJtagLaunchDelegate extends DapLaunchDelegate {
|
|||
return IGDBJtagConstants.DEFAULT_JTAG_DEVICE_NAME;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private GDBJtagDeviceContribution getGDBJtagDeviceContribution(Map<String, Object> attributes)
|
||||
throws CoreException {
|
||||
if (attributes.containsKey(IGDBJtagConstants.ATTR_JTAG_DEVICE_ID)) {
|
||||
|
@ -360,8 +362,8 @@ public class DapGdbJtagLaunchDelegate extends DapLaunchDelegate {
|
|||
}
|
||||
|
||||
// Fall back to old behavior with name only if ID is missing
|
||||
if (attributes.containsKey(IGDBJtagConstants.ATTR_JTAG_DEVICE)) {
|
||||
String deviceName = CDebugUtils.getAttribute(attributes, IGDBJtagConstants.ATTR_JTAG_DEVICE, ""); //$NON-NLS-1$
|
||||
if (attributes.containsKey(ATTR_JTAG_DEVICE)) {
|
||||
String deviceName = CDebugUtils.getAttribute(attributes, ATTR_JTAG_DEVICE, ""); //$NON-NLS-1$
|
||||
if (!deviceName.isEmpty()) {
|
||||
return GDBJtagDeviceContributionFactory.getInstance().findByDeviceName(deviceName);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.cdt.debug.gdbjtag.core;singleton:=true
|
||||
Bundle-Version: 9.6.0.qualifier
|
||||
Bundle-Version: 10.0.0.qualifier
|
||||
Bundle-Activator: org.eclipse.cdt.debug.gdbjtag.core.Activator
|
||||
Bundle-Localization: plugin
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007, 2019 QNX Software Systems and others.
|
||||
* Copyright (c) 2007, 2020 QNX Software Systems and others.
|
||||
*
|
||||
* This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License 2.0
|
||||
|
@ -23,6 +23,7 @@
|
|||
* Torbjörn Svensson (STMicroelectronics) - Bug 535024
|
||||
* John Dallaway - Report download progress (Bug 543149)
|
||||
* John Dallaway - Use 'reset and halt' command (Bug 535163)
|
||||
* John Dallaway - Eliminate deprecated API (Bug 566462)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.gdbjtag.core;
|
||||
|
||||
|
@ -98,6 +99,8 @@ import org.eclipse.core.variables.VariablesPlugin;
|
|||
*/
|
||||
public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
|
||||
|
||||
private static final String ATTR_JTAG_DEVICE = Activator.PLUGIN_ID + ".jtagDevice"; //$NON-NLS-1$
|
||||
|
||||
private abstract class DownloadStatusListener implements IEventListener {
|
||||
|
||||
private static final String ASYNC_CLASS_DOWNLOAD = "download"; //$NON-NLS-1$
|
||||
|
@ -754,7 +757,6 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
|
|||
return IGDBJtagConstants.DEFAULT_JTAG_DEVICE_NAME;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private GDBJtagDeviceContribution getGDBJtagDeviceContribution() {
|
||||
Map<String, Object> attributes = getAttributes();
|
||||
if (attributes.containsKey(IGDBJtagConstants.ATTR_JTAG_DEVICE_ID)) {
|
||||
|
@ -765,8 +767,8 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
|
|||
}
|
||||
|
||||
// Fall back to old behavior with name only if ID is missing
|
||||
if (attributes.containsKey(IGDBJtagConstants.ATTR_JTAG_DEVICE)) {
|
||||
String deviceName = CDebugUtils.getAttribute(attributes, IGDBJtagConstants.ATTR_JTAG_DEVICE, ""); //$NON-NLS-1$
|
||||
if (attributes.containsKey(ATTR_JTAG_DEVICE)) {
|
||||
String deviceName = CDebugUtils.getAttribute(attributes, ATTR_JTAG_DEVICE, ""); //$NON-NLS-1$
|
||||
if (!deviceName.isEmpty()) {
|
||||
return GDBJtagDeviceContributionFactory.getInstance().findByDeviceName(deviceName);
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
* John Dallaway - Disable reset and halt by default, bug 529171
|
||||
* Torbjörn Svensson (STMicroelectronics) - Bug 535024
|
||||
* John Dallaway - Sort JTAG device list, bug 560186
|
||||
* John Dallaway - Eliminate deprecated API, bug 566462
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.debug.gdbjtag.core;
|
||||
|
@ -29,9 +30,6 @@ public interface IGDBJtagConstants {
|
|||
public static final String ATTR_USE_REMOTE_TARGET = Activator.PLUGIN_ID + ".useRemoteTarget"; //$NON-NLS-1$
|
||||
public static final String ATTR_IP_ADDRESS = Activator.PLUGIN_ID + ".ipAddress"; //$NON-NLS-1$
|
||||
public static final String ATTR_PORT_NUMBER = Activator.PLUGIN_ID + ".portNumber"; //$NON-NLS-1$
|
||||
/** @deprecated Use {@link #ATTR_JTAG_DEVICE ID} instead */
|
||||
@Deprecated
|
||||
public static final String ATTR_JTAG_DEVICE = Activator.PLUGIN_ID + ".jtagDevice"; //$NON-NLS-1$
|
||||
/** @since 9.2 */
|
||||
public static final String ATTR_JTAG_DEVICE_ID = Activator.PLUGIN_ID + ".jtagDeviceId"; //$NON-NLS-1$
|
||||
|
||||
|
@ -67,7 +65,7 @@ public interface IGDBJtagConstants {
|
|||
|
||||
public static final boolean DEFAULT_DO_RESET = false;
|
||||
public static final boolean DEFAULT_DO_HALT = false;
|
||||
public static final int DEFAULT_DELAY = 3;
|
||||
public static final int DEFAULT_DELAY = 0;
|
||||
public static final boolean DEFAULT_LOAD_IMAGE = true;
|
||||
public static final boolean DEFAULT_LOAD_SYMBOLS = true;
|
||||
public static final boolean DEFAULT_SET_PC_REGISTER = false;
|
||||
|
@ -101,19 +99,7 @@ public interface IGDBJtagConstants {
|
|||
public static final String DEFAULT_PC_REGISTER = ""; //$NON-NLS-1$
|
||||
/** @since 7.0 */
|
||||
public static final String DEFAULT_STOP_AT = ""; //$NON-NLS-1$
|
||||
/**
|
||||
* @since 9.2
|
||||
* @deprecated Use a local String if necessary
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String DEFAULT_JTAG_DEVICE_ID = ""; //$NON-NLS-1$
|
||||
/** @since 9.2 */
|
||||
public static final String DEFAULT_JTAG_DEVICE_NAME = ""; //$NON-NLS-1$
|
||||
/**
|
||||
* @since 7.0
|
||||
* @deprecated Use a local String if necessary
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String DEFAULT_JTAG_DEVICE = ""; //$NON-NLS-1$
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.cdt.debug.gdbjtag.ui;singleton:=true
|
||||
Bundle-Version: 8.2.0.qualifier
|
||||
Bundle-Version: 9.0.0.qualifier
|
||||
Bundle-Activator: org.eclipse.cdt.debug.gdbjtag.ui.Activator
|
||||
Bundle-Localization: plugin
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
* John Dallaway - Ensure correct SessionType enabled, bug 334110
|
||||
* Torbjörn Svensson (STMicroelectronics) - Bug 535024
|
||||
* John Dallaway - Sort JTAG device list, bug 560186
|
||||
* John Dallaway - Eliminate deprecated API, bug 566462
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.debug.gdbjtag.ui;
|
||||
|
@ -78,6 +79,7 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
|
|||
private static final String TAB_NAME = Messages.getString("GDBJtagDebuggerTab.tabName"); //$NON-NLS-1$
|
||||
private static final String TAB_ID = "org.eclipse.cdt.debug.gdbjtag.ui.debuggertab.dsf"; //$NON-NLS-1$
|
||||
private static final String DEFAULT_JTAG_DEVICE_ID = "org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.genericDevice"; //$NON-NLS-1$
|
||||
private static final String ATTR_JTAG_DEVICE = "org.eclipse.cdt.debug.gdbjtag.core.jtagDevice"; //$NON-NLS-1$
|
||||
|
||||
private Text gdbCommand;
|
||||
private Button useRemote;
|
||||
|
@ -451,8 +453,7 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
|
|||
}
|
||||
|
||||
// Fall back to old behavior with name only if ID is missing
|
||||
@SuppressWarnings("deprecation")
|
||||
String deviceName = configuration.getAttribute(IGDBJtagConstants.ATTR_JTAG_DEVICE, (String) null);
|
||||
String deviceName = configuration.getAttribute(ATTR_JTAG_DEVICE, (String) null);
|
||||
if (deviceName != null) {
|
||||
return GDBJtagDeviceContributionFactory.getInstance().findByDeviceName(deviceName);
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
* Andy Jin - Hardware debugging UI improvements, bug 229946
|
||||
* Andy Jin - Added DSF debugging, bug 248593
|
||||
* John Dallaway - Execute run commands before resume, bug 525692
|
||||
* John Dallaway - Eliminate deprecated API, bug 566462
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.debug.gdbjtag.ui;
|
||||
|
@ -122,7 +123,6 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
|
|||
|
||||
createInitGroup(comp);
|
||||
createLoadGroup(comp);
|
||||
createRunOptionGroup(comp);
|
||||
createRunGroup(comp);
|
||||
|
||||
sc.setMinSize(comp.computeSize(SWT.DEFAULT, SWT.DEFAULT));
|
||||
|
@ -439,11 +439,6 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
|
|||
symbolsFileBrowse.setEnabled(enabled);
|
||||
}
|
||||
|
||||
/** Implementation migrated to {@link #createRunGroup(Composite)} */
|
||||
@Deprecated
|
||||
public void createRunOptionGroup(Composite parent) {
|
||||
}
|
||||
|
||||
public void createRunGroup(Composite parent) {
|
||||
Group group = new Group(parent, SWT.NONE);
|
||||
GridLayout layout = new GridLayout();
|
||||
|
|
Loading…
Add table
Reference in a new issue