Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Dallaway2020-02-16 11:34:44 +0000
committerJohn Dallaway2020-02-17 20:30:42 +0000
commitd70521fcf848c714bee4c0656f549ea3afa1cac7 (patch)
tree647710849ad8d78528c75c386ae4bec1b6ab60cd
parenta7635221af0e8aa12a9cea8500a5be6055ed30a8 (diff)
downloadorg.eclipse.cdt-master.tar.gz
org.eclipse.cdt-master.tar.xz
org.eclipse.cdt-master.zip
Bug 560186: Sort JTAG device listHEADmaster
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/.settings/.api_filters11
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/IGDBJtagConstants.java5
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/META-INF/MANIFEST.MF2
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDSFDebuggerTab.java17
4 files changed, 26 insertions, 9 deletions
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/.settings/.api_filters b/jtag/org.eclipse.cdt.debug.gdbjtag.core/.settings/.api_filters
new file mode 100644
index 0000000000..4b5a859225
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/.settings/.api_filters
@@ -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>
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/IGDBJtagConstants.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/IGDBJtagConstants.java
index 1e9f5ed1c3..5d947efd89 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/IGDBJtagConstants.java
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/IGDBJtagConstants.java
@@ -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$
/**
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 f1d3e5f449..d8fc6c7e86 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
@@ -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,
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDSFDebuggerTab.java b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDSFDebuggerTab.java
index c2913f739d..40efd5e8d5 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDSFDebuggerTab.java
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDSFDebuggerTab.java
@@ -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,

Back to the top