Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jtag
diff options
context:
space:
mode:
authorAlena Laskavaia2008-07-28 16:58:41 -0400
committerAlena Laskavaia2008-07-28 16:58:41 -0400
commit66b2e1ceeef72924e043dc031f3d366b151d0faf (patch)
tree751abf84cc4728c3cb05467682a03eaf30ca8fab /jtag
parentb10d7e75866222debf5838586116e76f8eb96e14 (diff)
downloadorg.eclipse.cdt-66b2e1ceeef72924e043dc031f3d366b151d0faf.tar.gz
org.eclipse.cdt-66b2e1ceeef72924e043dc031f3d366b151d0faf.tar.xz
org.eclipse.cdt-66b2e1ceeef72924e043dc031f3d366b151d0faf.zip
[241279] - fix for values reverting to defaults
Diffstat (limited to 'jtag')
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDebuggerTab.java35
1 files changed, 21 insertions, 14 deletions
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDebuggerTab.java b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDebuggerTab.java
index b5af4a2d31..e5a10ae970 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDebuggerTab.java
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDebuggerTab.java
@@ -8,6 +8,7 @@
* Contributors:
* QNX Software Systems - Initial API and implementation
* Andy Jin - Hardware debugging UI improvements, bug 229946
+ * Anna Dushistova(MontaVista) - Hardware Debugging: Host name or ip address not saving in the debug configuration, bug 241279
*******************************************************************************/
package org.eclipse.cdt.debug.gdbjtag.ui;
@@ -65,6 +66,8 @@ public class GDBJtagDebuggerTab extends AbstractLaunchConfigurationTab {
private Text ipAddress;
private Text portNumber;
private Combo jtagDevice;
+ private String savedJtagDevice;
+
public String getName() {
return TAB_NAME;
@@ -302,24 +305,26 @@ public class GDBJtagDebuggerTab extends AbstractLaunchConfigurationTab {
* @param text
*/
protected void updateDeviceIpPort(String selectedDeviceName) {
- GDBJtagDeviceContribution[] availableDevices = GDBJtagDeviceContributionFactory.
- getInstance().getGDBJtagDeviceContribution();
+ if (selectedDeviceName.equals(savedJtagDevice)) {
+ return;
+ }
+ GDBJtagDeviceContribution[] availableDevices = GDBJtagDeviceContributionFactory.getInstance()
+ .getGDBJtagDeviceContribution();
IGDBJtagDevice selectedDevice = null;
for (int i = 0; i < availableDevices.length; i++) {
String name = availableDevices[i].getDeviceName();
if (name.equals(selectedDeviceName)) {
- try {
- selectedDevice = availableDevices[i].getDevice();
- } catch (NullPointerException e) {
- return;
+ selectedDevice = availableDevices[i].getDevice();
+ if (selectedDevice != null) {
+ String ip = selectedDevice.getDefaultIpAddress();
+ ipAddress.setText(ip);
+ String port = selectedDevice.getDefaultPortNumber();
+ portNumber.setText(port);
+ updateLaunchConfigurationDialog();
+ break;
}
- break;
}
}
- String ip = selectedDevice.getDefaultIpAddress();
- ipAddress.setText(ip);
- String port = selectedDevice.getDefaultPortNumber();
- portNumber.setText(port);
}
private void useRemoteChanged() {
@@ -366,15 +371,16 @@ public class GDBJtagDebuggerTab extends AbstractLaunchConfigurationTab {
int portNumberAttr = configuration.getAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER, IGDBJtagConstants.DEFAULT_PORT_NUMBER);
portNumber.setText(String.valueOf(portNumberAttr));
- String jtagDeviceString = configuration.getAttribute(IGDBJtagConstants.ATTR_JTAG_DEVICE, "");
+ savedJtagDevice = configuration.getAttribute(IGDBJtagConstants.ATTR_JTAG_DEVICE, "");
for (int i = 0; i < jtagDevice.getItemCount(); i++) {
- if (jtagDevice.getItem(i).equals(jtagDeviceString)) {
+ if (jtagDevice.getItem(i).equals(savedJtagDevice)) {
jtagDevice.select(i);
}
}
} catch (CoreException e) {
Activator.getDefault().getLog().log(e.getStatus());
}
+
}
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
@@ -382,7 +388,8 @@ public class GDBJtagDebuggerTab extends AbstractLaunchConfigurationTab {
configuration.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_COMMAND_FACTORY, commandFactory.getText());
configuration.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_PROTOCOL, miProtocol.getText());
configuration.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_VERBOSE_MODE, verboseMode.getSelection());
- configuration.setAttribute(IGDBJtagConstants.ATTR_JTAG_DEVICE, jtagDevice.getText());
+ savedJtagDevice = jtagDevice.getText();
+ configuration.setAttribute(IGDBJtagConstants.ATTR_JTAG_DEVICE, savedJtagDevice);
configuration.setAttribute(IGDBJtagConstants.ATTR_USE_REMOTE_TARGET, useRemote.getSelection());
configuration.setAttribute(IGDBJtagConstants.ATTR_IP_ADDRESS, ipAddress.getText().trim());
try {

Back to the top