Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonah Graham2018-02-01 19:12:10 +0000
committerJonah Graham2018-02-06 14:08:39 +0000
commit65157ef4d52e91e31d3eac0369a39511a131ec3c (patch)
treee034b54c2ee9330d43eb7eae56779e7f0e7065e2 /launch/org.eclipse.cdt.docker.launcher
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 'launch/org.eclipse.cdt.docker.launcher')
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/Messages.java6
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/RemoteDebuggerPage.java82
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/messages.properties4
3 files changed, 87 insertions, 5 deletions
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/Messages.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/Messages.java
index ac7ec788d2e..bb380e40c65 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/Messages.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/Messages.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2013, 2015 Red Hat, Inc.
+ * Copyright (c) 2012, 2018 Red Hat, Inc.
* 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
@@ -107,6 +107,10 @@ public class Messages extends NLS {
public static String ContainerCommandLauncher_invalid_values;
+ public static String Gdbserver_Settings_Remotetimeout_label;
+
+ public static String Gdbserver_Settings_Remotetimeout_tooltip;
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/RemoteDebuggerPage.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/RemoteDebuggerPage.java
index d1962bbd96c..2663eeacce6 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/RemoteDebuggerPage.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/RemoteDebuggerPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2010, 2015 PalmSource, Inc. and others.
+ * Copyright (c) 2006, 2018 PalmSource, Inc. 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
@@ -15,14 +15,19 @@
package org.eclipse.cdt.internal.docker.launcher;
+import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants;
+import org.eclipse.cdt.dsf.gdb.launching.LaunchUtils;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TabFolder;
@@ -40,6 +45,10 @@ public class RemoteDebuggerPage extends GdbDebuggerPage {
protected Text fGDBServerPortNumberText;
+ protected Button fRemoteTimeoutEnabledCheckbox;
+
+ protected Text fRemoteTimeoutValueText;
+
@Override
public String getName() {
return Messages.Remote_GDB_Debugger_Options;
@@ -52,6 +61,12 @@ public class RemoteDebuggerPage extends GdbDebuggerPage {
ILaunchConstants.ATTR_GDBSERVER_COMMAND_DEFAULT);
configuration.setAttribute(ILaunchConstants.ATTR_GDBSERVER_PORT,
ILaunchConstants.ATTR_GDBSERVER_PORT_DEFAULT);
+ configuration.setAttribute(
+ IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_ENABLED,
+ LaunchUtils.getRemoteTimeoutEnabledDefault());
+ configuration.setAttribute(
+ IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_VALUE,
+ LaunchUtils.getRemoteTimeoutValueDefault());
}
@Override
@@ -59,6 +74,8 @@ public class RemoteDebuggerPage extends GdbDebuggerPage {
super.initializeFrom(configuration);
String gdbserverCommand = null;
String gdbserverPortNumber = null;
+ boolean remoteTimeoutEnabled = false;
+ String remoteTimeoutValue = null;
try {
gdbserverCommand = configuration.getAttribute(
ILaunchConstants.ATTR_GDBSERVER_COMMAND,
@@ -71,8 +88,23 @@ public class RemoteDebuggerPage extends GdbDebuggerPage {
ILaunchConstants.ATTR_GDBSERVER_PORT_DEFAULT);
} catch (CoreException e) {
}
+ try {
+ remoteTimeoutEnabled = configuration.getAttribute(
+ IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_ENABLED,
+ LaunchUtils.getRemoteTimeoutEnabledDefault());
+ } catch (CoreException e) {
+ }
+ try {
+ remoteTimeoutValue = configuration.getAttribute(
+ IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_VALUE,
+ LaunchUtils.getRemoteTimeoutValueDefault());
+ } catch (CoreException e) {
+ }
fGDBServerCommandText.setText(gdbserverCommand);
fGDBServerPortNumberText.setText(gdbserverPortNumber);
+ fRemoteTimeoutEnabledCheckbox.setSelection(remoteTimeoutEnabled);
+ fRemoteTimeoutValueText.setText(remoteTimeoutValue);
+ remoteTimeoutEnabledChanged();
}
@Override
@@ -85,6 +117,15 @@ public class RemoteDebuggerPage extends GdbDebuggerPage {
str = fGDBServerPortNumberText.getText();
str.trim();
configuration.setAttribute(ILaunchConstants.ATTR_GDBSERVER_PORT, str);
+ boolean b = fRemoteTimeoutEnabledCheckbox.getSelection();
+ configuration.setAttribute(
+ IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_ENABLED,
+ b);
+ str = fRemoteTimeoutValueText.getText();
+ str.trim();
+ configuration.setAttribute(
+ IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_VALUE,
+ str);
}
protected void createGdbserverSettingsTab(TabFolder tabFolder) {
@@ -110,7 +151,7 @@ public class RemoteDebuggerPage extends GdbDebuggerPage {
label.setLayoutData(gd);
fGDBServerCommandText = new Text(subComp, SWT.SINGLE | SWT.BORDER);
- GridData data = new GridData();
+ GridData data = new GridData(SWT.FILL, SWT.TOP, true, false);
fGDBServerCommandText.setLayoutData(data);
fGDBServerCommandText.addModifyListener(new ModifyListener() {
@@ -124,7 +165,7 @@ public class RemoteDebuggerPage extends GdbDebuggerPage {
label.setLayoutData(gd);
fGDBServerPortNumberText = new Text(subComp, SWT.SINGLE | SWT.BORDER);
- data = new GridData();
+ data = new GridData(SWT.FILL, SWT.TOP, true, false);
fGDBServerPortNumberText.setLayoutData(data);
fGDBServerPortNumberText.addModifyListener(new ModifyListener() {
@@ -132,6 +173,41 @@ public class RemoteDebuggerPage extends GdbDebuggerPage {
updateLaunchConfigurationDialog();
}
});
+
+ fRemoteTimeoutEnabledCheckbox = new Button(subComp, SWT.CHECK);
+ fRemoteTimeoutEnabledCheckbox
+ .setText(Messages.Gdbserver_Settings_Remotetimeout_label);
+ fRemoteTimeoutEnabledCheckbox
+ .setToolTipText(
+ Messages.Gdbserver_Settings_Remotetimeout_tooltip);
+ gd = new GridData();
+ fRemoteTimeoutEnabledCheckbox.setLayoutData(gd);
+ fRemoteTimeoutEnabledCheckbox
+ .addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ remoteTimeoutEnabledChanged();
+ updateLaunchConfigurationDialog();
+ }
+ });
+
+ fRemoteTimeoutValueText = new Text(subComp, SWT.SINGLE | SWT.BORDER);
+ data = new GridData(SWT.FILL, SWT.TOP, true, false);
+ fRemoteTimeoutValueText.setLayoutData(data);
+ fRemoteTimeoutValueText.setToolTipText(
+ Messages.Gdbserver_Settings_Remotetimeout_tooltip);
+ fRemoteTimeoutValueText.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent evt) {
+ updateLaunchConfigurationDialog();
+ }
+ });
+ remoteTimeoutEnabledChanged();
+ }
+
+ private void remoteTimeoutEnabledChanged() {
+ fRemoteTimeoutValueText
+ .setEnabled(fRemoteTimeoutEnabledCheckbox.getSelection());
}
/*
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/messages.properties b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/messages.properties
index a545210b63a..576419a814e 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/messages.properties
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/messages.properties
@@ -1,5 +1,5 @@
#*******************************************************************************
-# Copyright (c) 2015 Red Hat.
+# Copyright (c) 2015, 2018 Red Hat.
# 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
@@ -100,3 +100,5 @@ GDBDebuggerPage_tracepoint_mode_auto=Automatic
StandardGDBDebuggerPage14=Use full file path to set breakpoints
+Gdbserver_Settings_Remotetimeout_label=Remote timeout (seconds):
+Gdbserver_Settings_Remotetimeout_tooltip=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