Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jtag
diff options
context:
space:
mode:
authorAlena Laskavaia2008-07-28 20:59:15 +0000
committerAlena Laskavaia2008-07-28 20:59:15 +0000
commit5c9f875147b568cfec6c3d8fe0d4785f70fbc396 (patch)
tree36dc554498efa4686fd7db78cae1015b3fcd4c58 /jtag
parent341814f005057ce4a02b2cd484e6913acbb85f81 (diff)
downloadorg.eclipse.cdt-5c9f875147b568cfec6c3d8fe0d4785f70fbc396.tar.gz
org.eclipse.cdt-5c9f875147b568cfec6c3d8fe0d4785f70fbc396.tar.xz
org.eclipse.cdt-5c9f875147b568cfec6c3d8fe0d4785f70fbc396.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 b5af4a2d31d..e5a10ae9705 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