1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 560186: Sort JTAG device list

Change-Id: Ieff78b4b527418ff2e4e06c8f3850605e397f619
This commit is contained in:
John Dallaway 2020-02-16 11:34:44 +00:00
parent a7635221af
commit d70521fcf8
4 changed files with 26 additions and 9 deletions

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<component id="org.eclipse.cdt.debug.gdbjtag.core" version="2">
<resource path="src/org/eclipse/cdt/debug/gdbjtag/core/IGDBJtagConstants.java" type="org.eclipse.cdt.debug.gdbjtag.core.IGDBJtagConstants">
<filter id="388194388">
<message_arguments>
<message_argument value="org.eclipse.cdt.debug.gdbjtag.core.IGDBJtagConstants"/>
<message_argument value="DEFAULT_JTAG_DEVICE_ID"/>
</message_arguments>
</filter>
</resource>
</component>

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007 - 2018 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
@ -13,6 +13,7 @@
* Andy Jin - Hardware debugging UI improvements, bug 229946
* John Dallaway - Disable reset and halt by default, bug 529171
* Torbjörn Svensson (STMicroelectronics) - Bug 535024
* John Dallaway - Sort JTAG device list, bug 560186
*******************************************************************************/
package org.eclipse.cdt.debug.gdbjtag.core;
@ -101,7 +102,7 @@ public interface IGDBJtagConstants {
/** @since 7.0 */
public static final String DEFAULT_STOP_AT = ""; //$NON-NLS-1$
/** @since 9.2 */
public static final String DEFAULT_JTAG_DEVICE_ID = ""; //$NON-NLS-1$
public static final String DEFAULT_JTAG_DEVICE_ID = "org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.genericDevice"; //$NON-NLS-1$
/** @since 9.2 */
public static final String DEFAULT_JTAG_DEVICE_NAME = ""; //$NON-NLS-1$
/**

View file

@ -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.1.100.qualifier
Bundle-Version: 8.1.200.qualifier
Bundle-Activator: org.eclipse.cdt.debug.gdbjtag.ui.Activator
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2018 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
@ -20,6 +20,7 @@
* allow connections via serial ports and pipes).
* John Dallaway - Ensure correct SessionType enabled, bug 334110
* Torbjörn Svensson (STMicroelectronics) - Bug 535024
* John Dallaway - Sort JTAG device list, bug 560186
*******************************************************************************/
package org.eclipse.cdt.debug.gdbjtag.ui;
@ -27,6 +28,7 @@ package org.eclipse.cdt.debug.gdbjtag.ui;
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Arrays;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.debug.gdbjtag.core.Activator;
@ -256,9 +258,8 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
GDBJtagDeviceContribution[] availableDevices = GDBJtagDeviceContributionFactory.getInstance()
.getGDBJtagDeviceContribution();
for (int i = 0; i < availableDevices.length; i++) {
jtagDevice.add(availableDevices[i].getDeviceName());
}
Arrays.stream(availableDevices).map(GDBJtagDeviceContribution::getDeviceName).sorted()
.forEach(name -> jtagDevice.add(name));
jtagDevice.addModifyListener(new ModifyListener() {
@Override
@ -564,8 +565,11 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
} else {
String ip = ipAddress.getText().trim();
configuration.setAttribute(IGDBJtagConstants.ATTR_IP_ADDRESS, ip);
int port = Integer.valueOf(portNumber.getText().trim()).intValue();
configuration.setAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER, port);
String port = portNumber.getText().trim();
if (!port.isEmpty()) {
configuration.setAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER,
Integer.valueOf(port).intValue());
}
}
} catch (URISyntaxException e) {
Activator.log(e);
@ -589,6 +593,7 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
configuration.setAttribute(IGDBJtagConstants.ATTR_USE_REMOTE_TARGET,
IGDBJtagConstants.DEFAULT_USE_REMOTE_TARGET);
configuration.setAttribute(IGDBJtagConstants.ATTR_JTAG_DEVICE_ID, IGDBJtagConstants.DEFAULT_JTAG_DEVICE_ID);
configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE);
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND,