Skip to main content
summaryrefslogtreecommitdiffstats
path: root/cross
diff options
context:
space:
mode:
authorJonah Graham2016-03-08 18:03:16 -0500
committerMarc Khouzam2016-03-08 19:18:05 -0500
commitff7f25b94d9d4978be6ebe32cc2b39d924de6062 (patch)
tree016c889443cea4de4dd8bae80d83ef1e46545ded /cross
parent219cf56e7f8931e0f896aee95c2cc527be94d3ac (diff)
downloadorg.eclipse.cdt-ff7f25b94d9d4978be6ebe32cc2b39d924de6062.tar.gz
org.eclipse.cdt-ff7f25b94d9d4978be6ebe32cc2b39d924de6062.tar.xz
org.eclipse.cdt-ff7f25b94d9d4978be6ebe32cc2b39d924de6062.zip
Bug 484900: Remove Majority of CDI classes
This is the first change to remove CDI from CDT. The CDI model implementation is removed along with everything that directly depends upon the implementation. This commit does not include refactoring or moving classes. The few insertions are the minimum necessary. Change-Id: I80274e1a0d77bc7bb00a2afe4babc00c4f7613ae Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
Diffstat (limited to 'cross')
-rw-r--r--cross/org.eclipse.cdt.launch.remote/META-INF/MANIFEST.MF2
-rw-r--r--cross/org.eclipse.cdt.launch.remote/plugin.xml31
-rw-r--r--cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/IRemoteConnectionConfigurationConstants.java4
-rw-r--r--cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteRunLaunchDelegate.java220
-rw-r--r--cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteCDebuggerTab.java108
-rw-r--r--cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteGDBDebuggerPage.java178
6 files changed, 3 insertions, 540 deletions
diff --git a/cross/org.eclipse.cdt.launch.remote/META-INF/MANIFEST.MF b/cross/org.eclipse.cdt.launch.remote/META-INF/MANIFEST.MF
index be986389d6..f0a07fc5c4 100644
--- a/cross/org.eclipse.cdt.launch.remote/META-INF/MANIFEST.MF
+++ b/cross/org.eclipse.cdt.launch.remote/META-INF/MANIFEST.MF
@@ -11,7 +11,6 @@ Require-Bundle: org.eclipse.rse.ui;bundle-version="[3.0.0,4.0.0)",
org.eclipse.rse.core;bundle-version="[3.0.0,4.0.0)",
org.eclipse.rse.services;bundle-version="[3.0.0,4.0.0)",
org.eclipse.cdt.launch,
- org.eclipse.cdt.debug.mi.core,
org.eclipse.cdt.debug.core,
org.eclipse.cdt.core,
org.eclipse.debug.ui,
@@ -19,7 +18,6 @@ Require-Bundle: org.eclipse.rse.ui;bundle-version="[3.0.0,4.0.0)",
org.eclipse.debug.core,
org.eclipse.core.resources,
org.eclipse.core.runtime,
- org.eclipse.cdt.debug.mi.ui,
org.eclipse.cdt.debug.ui,
org.eclipse.rse.files.ui;bundle-version="[3.0.0,4.0.0)",
org.eclipse.cdt.dsf.gdb;bundle-version="3.0.0",
diff --git a/cross/org.eclipse.cdt.launch.remote/plugin.xml b/cross/org.eclipse.cdt.launch.remote/plugin.xml
index 21bf234109..ded8010be4 100644
--- a/cross/org.eclipse.cdt.launch.remote/plugin.xml
+++ b/cross/org.eclipse.cdt.launch.remote/plugin.xml
@@ -18,7 +18,7 @@ Anna Dushistova (Mentor Graphics) - code restructuring
<launchDelegate
id="org.eclipse.rse.remotecdt.launch"
type="org.eclipse.cdt.launch.remoteApplicationLaunchType"
- modes="run,debug"
+ modes="run"
delegate="org.eclipse.cdt.launch.remote.launching.RemoteRunLaunchDelegate"
name="%cdiLaunchDelegate.name"
delegateDescription="%cdiLaunchDelegate.description"
@@ -83,14 +83,6 @@ Anna Dushistova (Mentor Graphics) - code restructuring
<associatedDelegate delegate="org.eclipse.rse.remotecdt.dsf.debug"/>
<placement after="org.eclipse.cdt.launch.remote.dsf.mainTab"/>
</tab>
- <tab
- id="org.eclipse.rse.remotecdt.launch.RemoteCDebuggerTab"
- group="org.eclipse.cdt.launch.remoteApplicationLaunchTabGroup"
- name="Debugger"
- class="org.eclipse.cdt.launch.remote.tabs.RemoteCDebuggerTab">
- <associatedDelegate delegate="org.eclipse.rse.remotecdt.launch"/>
- <placement after="org.eclipse.cdt.cdi.launch.argumentsTab"/>
- </tab>
<tab id="org.eclipse.rse.remotecdt.dsf.debug.RemoteCDSFDebuggerTab"
group="org.eclipse.cdt.launch.remoteApplicationLaunchTabGroup"
name="Debugger"
@@ -141,27 +133,6 @@ Anna Dushistova (Mentor Graphics) - code restructuring
</extension>
-
- <extension
- point="org.eclipse.cdt.debug.core.CDebugger">
- <debugger
- class="org.eclipse.cdt.debug.mi.core.GDBServerCDIDebugger2"
- cpu="*"
- id="org.eclipse.rse.remotecdt.RemoteGDBDebugger"
- modes="run"
- name="remote gdb/mi"
- platform="*">
- </debugger>
- </extension>
- <extension
- point="org.eclipse.cdt.debug.ui.CDebuggerPage">
- <debuggerPage
- class="org.eclipse.cdt.launch.remote.tabs.RemoteGDBDebuggerPage"
- debuggerID="org.eclipse.rse.remotecdt.RemoteGDBDebugger"
- id="org.eclipse.rse.remotecdt.RemoteGDBDebuggerPage">
- </debuggerPage>
- </extension>
-
<!-- ============================================ -->
<!-- Define Help Context -->
<!-- ============================================ -->
diff --git a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/IRemoteConnectionConfigurationConstants.java b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/IRemoteConnectionConfigurationConstants.java
index 9758edcee5..b349bf4dfe 100644
--- a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/IRemoteConnectionConfigurationConstants.java
+++ b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/IRemoteConnectionConfigurationConstants.java
@@ -13,11 +13,9 @@
package org.eclipse.cdt.launch.remote;
-import org.eclipse.cdt.debug.mi.core.IGDBServerMILaunchConfigurationConstants;
import org.eclipse.debug.core.DebugPlugin;
-public interface IRemoteConnectionConfigurationConstants extends
- IGDBServerMILaunchConfigurationConstants {
+public interface IRemoteConnectionConfigurationConstants {
public static final String ATTR_REMOTE_CONNECTION =
DebugPlugin.getUniqueIdentifier() + ".REMOTE_TCP"; //$NON-NLS-1$
diff --git a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteRunLaunchDelegate.java b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteRunLaunchDelegate.java
index c5bed1b11f..5643b4d394 100644
--- a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteRunLaunchDelegate.java
+++ b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteRunLaunchDelegate.java
@@ -26,15 +26,7 @@ package org.eclipse.cdt.launch.remote.launching;
import org.eclipse.cdt.core.IBinaryParser.IBinaryObject;
import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.debug.core.CDIDebugModel;
import org.eclipse.cdt.debug.core.CDebugUtils;
-import org.eclipse.cdt.debug.core.ICDIDebugger2;
-import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
-import org.eclipse.cdt.debug.core.cdi.CDIException;
-import org.eclipse.cdt.debug.core.cdi.ICDISession;
-import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
-import org.eclipse.cdt.debug.mi.core.GDBServerCDIDebugger2;
-import org.eclipse.cdt.debug.mi.core.IGDBServerMILaunchConfigurationConstants;
import org.eclipse.cdt.internal.launch.remote.Activator;
import org.eclipse.cdt.internal.launch.remote.Messages;
import org.eclipse.cdt.launch.AbstractCLaunchDelegate;
@@ -50,26 +42,12 @@ import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.IProcess;
import org.eclipse.osgi.util.NLS;
import org.eclipse.rse.core.RSECorePlugin;
-import org.eclipse.rse.services.shells.HostShellProcessAdapter;
-import org.eclipse.rse.services.shells.IHostOutput;
-import org.eclipse.rse.services.shells.IHostShell;
-import org.eclipse.rse.services.shells.IHostShellChangeEvent;
-import org.eclipse.rse.services.shells.IHostShellOutputListener;
public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate {
- private ICDISession dsession;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate#launch
- */
@Override
public void launch(ILaunchConfiguration config, String mode,
ILaunch launch, IProgressMonitor monitor) throws CoreException {
@@ -102,200 +80,8 @@ public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate {
e));
}
}
- if (mode.equals(ILaunchManager.DEBUG_MODE)) {
- monitor.beginTask(Messages.RemoteRunLaunchDelegate_0, 100);
- setDefaultSourceLocator(launch, config);
- String debugMode = config
- .getAttribute(
- ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
- ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN);
- if (debugMode
- .equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN)) {
- Process remoteShellProcess = null;
- dsession = null;
- try {
- // Download the binary to the remote before debugging.
- monitor.setTaskName(Messages.RemoteRunLaunchDelegate_2);
- RSEHelper.remoteFileDownload(config, launch, exePath.toString(),
- remoteExePath, new SubProgressMonitor(monitor,
- 80));
-
- // Automatically start up the gdbserver. In the future
- // this should be expanded to launch
- // an arbitrary remote daemon.
- String gdbserver_port_number = config
- .getAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_PORT,
- IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_PORT_DEFAULT);
- String gdbserver_command = config
- .getAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_COMMAND,
- IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_COMMAND_DEFAULT);
- String gdbserver_options = config
- .getAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_OPTIONS,
- IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_OPTIONS_DEFAULT);
- String command_arguments = gdbserver_options + " " //$NON-NLS-1$
- + ":" + gdbserver_port_number + " " //$NON-NLS-1$ //$NON-NLS-2$
- + RSEHelper.spaceEscapify(remoteExePath);
- if (arguments != null && !arguments.equals("")) //$NON-NLS-1$
- command_arguments += " " + arguments; //$NON-NLS-1$
- monitor.setTaskName(Messages.RemoteRunLaunchDelegate_9);
- IHostShell remoteShell = null;
- try {
- remoteShell = RSEHelper.execCmdInRemoteShell(config, prelaunchCmd,
- gdbserver_command, command_arguments,
- new SubProgressMonitor(monitor, 5));
- } catch (Exception e1) {
- RSEHelper.abort(e1.getMessage(), e1,
- ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
- }
-
- // We cannot use a global variable because multiple launches
- // could access them at the same time. We need a different
- // variable for each launch, but we also need it be final.
- // Use a final array to do that.
- final boolean gdbServerReady[] = new boolean[1];
- gdbServerReady[0] = false;
-
- final Object lock = new Object();
- if (remoteShell != null) {
- remoteShell
- .addOutputListener(new IHostShellOutputListener() {
-
- public void shellOutputChanged(
- IHostShellChangeEvent event) {
- for (IHostOutput line : event
- .getLines()) {
- if (line.getString().contains(
- "Listening on port")) { //$NON-NLS-1$
- synchronized (lock) {
- gdbServerReady[0] = true;
- lock.notifyAll();
- }
- break;
- }
- }
- }
- });
-
- try {
- remoteShellProcess = new HostShellProcessAdapter(remoteShell) {
-
- @Override
- public synchronized void destroy() {
- ICDISession session = getSession();
- if (session != null) {
- try {
- session.terminate();
- } catch (CDIException e) {
- }
- }
- super.destroy();
- }
- };
- } catch (Exception e) {
- if (remoteShellProcess != null) {
- remoteShellProcess.destroy();
- }
- RSEHelper.abort(Messages.RemoteRunLaunchDelegate_7, e,
- ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
- }
- IProcess rsProcess = DebugPlugin
- .newProcess(
- launch,
- remoteShellProcess,
- Messages.RemoteRunLaunchDelegate_RemoteShell);
- // Now wait until gdbserver is up and running on the
- // remote host
- synchronized (lock) {
- while (gdbServerReady[0] == false) {
- if (monitor.isCanceled()
- || rsProcess.isTerminated()) {
- RSEHelper.abort(Messages.RemoteGdbLaunchDelegate_gdbserverFailedToStartErrorMessage, null,
- ICDTLaunchConfigurationConstants.ERR_DEBUGGER_NOT_INSTALLED);
- }
- try {
- lock.wait(300);
- } catch (InterruptedException e) {
- }
- }
- }
-
- // Pre-set configuration constants for the
- // GDBSERVERCDIDebugger to indicate how the gdbserver
- // was automatically started on the remote.
- // GDBServerCDIDebugger uses these to figure out how
- // to connect to the remote gdbserver.
- ILaunchConfigurationWorkingCopy wc = config
- .getWorkingCopy();
- wc
- .setAttribute(
- IGDBServerMILaunchConfigurationConstants.ATTR_REMOTE_TCP,
- true);
- wc
- .setAttribute(
- IGDBServerMILaunchConfigurationConstants.ATTR_HOST,
- RSEHelper.getRemoteHostname(config));
- wc
- .setAttribute(
- IGDBServerMILaunchConfigurationConstants.ATTR_PORT,
- gdbserver_port_number);
- wc.doSave();
-
- // Default to using the GDBServerCDIDebugger.
- GDBServerCDIDebugger2 debugger = new GDBServerCDIDebugger2();
- dsession = ((ICDIDebugger2) debugger).createSession(
- launch, exePath.toFile(),
- new SubProgressMonitor(monitor, 15));
-
- boolean stopInMain = config
- .getAttribute(
- ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN,
- false);
- String stopSymbol = null;
- if (stopInMain)
- stopSymbol = launch
- .getLaunchConfiguration()
- .getAttribute(
- ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN_SYMBOL,
- ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT);
-
- ICDITarget[] targets = dsession.getTargets();
- for (int i = 0; i < targets.length; i++) {
- Process process = targets[i].getProcess();
- IProcess iprocess = null;
- if (process != null) {
- iprocess = DebugPlugin.newProcess(launch,
- process, renderProcessLabel(exePath
- .toOSString()),
- getDefaultProcessMap());
- }
- CDIDebugModel.newDebugTarget(launch, project
- .getProject(),
- targets[i],
- renderProcessLabel("gdbserver debugger"), //$NON-NLS-1$
- iprocess, exeFile, true, false, stopSymbol,
- true);
- }
- }
- } catch (CoreException e) {
- try {
- if (dsession != null)
- dsession.terminate();
- if (remoteShellProcess != null)
- remoteShellProcess.destroy();
- } catch (CDIException e1) {
- // ignore
- }
- throw e;
- } finally {
- monitor.done();
- }
- }
-
- } else if (mode.equals(ILaunchManager.RUN_MODE)) {
+ if (mode.equals(ILaunchManager.RUN_MODE)) {
monitor.beginTask(Messages.RemoteRunLaunchDelegate_0, 100);
Process remoteProcess = null;
try {
@@ -329,8 +115,4 @@ public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate {
protected String getPluginID() {
return Activator.PLUGIN_ID;
}
-
- ICDISession getSession(){
- return dsession;
- }
}
diff --git a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteCDebuggerTab.java b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteCDebuggerTab.java
deleted file mode 100644
index e90a1ef472..0000000000
--- a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteCDebuggerTab.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * 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:
- * Ewa Matejska (PalmSource)
- * Anna Dushistova (Mentor Graphics) - [314659] move remote launch/debug to DSF
- * Anna Dushistova (Mentor Graphics) - moved to org.eclipse.cdt.launch.remote.tabs
- *******************************************************************************/
-
-package org.eclipse.cdt.launch.remote.tabs;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.cdt.debug.core.CDebugCorePlugin;
-import org.eclipse.cdt.debug.core.ICDebugConfiguration;
-import org.eclipse.cdt.launch.ui.CDebuggerTab;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.PlatformUI;
-
-public class RemoteCDebuggerTab extends CDebuggerTab {
-
- private final static String DEFAULTS_SET = "org.eclipse.cdt.launch.remote.RemoteCDSFDebuggerTab.DEFAULTS_SET"; //$NON-NLS-1$
-
- public RemoteCDebuggerTab() {
- super(false);
- }
-
- @Override
- public void createControl(Composite parent) {
- super.createControl(parent);
- PlatformUI
- .getWorkbench()
- .getHelpSystem()
- .setHelp(getControl(),
- "org.eclipse.rse.internal.remotecdt.launchgroup"); //$NON-NLS-1$
- }
-
- static final private String REMOTE_GDB_DEBUGGER_NAME = "remote gdb/mi"; //$NON-NLS-1$
-
- public RemoteCDebuggerTab(boolean attachMode) {
- super(attachMode);
- }
-
- @Override
- protected void loadDebuggerComboBox(ILaunchConfiguration config,
- String selection) {
- ICDebugConfiguration[] debugConfigs = CDebugCorePlugin.getDefault()
- .getDebugConfigurations();
- String defaultSelection = selection;
- List list = new ArrayList();
- for (int i = 0; i < debugConfigs.length; i++) {
- ICDebugConfiguration configuration = debugConfigs[i];
- if (configuration.getName().equals(REMOTE_GDB_DEBUGGER_NAME)) {
- list.add(configuration);
- // Select as default selection
- defaultSelection = configuration.getID();
- break;
- }
- }
- setInitializeDefault(defaultSelection.equals("") ? true : false); //$NON-NLS-1$
- loadDebuggerCombo(
- (ICDebugConfiguration[]) list.toArray(new ICDebugConfiguration[list
- .size()]), defaultSelection);
- }
-
- @Override
- public String getId() {
- return "org.eclipse.rse.remotecdt.launch.RemoteCDebuggerTab"; //$NON-NLS-1$
- }
-
- /*
- * When the launch configuration is created for Run mode, this Debugger tab
- * is not created because it is not used for Run mode but only for Debug
- * mode. When we then open the same configuration in Debug mode, the launch
- * configuration already exists and initializeFrom() is called instead of
- * setDefaults(). We therefore call setDefaults() ourselves and update the
- * configuration. If we don't then the user will be required to press Apply
- * to get the default settings saved. Bug 281970
- */
- @Override
- public void setDefaults(ILaunchConfigurationWorkingCopy config) {
- config.setAttribute(DEFAULTS_SET, true);
- super.setDefaults(config);
- }
-
- @Override
- public void initializeFrom(ILaunchConfiguration config) {
- try {
- if (config.hasAttribute(DEFAULTS_SET) == false) {
- ILaunchConfigurationWorkingCopy wc;
- wc = config.getWorkingCopy();
- setDefaults(wc);
- wc.doSave();
- }
- } catch (CoreException e) {
- }
- super.initializeFrom(config);
- }
-
-}
diff --git a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteGDBDebuggerPage.java b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteGDBDebuggerPage.java
deleted file mode 100644
index 1aba2e8a4c..0000000000
--- a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteGDBDebuggerPage.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2016 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:
- * Ewa Matejska (PalmSource)
- *
- * Referenced GDBDebuggerPage code to write this.
- * Anna Dushistova (Mentor Graphics) - moved to org.eclipse.cdt.launch.remote.tabs
- *******************************************************************************/
-
-package org.eclipse.cdt.launch.remote.tabs;
-
-import org.eclipse.cdt.debug.mi.internal.ui.GDBDebuggerPage;
-import org.eclipse.cdt.internal.launch.remote.Messages;
-import org.eclipse.cdt.launch.remote.IRemoteConnectionConfigurationConstants;
-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.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * The dynamic debugger tab for remote launches using gdb server.
- * The gdbserver settings are used to start a gdbserver session on the
- * remote and then to connect to it from the host. The DSDP-TM project is
- * used to accomplish this.
- */
-public class RemoteGDBDebuggerPage extends GDBDebuggerPage {
-
- protected Text fGDBServerCommandText;
-
- protected Text fGDBServerPortNumberText;
-
- protected Text fGDBServerOptionsText;
-
- @Override
- public String getName() {
- return Messages.Remote_GDB_Debugger_Options;
- }
-
- @Override
- public void setDefaults( ILaunchConfigurationWorkingCopy configuration ) {
- super.setDefaults(configuration);
- configuration.setAttribute( IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_COMMAND,
- IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_COMMAND_DEFAULT );
- configuration.setAttribute( IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_PORT,
- IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_PORT_DEFAULT );
- configuration.setAttribute( IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_OPTIONS,
- IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_OPTIONS_DEFAULT );
- }
-
- @Override
- public void initializeFrom( ILaunchConfiguration configuration ) {
- super.initializeFrom(configuration);
- String gdbserverCommand = null;
- String gdbserverPortNumber = null;
- String gdbserverOptions = null;
- try {
- gdbserverCommand = configuration.getAttribute( IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_COMMAND,
- IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_COMMAND_DEFAULT);
- }
- catch( CoreException e ) {
- }
- try {
- gdbserverPortNumber = configuration.getAttribute( IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_PORT,
- IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_PORT_DEFAULT );
- }
- catch( CoreException e ) {
- }
- try {
- gdbserverOptions = configuration.getAttribute( IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_OPTIONS,
- IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_OPTIONS_DEFAULT );
- }
- catch( CoreException e ) {
- }
- fGDBServerCommandText.setText( gdbserverCommand );
- fGDBServerPortNumberText.setText( gdbserverPortNumber );
- fGDBServerOptionsText.setText( gdbserverOptions );
- }
-
- @Override
- public void performApply( ILaunchConfigurationWorkingCopy configuration ) {
- super.performApply(configuration);
- String str = fGDBServerCommandText.getText();
- str.trim();
- configuration.setAttribute( IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_COMMAND, str );
- str = fGDBServerPortNumberText.getText();
- str.trim();
- configuration.setAttribute( IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_PORT, str );
- str = fGDBServerOptionsText.getText();
- str.trim();
- configuration.setAttribute( IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_OPTIONS, str );
- }
-
- protected void createGdbserverSettingsTab( TabFolder tabFolder ) {
- TabItem tabItem = new TabItem( tabFolder, SWT.NONE );
- tabItem.setText( Messages.Gdbserver_Settings_Tab_Name );
-
- Composite comp = new Composite(tabFolder, SWT.NULL);
- comp.setLayout(new GridLayout(1, true));
- 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.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(SWT.FILL, SWT.TOP, true, false);
- fGDBServerCommandText.setLayoutData(data);
- fGDBServerCommandText.addModifyListener( new ModifyListener() {
-
- public void modifyText( ModifyEvent evt ) {
- 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(SWT.FILL, SWT.TOP, true, false);
- fGDBServerPortNumberText.setLayoutData(data);
- fGDBServerPortNumberText.addModifyListener( new ModifyListener() {
-
- public void modifyText( ModifyEvent evt ) {
- updateLaunchConfigurationDialog();
- }
- } );
- label = new Label(subComp, SWT.LEFT);
- label.setText(Messages.Gdbserver_options_textfield_label);
- gd = new GridData();
- label.setLayoutData( gd );
-
- fGDBServerOptionsText = new Text(subComp, SWT.SINGLE | SWT.BORDER);
- data = new GridData(SWT.FILL, SWT.TOP, true, false);
- fGDBServerOptionsText.setLayoutData(data);
- fGDBServerOptionsText.addModifyListener( new ModifyListener() {
-
- public void modifyText( ModifyEvent evt ) {
- updateLaunchConfigurationDialog();
- }
- } );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.mi.internal.ui.GDBDebuggerPage#createTabs(org.eclipse.swt.widgets.TabFolder)
- */
- @Override
- public void createTabs( TabFolder tabFolder ) {
- super.createTabs( tabFolder );
- createGdbserverSettingsTab( tabFolder );
- }
-}
-

Back to the top