Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2014-10-20 04:07:01 -0400
committerUwe Stieber2014-10-20 04:07:01 -0400
commit0e68eb901340431bd902944246a6bd100b5fccd2 (patch)
tree5bec2ae2b8803ed975509789acf7204fb15ed384
parent43cc42b4c7803cfb40c5b8f8711c654bb18ce313 (diff)
downloadorg.eclipse.tcf-0e68eb901340431bd902944246a6bd100b5fccd2.tar.gz
org.eclipse.tcf-0e68eb901340431bd902944246a6bd100b5fccd2.tar.xz
org.eclipse.tcf-0e68eb901340431bd902944246a6bd100b5fccd2.zip
Target Explorer: CDT Remote C/C++ Application: Add support for simulated environments (QEMU) using port mappings
-rw-r--r--target_explorer/features/org.eclipse.tcf.te.tcf.launch.cdt.feature/feature.xml4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/META-INF/MANIFEST.MF4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/interfaces/IRemoteTEConfigurationConstants.java14
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/launching/TEGdbLaunchDelegate.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/nls/Messages.java1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/nls/Messages.properties1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/tabs/TEDSFGDBDebuggerPage.java70
7 files changed, 73 insertions, 27 deletions
diff --git a/target_explorer/features/org.eclipse.tcf.te.tcf.launch.cdt.feature/feature.xml b/target_explorer/features/org.eclipse.tcf.te.tcf.launch.cdt.feature/feature.xml
index 5a06e169a..595206f90 100644
--- a/target_explorer/features/org.eclipse.tcf.te.tcf.launch.cdt.feature/feature.xml
+++ b/target_explorer/features/org.eclipse.tcf.te.tcf.launch.cdt.feature/feature.xml
@@ -43,6 +43,7 @@
<import plugin="org.eclipse.tcf.te.core" version="1.3.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.tcf.te.runtime" version="1.3.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.tcf.te.runtime.concurrent" version="1.3.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.tcf.te.runtime.model" version="1.3.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.tcf.te.runtime.services" version="1.3.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.tcf.te.tcf.core" version="1.3.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.tcf.te.tcf.locator" version="1.3.0" match="greaterOrEqual"/>
@@ -51,7 +52,8 @@
<import plugin="org.eclipse.tcf.te.tcf.processes.core" version="1.3.0" match="greaterOrEqual"/>
<import feature="org.eclipse.tcf.te.tcf.core.feature" version="1.3.0" match="greaterOrEqual"/>
<import feature="org.eclipse.cdt" version="8.3.0" match="greaterOrEqual"/>
- <import plugin="org.eclipse.tcf.te.runtime.model" version="1.3.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.tcf.te.ui.controls" version="1.3.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.tcf.te.ui.swt" version="1.3.0" match="greaterOrEqual"/>
</requires>
<plugin
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/META-INF/MANIFEST.MF
index b8337a0b1..c8875d1ce 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/META-INF/MANIFEST.MF
@@ -28,7 +28,9 @@ Require-Bundle: org.eclipse.cdt.core;bundle-version="5.6.0",
org.eclipse.tcf.te.tcf.locator;bundle-version="1.3.0",
org.eclipse.tcf.te.tcf.filesystem.core;bundle-version="1.3.0",
org.eclipse.tcf.te.tcf.filesystem.ui;bundle-version="1.3.0",
- org.eclipse.tcf.te.tcf.processes.core;bundle-version="1.3.0"
+ org.eclipse.tcf.te.tcf.processes.core;bundle-version="1.3.0",
+ org.eclipse.tcf.te.ui.controls;bundle-version="1.3.0",
+ org.eclipse.tcf.te.ui.swt;bundle-version="1.3.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: %Vendor-Name
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/interfaces/IRemoteTEConfigurationConstants.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/interfaces/IRemoteTEConfigurationConstants.java
index a27b0c6f3..1488c78a4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/interfaces/IRemoteTEConfigurationConstants.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/interfaces/IRemoteTEConfigurationConstants.java
@@ -1,11 +1,11 @@
/*******************************************************************************
* Copyright (c) 2006, 2012 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
* Ewa Matejska (PalmSource) - Adapted from IGDBServerMILaunchConfigurationConstants
* Anna Dushistova (MontaVista) - [181517][usability] Specify commands to be run before remote application launch
* Anna Dushistova (MontaVista) - cloned from IRemoteConnectionConfigurationConstants
@@ -23,6 +23,8 @@ public interface IRemoteTEConfigurationConstants extends
public static final String ATTR_GDBSERVER_PORT = DebugPlugin
.getUniqueIdentifier() + ".ATTR_GDBSERVER_PORT"; //$NON-NLS-1$
+ public static final String ATTR_GDBSERVER_PORT_MAPPED_TO = DebugPlugin
+ .getUniqueIdentifier() + ".ATTR_GDBSERVER_PORT_MAPPED_TO"; //$NON-NLS-1$
public static final String ATTR_GDBSERVER_COMMAND = DebugPlugin
.getUniqueIdentifier() + ".ATTR_GDBSERVER_COMMAND"; //$NON-NLS-1$
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/launching/TEGdbLaunchDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/launching/TEGdbLaunchDelegate.java
index 8c5d67dca..8db57f46e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/launching/TEGdbLaunchDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/launching/TEGdbLaunchDelegate.java
@@ -69,6 +69,10 @@ public class TEGdbLaunchDelegate extends GdbLaunchDelegate {
.getAttribute(
IRemoteTEConfigurationConstants.ATTR_GDBSERVER_PORT,
IRemoteTEConfigurationConstants.ATTR_GDBSERVER_PORT_DEFAULT);
+ String gdbserverPortNumberMappedTo = config
+ .getAttribute(
+ IRemoteTEConfigurationConstants.ATTR_GDBSERVER_PORT_MAPPED_TO,
+ (String)null);
String gdbserverCommand = config
.getAttribute(
IRemoteTEConfigurationConstants.ATTR_GDBSERVER_COMMAND,
@@ -173,7 +177,7 @@ public class TEGdbLaunchDelegate extends GdbLaunchDelegate {
TEHelper.getCurrentConnection(config).getPeer()
.getAttributes().get(IPeer.ATTR_IP_HOST));
wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_PORT,
- gdbserverPortNumber);
+ gdbserverPortNumberMappedTo == null || "".equals(gdbserverPortNumberMappedTo) ? gdbserverPortNumber : gdbserverPortNumberMappedTo); //$NON-NLS-1$
wc.doSave();
try {
super.launch(config, mode, launch, monitor);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/nls/Messages.java
index 0e9f329f6..bb6bbbc3c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/nls/Messages.java
@@ -27,6 +27,7 @@ public class Messages extends NLS {
public static String Gdbserver_Settings_Tab_Name;
public static String Port_number_textfield_label;
+ public static String Port_number_mapped_to_textfield_label;
public static String Remote_GDB_Debugger_Options;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/nls/Messages.properties
index 981e9ede1..420f0eea2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/nls/Messages.properties
@@ -46,6 +46,7 @@ RemoteCMainTab_New=New...
Gdbserver_Settings_Tab_Name=Gdbserver Settings
Gdbserver_name_textfield_label=Gdbserver name:
Port_number_textfield_label=Port number:
+Port_number_mapped_to_textfield_label=mapped to:
RemoteCMainTab_Remote_Path_Browse_Button_Title=Select Remote C/C++ Application File
RemoteCMainTab_Properties=Properties...
RemoteCMainTab_Properties_title=Properties
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/tabs/TEDSFGDBDebuggerPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/tabs/TEDSFGDBDebuggerPage.java
index 04679cfa9..fb5a1b2b9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/tabs/TEDSFGDBDebuggerPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/tabs/TEDSFGDBDebuggerPage.java
@@ -31,6 +31,7 @@ import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Text;
import org.eclipse.tcf.te.tcf.launch.cdt.interfaces.IRemoteTEConfigurationConstants;
import org.eclipse.tcf.te.tcf.launch.cdt.nls.Messages;
+import org.eclipse.tcf.te.ui.controls.validator.PortNumberVerifyListener;
@SuppressWarnings("restriction")
public class TEDSFGDBDebuggerPage extends GdbDebuggerPage {
@@ -39,6 +40,8 @@ public class TEDSFGDBDebuggerPage extends GdbDebuggerPage {
protected Text fGDBServerPortNumberText = null;
+ protected Text fPortNumberMappedToText = null;
+
private boolean fIsInitializing = false;
public TEDSFGDBDebuggerPage() {
@@ -59,6 +62,9 @@ public class TEDSFGDBDebuggerPage extends GdbDebuggerPage {
configuration.setAttribute(
IRemoteTEConfigurationConstants.ATTR_GDBSERVER_PORT,
IRemoteTEConfigurationConstants.ATTR_GDBSERVER_PORT_DEFAULT);
+ configuration.setAttribute(
+ IRemoteTEConfigurationConstants.ATTR_GDBSERVER_PORT_MAPPED_TO,
+ (String)null);
}
@Override
@@ -68,6 +74,7 @@ public class TEDSFGDBDebuggerPage extends GdbDebuggerPage {
String gdbserverCommand = null;
String gdbserverPortNumber = null;
+ String portNumberMappedTo = null;
try {
gdbserverCommand = configuration
.getAttribute(
@@ -82,8 +89,16 @@ public class TEDSFGDBDebuggerPage extends GdbDebuggerPage {
IRemoteTEConfigurationConstants.ATTR_GDBSERVER_PORT_DEFAULT);
} catch (CoreException e) {
}
+ try {
+ portNumberMappedTo = configuration
+ .getAttribute(
+ IRemoteTEConfigurationConstants.ATTR_GDBSERVER_PORT_MAPPED_TO,
+ (String)null);
+ } catch (CoreException e) {
+ }
if (fGDBServerCommandText != null) fGDBServerCommandText.setText(gdbserverCommand);
if (fGDBServerPortNumberText != null) fGDBServerPortNumberText.setText(gdbserverPortNumber);
+ if (fPortNumberMappedToText != null) fPortNumberMappedToText.setText(portNumberMappedTo != null ? portNumberMappedTo : ""); //$NON-NLS-1$
setInitializing(false);
}
@@ -96,6 +111,10 @@ public class TEDSFGDBDebuggerPage extends GdbDebuggerPage {
str = fGDBServerPortNumberText != null ? fGDBServerPortNumberText.getText().trim() : null;
configuration.setAttribute(
IRemoteTEConfigurationConstants.ATTR_GDBSERVER_PORT, str);
+ str = fPortNumberMappedToText != null ? fPortNumberMappedToText.getText().trim() : null;
+ configuration.setAttribute(
+ IRemoteTEConfigurationConstants.ATTR_GDBSERVER_PORT_MAPPED_TO,
+ str != null && !"".equals(str) ? str : null); //$NON-NLS-1$
}
protected void createGdbserverSettingsTab(TabFolder tabFolder) {
@@ -103,25 +122,21 @@ public class TEDSFGDBDebuggerPage extends GdbDebuggerPage {
tabItem.setText(Messages.Gdbserver_Settings_Tab_Name);
Composite comp = new Composite(tabFolder, SWT.NULL);
- comp.setLayout(new GridLayout(1, true));
+ comp.setLayout(new GridLayout(1, false));
comp.setLayoutData(new GridData(GridData.FILL_BOTH));
- ((GridLayout) comp.getLayout()).makeColumnsEqualWidth = false;
comp.setFont(tabFolder.getFont());
tabItem.setControl(comp);
Composite subComp = new Composite(comp, SWT.NULL);
- subComp.setLayout(new GridLayout(2, true));
- subComp.setLayoutData(new GridData(GridData.FILL_BOTH));
- ((GridLayout) subComp.getLayout()).makeColumnsEqualWidth = false;
+ subComp.setLayout(new GridLayout(2, false));
+ subComp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
subComp.setFont(tabFolder.getFont());
Label label = new Label(subComp, SWT.LEFT);
label.setText(Messages.Gdbserver_name_textfield_label);
- GridData gd = new GridData();
- label.setLayoutData(gd);
fGDBServerCommandText = new Text(subComp, SWT.SINGLE | SWT.BORDER);
- GridData data = new GridData();
+ GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
fGDBServerCommandText.setLayoutData(data);
fGDBServerCommandText.addModifyListener(new ModifyListener() {
@@ -131,13 +146,19 @@ public class TEDSFGDBDebuggerPage extends GdbDebuggerPage {
updateLaunchConfigurationDialog();
}
});
+
label = new Label(subComp, SWT.LEFT);
label.setText(Messages.Port_number_textfield_label);
- gd = new GridData();
- label.setLayoutData(gd);
- fGDBServerPortNumberText = new Text(subComp, SWT.SINGLE | SWT.BORDER);
- data = new GridData();
+ Composite subsubComp = new Composite(subComp, SWT.NULL);
+ GridLayout layout = new GridLayout(3, false);
+ layout.marginHeight = 0; layout.marginWidth = 0;
+ subsubComp.setLayout(layout);
+ subsubComp.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
+ subsubComp.setFont(tabFolder.getFont());
+
+ fGDBServerPortNumberText = new Text(subsubComp, SWT.SINGLE | SWT.BORDER);
+ data = new GridData(SWT.FILL, SWT.CENTER, true, false);
fGDBServerPortNumberText.setLayoutData(data);
fGDBServerPortNumberText.addModifyListener(new ModifyListener() {
@@ -147,14 +168,27 @@ public class TEDSFGDBDebuggerPage extends GdbDebuggerPage {
updateLaunchConfigurationDialog();
}
});
+ fGDBServerPortNumberText.addVerifyListener(new PortNumberVerifyListener(PortNumberVerifyListener.ATTR_DECIMAL | PortNumberVerifyListener.ATTR_HEX));
+
+ label = new Label(subsubComp, SWT.LEFT);
+ label.setText(Messages.Port_number_mapped_to_textfield_label);
+
+ fPortNumberMappedToText = new Text(subsubComp, SWT.SINGLE | SWT.BORDER);
+ data = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ fPortNumberMappedToText.setLayoutData(data);
+ fPortNumberMappedToText.addModifyListener(new ModifyListener() {
+
+ @SuppressWarnings("synthetic-access")
+ @Override
+ public void modifyText(ModifyEvent evt) {
+ updateLaunchConfigurationDialog();
+ }
+ });
+ fPortNumberMappedToText.addVerifyListener(new PortNumberVerifyListener(PortNumberVerifyListener.ATTR_DECIMAL | PortNumberVerifyListener.ATTR_HEX));
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.cdt.debug.mi.internal.ui.GDBDebuggerPage#createTabs(org.eclipse
- * .swt.widgets.TabFolder)
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.dsf.gdb.internal.ui.launching.GdbDebuggerPage#createTabs(org.eclipse.swt.widgets.TabFolder)
*/
@Override
public void createTabs(TabFolder tabFolder) {

Back to the top