Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/jtag
diff options
context:
space:
mode:
authorJonah Graham2018-02-01 19:12:10 +0000
committerJonah Graham2018-02-06 14:08:39 +0000
commit65157ef4d52e91e31d3eac0369a39511a131ec3c (patch)
treee034b54c2ee9330d43eb7eae56779e7f0e7065e2 /jtag
parent345f37874c118a78b3df00cf4d9a18f9875b56ab (diff)
downloadorg.eclipse.cdt-65157ef4d52e91e31d3eac0369a39511a131ec3c.tar.gz
org.eclipse.cdt-65157ef4d52e91e31d3eac0369a39511a131ec3c.tar.xz
org.eclipse.cdt-65157ef4d52e91e31d3eac0369a39511a131ec3c.zip
Bug 530635: Add ability to do "set remotetimeout" via UI
Diffstat (limited to 'jtag')
-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.java61
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/JtagUi.properties4
3 files changed, 58 insertions, 9 deletions
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 21025fa547e..7c78c753870 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
@@ -13,7 +13,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.core.variables,
org.eclipse.ui.ide,
org.eclipse.cdt.debug.core,
- org.eclipse.cdt.dsf.gdb,
+ org.eclipse.cdt.dsf.gdb;bundle-version="[5.5.0,6.0.0)",
org.eclipse.cdt.dsf.gdb.ui
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
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 58113a42d62..de750037630 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, 2017 QNX Software Systems and others.
+ * Copyright (c) 2007, 2018 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -35,12 +35,14 @@ import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants;
import org.eclipse.cdt.dsf.gdb.IGdbDebugPreferenceConstants;
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
import org.eclipse.cdt.dsf.gdb.internal.ui.launching.ICDTLaunchHelpContextIds;
+import org.eclipse.cdt.dsf.gdb.launching.LaunchUtils;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Platform;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
import org.eclipse.debug.ui.StringVariableSelectionDialog;
+import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.custom.StackLayout;
@@ -82,6 +84,8 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
private Text connection;
private String savedJtagDevice;
protected Button fUpdateThreadlistOnSuspend;
+ private Button remoteTimeoutEnabled;
+ private Text remoteTimeoutValue;
@Override
public String getName() {
@@ -102,13 +106,14 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
Composite comp = new Composite(sc, SWT.NONE);
sc.setContent(comp);
- GridLayout layout = new GridLayout();
+ GridLayout layout = new GridLayout(2, false);
comp.setLayout(layout);
Group group = new Group(comp, SWT.NONE);
layout = new GridLayout();
group.setLayout(layout);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
group.setLayoutData(gd);
group.setText(Messages.getString("GDBJtagDebuggerTab.gdbSetupGroup_Text"));
@@ -123,6 +128,10 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
updateLaunchConfigurationDialog();
}
});
+ gd = new GridData();
+ gd.horizontalSpan = 2;
+ fUpdateThreadlistOnSuspend.setLayoutData(gd);
+
// This checkbox needs an explanation. Attach context help to it.
PlatformUI.getWorkbench().getHelpSystem().setHelp(fUpdateThreadlistOnSuspend, "org.eclipse.cdt.dsf.gdb.ui.update_threadlist_button_context"); //$NON-NLS-1$
// Attach context help to this tab.
@@ -192,13 +201,15 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
private void createRemoteControl(Composite parent) {
Group group = new Group(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
+ GridLayout layout = new GridLayout(2, false);
group.setLayout(layout);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
group.setLayoutData(gd);
group.setText(Messages.getString("GDBJtagDebuggerTab.remoteGroup_Text"));
useRemote = new Button(group, SWT.CHECK);
+ useRemote.setLayoutData(GridDataFactory.swtDefaults().span(2, 1).create());
useRemote.setText(Messages.getString("GDBJtagDebuggerTab.useRemote_Text"));
useRemote.addSelectionListener(new SelectionAdapter() {
@Override
@@ -207,11 +218,29 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
updateLaunchConfigurationDialog();
}
});
+
+
+ remoteTimeoutEnabled = new Button(group, SWT.CHECK);
+ remoteTimeoutEnabled.setText(Messages.getString("GDBJtagDebuggerTab.remoteTimeout"));
+ remoteTimeoutEnabled.setToolTipText(Messages.getString("GDBJtagDebuggerTab.remoteTimeoutTooltip"));
+ remoteTimeoutEnabled.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ remoteTimeoutChanged();
+ updateLaunchConfigurationDialog();
+ }
+ });
+ remoteTimeoutValue = new Text(group, SWT.BORDER);
+ gd = new GridData();
+ gd.widthHint = 125;
+ remoteTimeoutValue.setLayoutData(gd);
+ remoteTimeoutValue.setToolTipText(Messages.getString("GDBJtagDebuggerTab.remoteTimeoutTooltip"));
Composite comp = new Composite(group, SWT.NONE);
layout = new GridLayout();
layout.numColumns = 2;
comp.setLayout(layout);
+ comp.setLayoutData(GridDataFactory.swtDefaults().span(2, 1).create());
Label label = new Label(comp, SWT.NONE);
label.setText(Messages.getString("GDBJtagDebuggerTab.jtagDeviceLabel"));
@@ -231,11 +260,12 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
scheduleUpdateJob(); // provides much better performance for Text listeners
}
});
-
+
remoteConnectionParameters = new Composite(group, SWT.NO_TRIM | SWT.NO_FOCUS);
remoteConnectParmsLayout = new StackLayout();
remoteConnectionParameters.setLayout(remoteConnectParmsLayout);
-
+ remoteConnectionParameters.setLayoutData(GridDataFactory.swtDefaults().span(2, 1).create());
+
//
// Create entry fields for TCP/IP connections
//
@@ -342,8 +372,14 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
}
}
+ private void remoteTimeoutChanged() {
+ remoteTimeoutValue.setEnabled(remoteTimeoutEnabled.getSelection());
+ }
+
private void useRemoteChanged() {
boolean enabled = useRemote.getSelection();
+ remoteTimeoutEnabled.setEnabled(enabled);
+ remoteTimeoutValue.setEnabled(remoteTimeoutEnabled.getSelection());
jtagDevice.setEnabled(enabled);
ipAddress.setEnabled(enabled);
portNumber.setEnabled(enabled);
@@ -422,7 +458,14 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
boolean updateThreadsOnSuspend = configuration.getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND,
IGDBLaunchConfigurationConstants.DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND_DEFAULT);
fUpdateThreadlistOnSuspend.setSelection(updateThreadsOnSuspend);
-
+ remoteTimeoutEnabled.setSelection(
+ configuration.getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_ENABLED,
+ LaunchUtils.getRemoteTimeoutEnabledDefault()));
+ remoteTimeoutValue.setText(
+ configuration.getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_VALUE,
+ LaunchUtils.getRemoteTimeoutValueDefault()));
+
+ remoteTimeoutChanged();
useRemoteChanged();
} catch (CoreException e) {
Activator.getDefault().getLog().log(e.getStatus());
@@ -472,7 +515,11 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
}
}
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND,
- fUpdateThreadlistOnSuspend.getSelection());
+ fUpdateThreadlistOnSuspend.getSelection());
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_ENABLED,
+ remoteTimeoutEnabled.getSelection());
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_VALUE,
+ remoteTimeoutValue.getText().trim());
}
@Override
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/JtagUi.properties b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/JtagUi.properties
index 72b7724cc1e..73b135ecdbd 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/JtagUi.properties
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/JtagUi.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2008-2010 QNX Software Systems and others.
+# Copyright (c) 2008, 2018 QNX Software Systems and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
@@ -66,3 +66,5 @@ GDBJtagDebuggerTab.ipAddressLabel=Host name or IP address:
GDBJtagDebuggerTab.portNumberLabel=Port number:
GDBJtagDebuggerTab.connectionLabel=GDB Connection String:
GDBJtagDebuggerTab.update_thread_list_on_suspend=Force thread list update on suspend
+GDBJtagDebuggerTab.remoteTimeout=Remote timeout (seconds):
+GDBJtagDebuggerTab.remoteTimeoutTooltip=Timeout for the remote target to respond. If unchecked, uses GDB default value. See GDB's help for "set remotetimeout num".

Back to the top