Skip to main content
summaryrefslogtreecommitdiffstats
path: root/cross
diff options
context:
space:
mode:
authorJonah Graham2018-11-20 11:20:42 -0500
committerJonah Graham2018-11-22 16:47:02 -0500
commit170e654b4796bad1453ae85a427b97317d67a69a (patch)
tree6ca9b8a8fedd5fd25f97eb79c408312e256ff981 /cross
parent35996a5c5ca5c254959ba48241eaada6dbf8628d (diff)
downloadorg.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.tar.gz
org.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.tar.xz
org.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.zip
Bug 540373: Cleanup: Format & Remove trailing whitespace
This was done by selecting all projects in Eclipse then Source -> Clean Up... -> choosing: - Format source code - Remove trailing white spaces on all lines and completing the wizard Change-Id: I63685372c6bcc67719bcf145123bcb72e5b00394
Diffstat (limited to 'cross')
-rwxr-xr-xcross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/Activator.java12
-rwxr-xr-xcross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/CrossCommandLineGenerator.java21
-rw-r--r--cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/CrossEnvironmentVariableSupplier.java32
-rw-r--r--cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/Messages.java2
-rw-r--r--cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/SetCrossCommandOperation.java35
-rw-r--r--cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/SetCrossCommandWizardPage.java38
-rw-r--r--cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/internal/launch/remote/Activator.java18
-rw-r--r--cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/IRemoteConnectionConfigurationConstants.java42
-rw-r--r--cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/RemoteHelper.java69
-rw-r--r--cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/RemoteUIHelper.java49
-rw-r--r--cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteGdbLaunchDelegate.java95
-rw-r--r--cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteRunLaunchDelegate.java31
-rw-r--r--cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteCDSFDebuggerTab.java5
-rw-r--r--cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteCDSFMainTab.java208
-rw-r--r--cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteDSFGDBDebuggerPage.java187
-rw-r--r--cross/org.eclipse.cdt.launch.serial.ui/src/org/eclipse/cdt/launch/serial/ui/internal/NewSerialFlashTargetWizardPage.java3
16 files changed, 370 insertions, 477 deletions
diff --git a/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/Activator.java b/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/Activator.java
index d38a39812c..0077d5491b 100755
--- a/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/Activator.java
+++ b/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/Activator.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Doug Schaefer - initial API and implementation
* Marc-Andre Laperle
@@ -29,7 +29,7 @@ public class Activator extends Plugin {
// The shared instance
private static Activator plugin;
-
+
/**
* The constructor
*/
@@ -53,20 +53,20 @@ public class Activator extends Plugin {
plugin = null;
super.stop(context);
}
-
+
/**
* Logs the specified status with this plug-in's log.
- *
+ *
* @param status
* status to log
*/
public static void log(IStatus status) {
getDefault().getLog().log(status);
}
-
+
/**
* Logs an internal error with the specified throwable
- *
+ *
* @param e
* the exception to be logged
*/
diff --git a/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/CrossCommandLineGenerator.java b/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/CrossCommandLineGenerator.java
index 6d7607ad46..076c83fe7c 100755
--- a/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/CrossCommandLineGenerator.java
+++ b/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/CrossCommandLineGenerator.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Doug Schaefer - initial API and implementation
*******************************************************************************/
@@ -24,22 +24,21 @@ import org.eclipse.cdt.managedbuilder.internal.core.ResourceConfiguration;
public class CrossCommandLineGenerator extends ManagedCommandLineGenerator {
@Override
- public IManagedCommandLineInfo generateCommandLineInfo(ITool tool,
- String commandName, String[] flags, String outputFlag,
- String outputPrefix, String outputName, String[] inputResources,
+ public IManagedCommandLineInfo generateCommandLineInfo(ITool tool, String commandName, String[] flags,
+ String outputFlag, String outputPrefix, String outputName, String[] inputResources,
String commandLinePattern) {
IBuildObject parent = tool.getParent();
IToolChain toolchain;
- if(parent instanceof ResourceConfiguration)
- toolchain = ((ResourceConfiguration)parent).getBaseToolChain();
+ if (parent instanceof ResourceConfiguration)
+ toolchain = ((ResourceConfiguration) parent).getBaseToolChain();
else
- toolchain = (IToolChain)parent;
+ toolchain = (IToolChain) parent;
IOption option = toolchain.getOptionBySuperClassId("cdt.managedbuild.option.gnu.cross.prefix"); //$NON-NLS-1$
- String prefix = (String)option.getValue();
+ String prefix = (String) option.getValue();
String newCommandName = prefix + commandName;
- return super.generateCommandLineInfo(tool, newCommandName, flags, outputFlag,
- outputPrefix, outputName, inputResources, commandLinePattern);
+ return super.generateCommandLineInfo(tool, newCommandName, flags, outputFlag, outputPrefix, outputName,
+ inputResources, commandLinePattern);
}
-
+
}
diff --git a/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/CrossEnvironmentVariableSupplier.java b/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/CrossEnvironmentVariableSupplier.java
index ef6d1936d5..0e6f07afa5 100644
--- a/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/CrossEnvironmentVariableSupplier.java
+++ b/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/CrossEnvironmentVariableSupplier.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Doug Schaefer - initial API and implementation
*******************************************************************************/
@@ -23,19 +23,18 @@ import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSu
import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider;
import org.eclipse.core.runtime.Platform;
-public class CrossEnvironmentVariableSupplier implements
- IConfigurationEnvironmentVariableSupplier {
+public class CrossEnvironmentVariableSupplier implements IConfigurationEnvironmentVariableSupplier {
- public IBuildEnvironmentVariable getVariable(String variableName,
- IConfiguration configuration, IEnvironmentVariableProvider provider) {
+ public IBuildEnvironmentVariable getVariable(String variableName, IConfiguration configuration,
+ IEnvironmentVariableProvider provider) {
if (PathEnvironmentVariable.isVar(variableName))
return PathEnvironmentVariable.create(configuration);
else
return null;
}
- public IBuildEnvironmentVariable[] getVariables(
- IConfiguration configuration, IEnvironmentVariableProvider provider) {
+ public IBuildEnvironmentVariable[] getVariables(IConfiguration configuration,
+ IEnvironmentVariableProvider provider) {
IBuildEnvironmentVariable path = PathEnvironmentVariable.create(configuration);
return path != null ? new IBuildEnvironmentVariable[] { path } : new IBuildEnvironmentVariable[0];
}
@@ -43,31 +42,30 @@ public class CrossEnvironmentVariableSupplier implements
private static class PathEnvironmentVariable implements IBuildEnvironmentVariable {
public static String name = "PATH"; //$NON-NLS-1$
-
+
private File path;
-
+
private PathEnvironmentVariable(File path) {
this.path = path;
}
-
+
public static PathEnvironmentVariable create(IConfiguration configuration) {
IToolChain toolchain = configuration.getToolChain();
IOption option = toolchain.getOptionBySuperClassId("cdt.managedbuild.option.gnu.cross.path"); //$NON-NLS-1$
- String path = (String)option.getValue();
+ String path = (String) option.getValue();
File sysroot = new File(path);
File bin = new File(sysroot, "bin"); //$NON-NLS-1$
if (bin.isDirectory())
sysroot = bin;
return new PathEnvironmentVariable(sysroot);
}
-
+
public static boolean isVar(String name) {
// Windows has case insensitive env var names
- return Platform.getOS().equals(Platform.OS_WIN32)
- ? name.equalsIgnoreCase(PathEnvironmentVariable.name)
- : name.equals(PathEnvironmentVariable.name);
+ return Platform.getOS().equals(Platform.OS_WIN32) ? name.equalsIgnoreCase(PathEnvironmentVariable.name)
+ : name.equals(PathEnvironmentVariable.name);
}
-
+
public String getDelimiter() {
return Platform.getOS().equals(Platform.OS_WIN32) ? ";" : ":"; //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -83,6 +81,6 @@ public class CrossEnvironmentVariableSupplier implements
public String getValue() {
return path.getPath();
}
-
+
}
}
diff --git a/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/Messages.java b/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/Messages.java
index 20793810ca..a8bead492b 100644
--- a/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/Messages.java
+++ b/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/Messages.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Marc-Andre Laperle - initial API and implementation
*******************************************************************************/
diff --git a/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/SetCrossCommandOperation.java b/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/SetCrossCommandOperation.java
index 6278092f5c..2f156a08e7 100644
--- a/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/SetCrossCommandOperation.java
+++ b/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/SetCrossCommandOperation.java
@@ -7,12 +7,13 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Doug Schaefer - initial API and implementation
* Marc-Andre Laperle - Moved to an operation for a custom wizard page
*******************************************************************************/
package org.eclipse.cdt.internal.build.crossgcc;
+
import java.lang.reflect.InvocationTargetException;
import org.eclipse.cdt.core.templateengine.SharedDefaults;
@@ -30,30 +31,34 @@ import org.eclipse.jface.operation.IRunnableWithProgress;
/**
* An operation that runs when the new project wizard finishes for the Cross GCC toolchain.
* It reuses the information from {@link SetCrossCommandWizardPage} to set build options (prefix and path).
- * It also clears and reruns scanner discovery to account for the modified command.
+ * It also clears and reruns scanner discovery to account for the modified command.
*
*/
public class SetCrossCommandOperation implements IRunnableWithProgress {
- public void run(IProgressMonitor monitor) throws InvocationTargetException,
- InterruptedException {
-
- String projectName = (String) MBSCustomPageManager.getPageProperty(SetCrossCommandWizardPage.PAGE_ID, SetCrossCommandWizardPage.CROSS_PROJECT_NAME);
- String prefix = (String) MBSCustomPageManager.getPageProperty(SetCrossCommandWizardPage.PAGE_ID, SetCrossCommandWizardPage.CROSS_COMMAND_PREFIX);
- String path = (String) MBSCustomPageManager.getPageProperty(SetCrossCommandWizardPage.PAGE_ID, SetCrossCommandWizardPage.CROSS_COMMAND_PATH);
-
- SharedDefaults.getInstance().getSharedDefaultsMap().put(SetCrossCommandWizardPage.SHARED_DEFAULTS_PATH_KEY, path);
- SharedDefaults.getInstance().getSharedDefaultsMap().put(SetCrossCommandWizardPage.SHARED_DEFAULTS_PREFIX_KEY, prefix);
+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+
+ String projectName = (String) MBSCustomPageManager.getPageProperty(SetCrossCommandWizardPage.PAGE_ID,
+ SetCrossCommandWizardPage.CROSS_PROJECT_NAME);
+ String prefix = (String) MBSCustomPageManager.getPageProperty(SetCrossCommandWizardPage.PAGE_ID,
+ SetCrossCommandWizardPage.CROSS_COMMAND_PREFIX);
+ String path = (String) MBSCustomPageManager.getPageProperty(SetCrossCommandWizardPage.PAGE_ID,
+ SetCrossCommandWizardPage.CROSS_COMMAND_PATH);
+
+ SharedDefaults.getInstance().getSharedDefaultsMap().put(SetCrossCommandWizardPage.SHARED_DEFAULTS_PATH_KEY,
+ path);
+ SharedDefaults.getInstance().getSharedDefaultsMap().put(SetCrossCommandWizardPage.SHARED_DEFAULTS_PREFIX_KEY,
+ prefix);
SharedDefaults.getInstance().updateShareDefaultsMap(SharedDefaults.getInstance().getSharedDefaultsMap());
-
+
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
if (!project.exists())
return;
-
+
IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(project);
if (buildInfo == null)
return;
-
+
IConfiguration[] configs = buildInfo.getManagedProject().getConfigurations();
for (IConfiguration config : configs) {
IToolChain toolchain = config.getToolChain();
@@ -62,7 +67,7 @@ public class SetCrossCommandOperation implements IRunnableWithProgress {
option = toolchain.getOptionBySuperClassId("cdt.managedbuild.option.gnu.cross.path"); //$NON-NLS-1$
ManagedBuildManager.setOption(config, toolchain, option, path);
}
-
+
ManagedBuildManager.saveBuildInfo(project, true);
}
diff --git a/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/SetCrossCommandWizardPage.java b/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/SetCrossCommandWizardPage.java
index 511238a39e..4eb0caa46b 100644
--- a/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/SetCrossCommandWizardPage.java
+++ b/cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/SetCrossCommandWizardPage.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Marc-Andre Laperle - initial API and implementation
*******************************************************************************/
@@ -46,19 +46,19 @@ public class SetCrossCommandWizardPage extends MBSCustomPage {
private Text prefixTxt;
public static final String PAGE_ID = "org.eclipse.cdt.build.crossgcc.setcCrossCommandWizardPage"; //$NON-NLS-1$
-
+
public static final String CROSS_PROJECT_NAME = "crossProjectName"; //$NON-NLS-1$
public static final String CROSS_COMMAND_PREFIX = "crossCommandPrefix"; //$NON-NLS-1$
public static final String CROSS_COMMAND_PATH = "crossCommandPath"; //$NON-NLS-1$
-
+
// Note: The shared defaults keys don't have "cross" in them because we want to keep
// compatibility with defaults that were saved when it used to be a template
static final String SHARED_DEFAULTS_PREFIX_KEY = "prefix";
static final String SHARED_DEFAULTS_PATH_KEY = "path";
-
+
public SetCrossCommandWizardPage() {
pageID = PAGE_ID;
-
+
MBSCustomPageManager.addPageProperty(PAGE_ID, CROSS_COMMAND_PATH, ""); //$NON-NLS-1$
MBSCustomPageManager.addPageProperty(PAGE_ID, CROSS_COMMAND_PREFIX, ""); //$NON-NLS-1$
}
@@ -77,14 +77,14 @@ public class SetCrossCommandWizardPage extends MBSCustomPage {
public void createControl(Composite parent) {
composite = new Composite(parent, SWT.NULL);
-
+
composite.setLayout(new GridLayout(3, false));
GridData layoutData = new GridData();
composite.setLayoutData(layoutData);
-
+
Label prefixLbl = new Label(composite, SWT.NONE);
prefixLbl.setText(Messages.SetCrossCommandWizardPage_prefix);
-
+
prefixTxt = new Text(composite, SWT.SINGLE | SWT.BORDER);
layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
prefixTxt.setLayoutData(layoutData);
@@ -94,15 +94,15 @@ public class SetCrossCommandWizardPage extends MBSCustomPage {
updatePrefixProperty();
}
prefixTxt.addModifyListener(new ModifyListener() {
-
+
public void modifyText(ModifyEvent e) {
updatePrefixProperty();
}
});
-
+
Label label = new Label(composite, SWT.NONE);
label.setText(Messages.SetCrossCommandWizardPage_path);
-
+
pathTxt = new Text(composite, SWT.SINGLE | SWT.BORDER);
String crossCommandPath = SharedDefaults.getInstance().getSharedDefaultsMap().get(SHARED_DEFAULTS_PATH_KEY);
if (crossCommandPath != null) {
@@ -112,16 +112,16 @@ public class SetCrossCommandWizardPage extends MBSCustomPage {
layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
pathTxt.setLayoutData(layoutData);
pathTxt.addModifyListener(new ModifyListener() {
-
+
public void modifyText(ModifyEvent e) {
updatePathProperty();
}
});
-
+
Button button = new Button(composite, SWT.NONE);
button.setText(Messages.SetCrossCommandWizardPage_browse);
button.addSelectionListener(new SelectionListener() {
-
+
public void widgetDefaultSelected(SelectionEvent e) {
}
@@ -136,7 +136,7 @@ public class SetCrossCommandWizardPage extends MBSCustomPage {
layoutData = new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1);
button.setLayoutData(layoutData);
}
-
+
public Control getControl() {
return composite;
}
@@ -179,13 +179,12 @@ public class SetCrossCommandWizardPage extends MBSCustomPage {
}
composite.setVisible(visible);
}
-
+
public void dispose() {
}
-
/**
- * MBSCustomPageManager and properties are used to pass things to SetCrossCommandOperation
+ * MBSCustomPageManager and properties are used to pass things to SetCrossCommandOperation
*/
private void updatePathProperty() {
MBSCustomPageManager.addPageProperty(PAGE_ID, CROSS_COMMAND_PATH, pathTxt.getText());
@@ -199,7 +198,8 @@ public class SetCrossCommandWizardPage extends MBSCustomPage {
IWizardPage[] pages = getWizard().getPages();
for (IWizardPage wizardPage : pages) {
if (wizardPage instanceof WizardNewProjectCreationPage) {
- MBSCustomPageManager.addPageProperty(PAGE_ID, CROSS_PROJECT_NAME, ((WizardNewProjectCreationPage) wizardPage).getProjectName());
+ MBSCustomPageManager.addPageProperty(PAGE_ID, CROSS_PROJECT_NAME,
+ ((WizardNewProjectCreationPage) wizardPage).getProjectName());
break;
}
}
diff --git a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/internal/launch/remote/Activator.java b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/internal/launch/remote/Activator.java
index b369a65bfb..82151fb134 100644
--- a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/internal/launch/remote/Activator.java
+++ b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/internal/launch/remote/Activator.java
@@ -1,16 +1,16 @@
/*******************************************************************************
* Copyright (c) 2006, 2012 PalmSource, Inc.and others.
*
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Ewa Matejska (PalmSource)
- * Anna Dushistova (Mentor Graphics) - [314659] move remote launch/debug to DSF
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Ewa Matejska (PalmSource)
+ * Anna Dushistova (Mentor Graphics) - [314659] move remote launch/debug to DSF
*******************************************************************************/
package org.eclipse.cdt.internal.launch.remote;
@@ -29,7 +29,7 @@ public class Activator extends Plugin {
/* The shared instance */
private static Activator plugin;
-
+
/**
* The constructor.
*/
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 b382abbae0..842d6f00a3 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
@@ -1,50 +1,42 @@
/*******************************************************************************
* Copyright (c) 2006, 2016 PalmSource, Inc. and others.
*
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
* Ewa Matejska (PalmSource) - Adapted from IGDBServerMILaunchConfigurationConstants
* Anna Dushistova (MontaVista) - [181517][usability] Specify commands to be run before remote application launch
*******************************************************************************/
-
package org.eclipse.cdt.launch.remote;
import org.eclipse.debug.core.DebugPlugin;
public interface IRemoteConnectionConfigurationConstants {
-
- public static final String ATTR_REMOTE_CONNECTION =
- DebugPlugin.getUniqueIdentifier() + ".REMOTE_TCP"; //$NON-NLS-1$
-
-
- public static final String ATTR_GDBSERVER_PORT =
- DebugPlugin.getUniqueIdentifier() + ".ATTR_GDBSERVER_PORT"; //$NON-NLS-1$
- public static final String ATTR_GDBSERVER_COMMAND =
- DebugPlugin.getUniqueIdentifier() + ".ATTR_GDBSERVER_COMMAND"; //$NON-NLS-1$
- public static final String ATTR_GDBSERVER_OPTIONS =
- DebugPlugin.getUniqueIdentifier() + ".ATTR_GDBSERVER_OPTIONS"; //$NON-NLS-1$
-
+
+ public static final String ATTR_REMOTE_CONNECTION = DebugPlugin.getUniqueIdentifier() + ".REMOTE_TCP"; //$NON-NLS-1$
+
+ public static final String ATTR_GDBSERVER_PORT = DebugPlugin.getUniqueIdentifier() + ".ATTR_GDBSERVER_PORT"; //$NON-NLS-1$
+ public static final String ATTR_GDBSERVER_COMMAND = DebugPlugin.getUniqueIdentifier() + ".ATTR_GDBSERVER_COMMAND"; //$NON-NLS-1$
+ public static final String ATTR_GDBSERVER_OPTIONS = DebugPlugin.getUniqueIdentifier() + ".ATTR_GDBSERVER_OPTIONS"; //$NON-NLS-1$
+
public static final String ATTR_GDBSERVER_PORT_DEFAULT = "2345"; //$NON-NLS-1$
public static final String ATTR_GDBSERVER_COMMAND_DEFAULT = "gdbserver"; //$NON-NLS-1$
public static final String ATTR_GDBSERVER_OPTIONS_DEFAULT = ""; //$NON-NLS-1$
-
+
/*
* Generic Remote Path and Download options
* ATTR_REMOTE_PATH: Path of the binary on the remote.
* ATTR_SKIP_DOWNLOAD_TO_TARGET: true if download to remote is not desired.
*/
- public static final String ATTR_REMOTE_PATH =
- DebugPlugin.getUniqueIdentifier() + ".ATTR_TARGET_PATH"; //$NON-NLS-1$
- public static final String ATTR_SKIP_DOWNLOAD_TO_TARGET =
- DebugPlugin.getUniqueIdentifier() + ".ATTR_SKIP_DOWNLOAD_TO_TARGET"; //$NON-NLS-1$
-
+ public static final String ATTR_REMOTE_PATH = DebugPlugin.getUniqueIdentifier() + ".ATTR_TARGET_PATH"; //$NON-NLS-1$
+ public static final String ATTR_SKIP_DOWNLOAD_TO_TARGET = DebugPlugin.getUniqueIdentifier()
+ + ".ATTR_SKIP_DOWNLOAD_TO_TARGET"; //$NON-NLS-1$
public static final String ATTR_PRERUN_COMMANDS = DebugPlugin.getUniqueIdentifier() + ".ATTR_PRERUN_CMDS"; //$NON-NLS-1$
diff --git a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/RemoteHelper.java b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/RemoteHelper.java
index 5003055e35..01813b226e 100644
--- a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/RemoteHelper.java
+++ b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/RemoteHelper.java
@@ -62,7 +62,7 @@ public class RemoteHelper {
return null;
}
List<IRemoteConnection> conns = manager.getAllRemoteConnections();
- for (IRemoteConnection conn: conns) {
+ for (IRemoteConnection conn : conns) {
if (conn.getName().contentEquals(remoteConnection)) {
return conn;
}
@@ -83,22 +83,19 @@ public class RemoteHelper {
return null;
ArrayList<IRemoteConnection> suitableConnections = new ArrayList<>();
List<IRemoteConnection> allConnections = manager.getAllRemoteConnections();
- for (IRemoteConnection conn: allConnections) {
+ for (IRemoteConnection conn : allConnections) {
if (conn.hasService(IRemoteCommandShellService.class)) {
suitableConnections.add(conn);
}
}
- return suitableConnections.toArray(new IRemoteConnection[]{});
+ return suitableConnections.toArray(new IRemoteConnection[] {});
}
- public static void remoteFileDownload(ILaunchConfiguration config,
- ILaunch launch, String localExePath, String remoteExePath,
- IProgressMonitor monitor) throws CoreException {
+ public static void remoteFileDownload(ILaunchConfiguration config, ILaunch launch, String localExePath,
+ String remoteExePath, IProgressMonitor monitor) throws CoreException {
- boolean skipDownload = config
- .getAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_SKIP_DOWNLOAD_TO_TARGET,
- false);
+ boolean skipDownload = config.getAttribute(IRemoteConnectionConfigurationConstants.ATTR_SKIP_DOWNLOAD_TO_TARGET,
+ false);
if (skipDownload) {
// Nothing to do. Download is skipped.
@@ -131,8 +128,7 @@ public class RemoteHelper {
remoteFile.putInfo(remoteFileInfo, EFS.SET_ATTRIBUTES, subMonitor.split(5));
} catch (CoreException e) {
- abort(Messages.RemoteRunLaunchDelegate_6, e,
- ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
+ abort(Messages.RemoteRunLaunchDelegate_6, e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
} finally {
monitor.done();
}
@@ -145,29 +141,24 @@ public class RemoteHelper {
return inputString.replaceAll(" ", "\\\\ "); //$NON-NLS-1$ //$NON-NLS-2$
}
- public static IRemoteConnection getCurrentConnection(ILaunchConfiguration config)
- throws CoreException {
- String remoteConnection = config.getAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_REMOTE_CONNECTION,
+ public static IRemoteConnection getCurrentConnection(ILaunchConfiguration config) throws CoreException {
+ String remoteConnection = config.getAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_CONNECTION,
""); //$NON-NLS-1$
IRemoteConnection connection = getRemoteConnectionByName(remoteConnection);
if (connection == null) {
- abort(Messages.RemoteRunLaunchDelegate_13, null,
- ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
+ abort(Messages.RemoteRunLaunchDelegate_13, null, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
}
return connection;
}
- public static Process remoteShellExec(ILaunchConfiguration config,
- String prelaunchCmd, String remoteCommandPath, String arguments,
- IProgressMonitor monitor) throws CoreException {
+ public static Process remoteShellExec(ILaunchConfiguration config, String prelaunchCmd, String remoteCommandPath,
+ String arguments, IProgressMonitor monitor) throws CoreException {
// The exit command is called to force the remote shell to close after
// our command
// is executed. This is to prevent a running process at the end of the
// debug session.
// See Bug 158786.
- monitor.beginTask(NLS.bind(Messages.RemoteRunLaunchDelegate_8,
- remoteCommandPath, arguments), 10);
+ monitor.beginTask(NLS.bind(Messages.RemoteRunLaunchDelegate_8, remoteCommandPath, arguments), 10);
String realRemoteCommand = arguments == null ? spaceEscapify(remoteCommandPath)
: spaceEscapify(remoteCommandPath) + " " + arguments; //$NON-NLS-1$
@@ -189,23 +180,20 @@ public class RemoteHelper {
os.write(remoteCommand.getBytes());
os.flush();
} catch (IOException e) {
- abort(Messages.RemoteRunLaunchDelegate_7, e,
- ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
+ abort(Messages.RemoteRunLaunchDelegate_7, e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
}
monitor.done();
return p;
}
- public static IRemoteProcess execCmdInRemoteShell(ILaunchConfiguration config,
- String prelaunchCmd, String remoteCommandPath, String arguments,
- IProgressMonitor monitor) throws Exception {
+ public static IRemoteProcess execCmdInRemoteShell(ILaunchConfiguration config, String prelaunchCmd,
+ String remoteCommandPath, String arguments, IProgressMonitor monitor) throws Exception {
// The exit command is called to force the remote shell to close after
// our command
// is executed. This is to prevent a running process at the end of the
// debug session.
// See Bug 158786.
- monitor.beginTask(NLS.bind(Messages.RemoteRunLaunchDelegate_8,
- remoteCommandPath, arguments), 10);
+ monitor.beginTask(NLS.bind(Messages.RemoteRunLaunchDelegate_8, remoteCommandPath, arguments), 10);
String realRemoteCommand = arguments == null ? spaceEscapify(remoteCommandPath)
: spaceEscapify(remoteCommandPath) + " " + arguments; //$NON-NLS-1$
@@ -214,10 +202,10 @@ public class RemoteHelper {
if (!prelaunchCmd.trim().equals("")) //$NON-NLS-1$
remoteCommand = prelaunchCmd + CMD_DELIMITER + remoteCommand;
- IRemoteConnection conn = getCurrentConnection(config);
- if (!conn.isOpen()) {
- conn.open(monitor);
- }
+ IRemoteConnection conn = getCurrentConnection(config);
+ if (!conn.isOpen()) {
+ conn.open(monitor);
+ }
IRemoteCommandShellService shellService = conn.getService(IRemoteCommandShellService.class);
IRemoteProcess p = null;
@@ -229,9 +217,7 @@ public class RemoteHelper {
return p;
}
-
- public static String getRemoteHostname(ILaunchConfiguration config)
- throws CoreException {
+ public static String getRemoteHostname(ILaunchConfiguration config) throws CoreException {
IRemoteConnection currentConnection = getCurrentConnection(config);
IRemoteConnectionHostService hostService = currentConnection.getService(IRemoteConnectionHostService.class);
return hostService.getHostname();
@@ -240,7 +226,7 @@ public class RemoteHelper {
/**
* Throws a core exception with an error status object built from the given
* message, lower level exception, and error code.
- *
+ *
* @param message
* the status message
* @param exception
@@ -253,10 +239,11 @@ public class RemoteHelper {
IStatus status;
if (exception != null) {
MultiStatus multiStatus = new MultiStatus(Activator.PLUGIN_ID, code, message, exception);
- multiStatus.add(new Status(IStatus.ERROR, Activator.PLUGIN_ID, code, exception.getLocalizedMessage(), exception));
- status= multiStatus;
+ multiStatus.add(
+ new Status(IStatus.ERROR, Activator.PLUGIN_ID, code, exception.getLocalizedMessage(), exception));
+ status = multiStatus;
} else {
- status= new Status(IStatus.ERROR, Activator.PLUGIN_ID, code, message, null);
+ status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, code, message, null);
}
throw new CoreException(status);
}
diff --git a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/RemoteUIHelper.java b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/RemoteUIHelper.java
index 6a4e8bb649..1535dc2a15 100644
--- a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/RemoteUIHelper.java
+++ b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/RemoteUIHelper.java
@@ -50,7 +50,8 @@ public class RemoteUIHelper {
if (connection == null) {
return;
}
- IRemoteUIConnectionService uiConnServices = connection.getConnectionType().getService(IRemoteUIConnectionService.class);
+ IRemoteUIConnectionService uiConnServices = connection.getConnectionType()
+ .getService(IRemoteUIConnectionService.class);
IRemoteUIConnectionWizard wizard = uiConnServices.getConnectionWizard(shell);
wizard.setConnection(connection.getWorkingCopy());
IRemoteConnectionWorkingCopy connCopy = wizard.open();
@@ -83,30 +84,29 @@ public class RemoteUIHelper {
title = windowTitle;
manager = Activator.getService(IRemoteServicesManager.class);
}
+
@Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
newShell.setText(title);
}
+
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
Label label = new Label(composite, SWT.WRAP);
label.setText(Messages.RemoteCMainTab_New_conntype_combo_label);
- GridData data = new GridData(GridData.GRAB_HORIZONTAL
- | GridData.GRAB_VERTICAL
- | GridData.HORIZONTAL_ALIGN_FILL
- | GridData.VERTICAL_ALIGN_CENTER);
+ GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL
+ | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
label.setLayoutData(data);
label.setFont(parent.getFont());
- fConnSelection = new Combo (composite, SWT.DROP_DOWN | SWT.READ_ONLY);
+ fConnSelection = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
ArrayList<String> suitableConnections = new ArrayList<>();
- for (IRemoteConnectionType type: manager.getAllConnectionTypes()) {
- if (type.canAdd() &&
- type.getConnectionServices().contains(
- IRemoteCommandShellService.class.getName())) {
+ for (IRemoteConnectionType type : manager.getAllConnectionTypes()) {
+ if (type.canAdd()
+ && type.getConnectionServices().contains(IRemoteCommandShellService.class.getName())) {
fConnSelection.setData(type.getName(), type.getId());
suitableConnections.add(type.getName());
}
@@ -121,26 +121,26 @@ public class RemoteUIHelper {
@Override
protected void buttonPressed(int buttonId) {
if (buttonId == IDialogConstants.OK_ID) {
- String connTypeId = (String) fConnSelection.getData(fConnSelection.getText());
- IRemoteConnectionType connType = manager.getConnectionType(connTypeId);
- IRemoteUIConnectionService fUIConnectionManager = connType.getService(IRemoteUIConnectionService.class);
- IRemoteUIConnectionWizard wizard = fUIConnectionManager.getConnectionWizard(this.getShell());
+ String connTypeId = (String) fConnSelection.getData(fConnSelection.getText());
+ IRemoteConnectionType connType = manager.getConnectionType(connTypeId);
+ IRemoteUIConnectionService fUIConnectionManager = connType
+ .getService(IRemoteUIConnectionService.class);
+ IRemoteUIConnectionWizard wizard = fUIConnectionManager.getConnectionWizard(this.getShell());
- IRemoteConnectionWorkingCopy wc = wizard.open();
- if (wc != null) {
- try {
- wc.save();
- } catch (RemoteConnectionException e) {
- logError(e);
+ IRemoteConnectionWorkingCopy wc = wizard.open();
+ if (wc != null) {
+ try {
+ wc.save();
+ } catch (RemoteConnectionException e) {
+ logError(e);
+ }
}
}
- }
super.buttonPressed(buttonId);
}
}
- NewRemoteConnectionDialog dlg = new NewRemoteConnectionDialog(shell,
- Messages.RemoteCMainTab_New_title);
+ NewRemoteConnectionDialog dlg = new NewRemoteConnectionDialog(shell, Messages.RemoteCMainTab_New_title);
dlg.setBlockOnOpen(true);
dlg.open();
}
@@ -180,7 +180,6 @@ public class RemoteUIHelper {
private static void logError(Exception e) {
Plugin plugin = Activator.getDefault();
ILog logger = plugin.getLog();
- logger.log(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
- e.getMessage(), e));
+ logger.log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e));
}
}
diff --git a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteGdbLaunchDelegate.java b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteGdbLaunchDelegate.java
index b5bb873597..03bc479aec 100644
--- a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteGdbLaunchDelegate.java
+++ b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteGdbLaunchDelegate.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Anna Dushistova (Mentor Graphics) - initial API and implementation
* Anna Dushistova (Mentor Graphics) - moved to org.eclipse.cdt.launch.remote.launching
@@ -48,67 +48,57 @@ import org.eclipse.remote.core.IRemoteProcess;
import org.eclipse.remote.core.RemoteProcessAdapter;
public class RemoteGdbLaunchDelegate extends GdbLaunchDelegate {
-
+
@Override
- public void launch(ILaunchConfiguration config, String mode,
- ILaunch launch, IProgressMonitor monitor) throws CoreException {
+ public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor)
+ throws CoreException {
IPath exePath = checkBinaryDetails(config);
Process remoteShellProcess = null;
if (exePath != null) {
// 1.Download binary if needed
- String remoteExePath = config.getAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH,
- ""); //$NON-NLS-1$
+ String remoteExePath = config.getAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH, ""); //$NON-NLS-1$
monitor.setTaskName(Messages.RemoteRunLaunchDelegate_2);
- RemoteHelper.remoteFileDownload(config, launch, exePath.toString(),
- remoteExePath, new SubProgressMonitor(monitor, 80));
+ RemoteHelper.remoteFileDownload(config, launch, exePath.toString(), remoteExePath,
+ new SubProgressMonitor(monitor, 80));
// 2.Launch gdbserver on target
- String gdbserverPortNumber = config
- .getAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_PORT,
- IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_PORT_DEFAULT);
- String gdbserverCommand = config
- .getAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_COMMAND,
- IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_COMMAND_DEFAULT);
- String gdbserverOptions = config
- .getAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_OPTIONS,
- IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_OPTIONS_DEFAULT);
+ String gdbserverPortNumber = config.getAttribute(
+ IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_PORT,
+ IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_PORT_DEFAULT);
+ String gdbserverCommand = config.getAttribute(
+ IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_COMMAND,
+ IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_COMMAND_DEFAULT);
+ String gdbserverOptions = config.getAttribute(
+ IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_OPTIONS,
+ IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_OPTIONS_DEFAULT);
String commandArguments = gdbserverOptions + " " //$NON-NLS-1$
+ ":" + gdbserverPortNumber + " " //$NON-NLS-1$ //$NON-NLS-2$
+ RemoteHelper.spaceEscapify(remoteExePath);
String arguments = getProgramArguments(config);
- String prelaunchCmd = config
- .getAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_PRERUN_COMMANDS,
- ""); //$NON-NLS-1$
+ String prelaunchCmd = config.getAttribute(IRemoteConnectionConfigurationConstants.ATTR_PRERUN_COMMANDS, ""); //$NON-NLS-1$
if (arguments != null && !arguments.isEmpty())
commandArguments += " " + arguments; //$NON-NLS-1$
monitor.setTaskName(Messages.RemoteRunLaunchDelegate_9);
-
+
// extending HostShellProcessAdapter here
- final GdbLaunch l = (GdbLaunch)launch;
+ final GdbLaunch l = (GdbLaunch) launch;
IRemoteProcess remoteShell = null;
try {
- remoteShell = RemoteHelper.execCmdInRemoteShell(config, prelaunchCmd,
- gdbserverCommand, commandArguments,
- new SubProgressMonitor(monitor, 5));
+ remoteShell = RemoteHelper.execCmdInRemoteShell(config, prelaunchCmd, gdbserverCommand,
+ commandArguments, new SubProgressMonitor(monitor, 5));
} catch (Exception e1) {
- RemoteHelper.abort(e1.getMessage(), e1,
- ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
+ RemoteHelper.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) {
try {
@@ -122,10 +112,8 @@ public class RemoteGdbLaunchDelegate extends GdbLaunchDelegate {
session.getExecutor().execute(new DsfRunnable() {
public void run() {
DsfServicesTracker tracker = new DsfServicesTracker(
- Activator.getBundleContext(),
- session.getId());
- IGDBControl control = tracker
- .getService(IGDBControl.class);
+ Activator.getBundleContext(), session.getId());
+ IGDBControl control = tracker.getService(IGDBControl.class);
if (control != null) {
control.terminate(new ImmediateRequestMonitor());
}
@@ -179,15 +167,15 @@ public class RemoteGdbLaunchDelegate extends GdbLaunchDelegate {
try {
l.getSession().getExecutor().execute(new DsfRunnable() {
public void run() {
- l.shutdownSession(new ImmediateRequestMonitor());
+ l.shutdownSession(new ImmediateRequestMonitor());
}
});
} catch (RejectedExecutionException e) {
// Session disposed.
}
- RemoteHelper.abort(Messages.RemoteGdbLaunchDelegate_gdbserverFailedToStartErrorMessage, null,
- ICDTLaunchConfigurationConstants.ERR_DEBUGGER_NOT_INSTALLED);
+ RemoteHelper.abort(Messages.RemoteGdbLaunchDelegate_gdbserverFailedToStartErrorMessage,
+ null, ICDTLaunchConfigurationConstants.ERR_DEBUGGER_NOT_INSTALLED);
}
try {
lock.wait(300);
@@ -198,24 +186,21 @@ public class RemoteGdbLaunchDelegate extends GdbLaunchDelegate {
// 3. Let debugger know how gdbserver was started on the remote
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
- wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP,
- true);
- wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_HOST,
- RemoteHelper.getRemoteHostname(config));
- wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_PORT,
- gdbserverPortNumber);
+ wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP, true);
+ wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_HOST, RemoteHelper.getRemoteHostname(config));
+ wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_PORT, gdbserverPortNumber);
wc.doSave();
}
- try{
+ try {
super.launch(config, mode, launch, monitor);
- } catch(CoreException ex) {
+ } catch (CoreException ex) {
//launch failed, need to kill gdbserver
if (remoteShellProcess != null) {
remoteShellProcess.destroy();
}
- //report failure further
+ //report failure further
throw ex;
} finally {
monitor.done();
@@ -223,14 +208,10 @@ public class RemoteGdbLaunchDelegate extends GdbLaunchDelegate {
}
}
- protected String getProgramArguments(ILaunchConfiguration config)
- throws CoreException {
- String args = config.getAttribute(
- ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
- (String) null);
+ protected String getProgramArguments(ILaunchConfiguration config) throws CoreException {
+ String args = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String) null);
if (args != null) {
- args = VariablesPlugin.getDefault().getStringVariableManager()
- .performStringSubstitution(args);
+ args = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(args);
}
return args;
}
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 c08a179794..18c60dbe12 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
@@ -50,41 +50,33 @@ import org.eclipse.osgi.util.NLS;
public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate {
@Override
- public void launch(ILaunchConfiguration config, String mode,
- ILaunch launch, IProgressMonitor monitor) throws CoreException {
+ public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor)
+ throws CoreException {
IPath exePath = CDebugUtils.verifyProgramPath(config);
ICProject project = CDebugUtils.verifyCProject(config);
if (exePath != null) {
verifyBinary(project, exePath);
String arguments = getProgramArguments(config);
- String remoteExePath = config.getAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH,
- ""); //$NON-NLS-1$
- String prelaunchCmd = config
- .getAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_PRERUN_COMMANDS,
- ""); //$NON-NLS-1$
+ String remoteExePath = config.getAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH, ""); //$NON-NLS-1$
+ String prelaunchCmd = config.getAttribute(IRemoteConnectionConfigurationConstants.ATTR_PRERUN_COMMANDS, ""); //$NON-NLS-1$
if (monitor == null)
monitor = new NullProgressMonitor();
-
if (mode.equals(ILaunchManager.RUN_MODE)) {
monitor.beginTask(Messages.RemoteRunLaunchDelegate_0, 100);
Process remoteProcess = null;
try {
// Download the binary to the remote before debugging.
monitor.setTaskName(Messages.RemoteRunLaunchDelegate_2);
- RemoteHelper.remoteFileDownload(config, launch, exePath.toString(),
- remoteExePath, new SubProgressMonitor(monitor, 80));
+ RemoteHelper.remoteFileDownload(config, launch, exePath.toString(), remoteExePath,
+ new SubProgressMonitor(monitor, 80));
// Use a remote shell to launch the binary.
monitor.setTaskName(Messages.RemoteRunLaunchDelegate_12);
- remoteProcess = RemoteHelper.remoteShellExec(config, prelaunchCmd,
- remoteExePath, arguments, new SubProgressMonitor(
- monitor, 20));
- DebugPlugin.newProcess(launch, remoteProcess,
- renderProcessLabel(exePath.toOSString()));
+ remoteProcess = RemoteHelper.remoteShellExec(config, prelaunchCmd, remoteExePath, arguments,
+ new SubProgressMonitor(monitor, 20));
+ DebugPlugin.newProcess(launch, remoteProcess, renderProcessLabel(exePath.toOSString()));
} catch (CoreException e) {
throw e;
} finally {
@@ -92,9 +84,8 @@ public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate {
}
} else {
- IStatus status = new Status(IStatus.ERROR, getPluginID(),
- IStatus.OK, NLS.bind(
- Messages.RemoteRunLaunchDelegate_1, mode), null);
+ IStatus status = new Status(IStatus.ERROR, getPluginID(), IStatus.OK,
+ NLS.bind(Messages.RemoteRunLaunchDelegate_1, mode), null);
throw new CoreException(status);
}
}
diff --git a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteCDSFDebuggerTab.java b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteCDSFDebuggerTab.java
index d921421b41..0d8877b440 100644
--- a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteCDSFDebuggerTab.java
+++ b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteCDSFDebuggerTab.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Anna Dushistova (Mentor Graphics) - initial API and implementation
* Anna Dushistova (Mentor Graphics) - moved to org.eclipse.cdt.launch.remote.tabs
@@ -77,8 +77,7 @@ public class RemoteCDSFDebuggerTab extends CDebuggerTab {
return;
}
// Ask the dynamic UI to create its Control
- debuggerPage
- .setLaunchConfigurationDialog(getLaunchConfigurationDialog());
+ debuggerPage.setLaunchConfigurationDialog(getLaunchConfigurationDialog());
debuggerPage.createControl(dynamicTabHolder);
debuggerPage.getControl().setVisible(true);
dynamicTabHolder.layout(true);
diff --git a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteCDSFMainTab.java b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteCDSFMainTab.java
index 028bc36df5..3aa6f8fb17 100644
--- a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteCDSFMainTab.java
+++ b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteCDSFMainTab.java
@@ -19,7 +19,7 @@
* Anna Dushistova (MontaVista) - [181517][usability] Specify commands to be run before remote application launch
* Anna Dushistova (MontaVista) - [223728] [remotecdt] connection combo is not populated until RSE is activated
* Anna Dushistova (MontaVista) - [267951] [remotecdt] Support systemTypes without files subsystem
- * Anna Dushistova (Mentor Graphics) - adapted from RemoteCMainTab
+ * Anna Dushistova (Mentor Graphics) - adapted from RemoteCMainTab
* Anna Dushistova (Mentor Graphics) - moved to org.eclipse.cdt.launch.remote.tabs
* Anna Dushistova (Mentor Graphics) - [318052] [remote launch] Properties are not saved/used
* Anna Dushistova (MontaVista) - [375067] [remote] Automated remote launch does not support project-less debug
@@ -97,7 +97,7 @@ public class RemoteCDSFMainTab extends CMainTab {
private Label preRunLabel;
private boolean isInitializing = false;
-
+
public RemoteCDSFMainTab() {
super(CMainTab.INCLUDE_BUILD_SETTINGS);
}
@@ -123,17 +123,13 @@ public class RemoteCDSFMainTab extends CMainTab {
}
});
- PlatformUI
- .getWorkbench()
- .getHelpSystem()
- .setHelp(getControl(),
- Activator.PLUGIN_ID + ".launchgroup"); //$NON-NLS-1$
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), Activator.PLUGIN_ID + ".launchgroup"); //$NON-NLS-1$
}
/*
* isValid
- *
+ *
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid
*/
@Override
@@ -206,8 +202,7 @@ public class RemoteCDSFMainTab extends CMainTab {
}
});
- newRemoteConnectionButton = createPushButton(projComp,
- Messages.RemoteCMainTab_New, null);
+ newRemoteConnectionButton = createPushButton(projComp, Messages.RemoteCMainTab_New, null);
newRemoteConnectionButton.addSelectionListener(new SelectionAdapter() {
@Override
@@ -217,9 +212,8 @@ public class RemoteCDSFMainTab extends CMainTab {
updateConnectionPulldown();
}
});
-
- editRemoteConnectionButton = createPushButton(projComp,
- Messages.RemoteCMainTab_Edit, null);
+
+ editRemoteConnectionButton = createPushButton(projComp, Messages.RemoteCMainTab_Edit, null);
editRemoteConnectionButton.addSelectionListener(new SelectionAdapter() {
@Override
@@ -228,16 +222,14 @@ public class RemoteCDSFMainTab extends CMainTab {
}
});
- remoteConnectionPropertiesButton = createPushButton(projComp,
- Messages.RemoteCMainTab_Properties, null);
- remoteConnectionPropertiesButton
- .addSelectionListener(new SelectionAdapter() {
+ remoteConnectionPropertiesButton = createPushButton(projComp, Messages.RemoteCMainTab_Properties, null);
+ remoteConnectionPropertiesButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent evt) {
- handleRemoteConnectionPropertiesSelected();
- }
- });
+ @Override
+ public void widgetSelected(SelectionEvent evt) {
+ handleRemoteConnectionPropertiesSelected();
+ }
+ });
updateConnectionPulldown();
}
@@ -273,8 +265,7 @@ public class RemoteCDSFMainTab extends CMainTab {
}
});
- remoteBrowseButton = createPushButton(mainComp,
- Messages.RemoteCMainTab_Remote_Path_Browse_Button, null);
+ remoteBrowseButton = createPushButton(mainComp, Messages.RemoteCMainTab_Remote_Path_Browse_Button, null);
remoteBrowseButton.addSelectionListener(new SelectionAdapter() {
@Override
@@ -316,8 +307,7 @@ public class RemoteCDSFMainTab extends CMainTab {
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
mainComp.setLayoutData(gd);
- skipDownloadButton = createCheckButton(mainComp,
- SKIP_DOWNLOAD_BUTTON_TEXT);
+ skipDownloadButton = createCheckButton(mainComp, SKIP_DOWNLOAD_BUTTON_TEXT);
skipDownloadButton.addSelectionListener(new SelectionAdapter() {
@Override
@@ -331,49 +321,48 @@ public class RemoteCDSFMainTab extends CMainTab {
protected void handleNewRemoteConnectionSelected() {
RemoteUIHelper.newConnectionDialog(getControl().getShell());
}
-
+
/**
* Opens the <code>SystemConnectionPropertyPage</code> page for the selected connection.
*/
protected void handleEditRemoteConnectionSelected() {
- RemoteUIHelper.editConnectionDialog(getCurrentConnection(),
- getControl().getShell());
+ RemoteUIHelper.editConnectionDialog(getCurrentConnection(), getControl().getShell());
}
protected IRemoteConnection getCurrentConnection() {
int currentSelection = connectionCombo.getSelectionIndex();
- String remoteConnection = currentSelection >= 0 ? connectionCombo
- .getItem(currentSelection) : null;
+ String remoteConnection = currentSelection >= 0 ? connectionCombo.getItem(currentSelection) : null;
return RemoteHelper.getRemoteConnectionByName(remoteConnection);
}
protected void handleRemoteBrowseSelected() {
IRemoteConnection currentConnectionSelected = getCurrentConnection();
-
+
// Try to open the connection before showing RemoteResourceBrowser
if (currentConnectionSelected != null && !currentConnectionSelected.isOpen()) {
if (currentConnectionSelected.getConnectionType().hasService(IRemoteUIConnectionService.class)) {
-
- IRemoteUIConnectionService uiConnService = currentConnectionSelected.getConnectionType().getService(IRemoteUIConnectionService.class);
- uiConnService.openConnectionWithProgress(getShell(), new ProgressMonitorDialog(getShell()), currentConnectionSelected);
-
+
+ IRemoteUIConnectionService uiConnService = currentConnectionSelected.getConnectionType()
+ .getService(IRemoteUIConnectionService.class);
+ uiConnService.openConnectionWithProgress(getShell(), new ProgressMonitorDialog(getShell()),
+ currentConnectionSelected);
+
// Don't show RemoteResourceBrowser if the connection cannot be opened
if (!currentConnectionSelected.isOpen())
return;
}
}
-
- RemoteResourceBrowser b = new RemoteResourceBrowser(getControl().getShell(),
- SWT.NONE);
+
+ RemoteResourceBrowser b = new RemoteResourceBrowser(getControl().getShell(), SWT.NONE);
b.setConnection(currentConnectionSelected);
b.setTitle(Messages.RemoteCMainTab_Remote_Path_Browse_Button_Title);
int returnCode = b.open();
-
+
// User cancelled the browse dialog?
if (returnCode == Window.CANCEL) {
return;
}
-
+
IFileStore selectedFile = b.getResource();
if (selectedFile != null) {
String absPath = selectedFile.toURI().getPath();
@@ -399,15 +388,14 @@ public class RemoteCDSFMainTab extends CMainTab {
private Text fWSRoot;
private String fDialogTitle;
- public RemoteConnectionPropertyDialog(Shell parentShell,
- String dialogTitle, IRemoteConnection host) {
+ public RemoteConnectionPropertyDialog(Shell parentShell, String dialogTitle, IRemoteConnection host) {
super(parentShell);
fDialogTitle = dialogTitle;
fHost = host;
IRemoteServicesManager remoteServicesManager = Activator.getService(IRemoteServicesManager.class);
fbLocalHost = (fHost.getConnectionType() == remoteServicesManager.getLocalConnectionType());
}
-
+
@Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
@@ -417,37 +405,28 @@ public class RemoteCDSFMainTab extends CMainTab {
@Override
protected Control createDialogArea(Composite parent) {
// create composite
- Composite composite = (Composite) super
- .createDialogArea(parent);
+ Composite composite = (Composite) super.createDialogArea(parent);
Label label = new Label(composite, SWT.WRAP);
label.setText(Messages.RemoteCMainTab_Properties_Location);
- GridData data = new GridData(GridData.GRAB_HORIZONTAL
- | GridData.GRAB_VERTICAL
- | GridData.HORIZONTAL_ALIGN_FILL
- | GridData.VERTICAL_ALIGN_CENTER);
+ GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL
+ | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
label.setLayoutData(data);
label.setFont(parent.getFont());
fWSRoot = new Text(composite, SWT.SINGLE | SWT.BORDER);
- fWSRoot.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
- | GridData.HORIZONTAL_ALIGN_FILL));
+ fWSRoot.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
fSkipDownloadBtn = new Button(composite, SWT.CHECK);
- fSkipDownloadBtn
- .setText(Messages.RemoteCMainTab_Properties_Skip_default);
+ fSkipDownloadBtn.setText(Messages.RemoteCMainTab_Properties_Skip_default);
if (!fbLocalHost) {
String value = RemoteUIHelper.getConnectionProperty(fHost,
IRemoteConnectionHostConstants.REMOTE_WS_ROOT);
- if(!value.isEmpty()) {
+ if (!value.isEmpty()) {
fWSRoot.setText(value);
}
- fSkipDownloadBtn
- .setSelection(Boolean
- .valueOf(
- RemoteUIHelper.getConnectionProperty(fHost,
- IRemoteConnectionHostConstants.DEFAULT_SKIP_DOWNLOAD))
- .booleanValue());
+ fSkipDownloadBtn.setSelection(Boolean.valueOf(RemoteUIHelper.getConnectionProperty(fHost,
+ IRemoteConnectionHostConstants.DEFAULT_SKIP_DOWNLOAD)).booleanValue());
} else {
fSkipDownloadBtn.setEnabled(false);
fWSRoot.setEnabled(false);
@@ -459,22 +438,17 @@ public class RemoteCDSFMainTab extends CMainTab {
@Override
protected void buttonPressed(int buttonId) {
if (!fbLocalHost && (buttonId == IDialogConstants.OK_ID)) {
- RemoteUIHelper.setConnectionProperty(fHost,
- IRemoteConnectionHostConstants.REMOTE_WS_ROOT,
+ RemoteUIHelper.setConnectionProperty(fHost, IRemoteConnectionHostConstants.REMOTE_WS_ROOT,
fWSRoot.getText());
- RemoteUIHelper.setConnectionProperty(fHost,
- IRemoteConnectionHostConstants.DEFAULT_SKIP_DOWNLOAD,
- Boolean.toString(fSkipDownloadBtn
- .getSelection()));
+ RemoteUIHelper.setConnectionProperty(fHost, IRemoteConnectionHostConstants.DEFAULT_SKIP_DOWNLOAD,
+ Boolean.toString(fSkipDownloadBtn.getSelection()));
}
super.buttonPressed(buttonId);
}
}
IRemoteConnection currentConnectionSelected = getCurrentConnection();
- RemoteConnectionPropertyDialog dlg = new RemoteConnectionPropertyDialog(
- getControl().getShell(),
- Messages.RemoteCMainTab_Properties_title,
- currentConnectionSelected);
+ RemoteConnectionPropertyDialog dlg = new RemoteConnectionPropertyDialog(getControl().getShell(),
+ Messages.RemoteCMainTab_Properties_title, currentConnectionSelected);
dlg.setBlockOnOpen(true);
dlg.open();
}
@@ -493,18 +467,15 @@ public class RemoteCDSFMainTab extends CMainTab {
}
private void updateConnectionButtons() {
- if ((remoteConnectionPropertiesButton == null)
- || remoteConnectionPropertiesButton.isDisposed()) {
+ if ((remoteConnectionPropertiesButton == null) || remoteConnectionPropertiesButton.isDisposed()) {
return;
}
- if ((editRemoteConnectionButton == null)
- || editRemoteConnectionButton.isDisposed()) {
+ if ((editRemoteConnectionButton == null) || editRemoteConnectionButton.isDisposed()) {
return;
}
boolean bEnable = false;
IRemoteConnection currentConnectionSelected = getCurrentConnection();
- if (currentConnectionSelected != null &&
- currentConnectionSelected.getConnectionType().canEdit()) {
+ if (currentConnectionSelected != null && currentConnectionSelected.getConnectionType().canEdit()) {
bEnable = true;
}
remoteConnectionPropertiesButton.setEnabled(bEnable);
@@ -514,8 +485,7 @@ public class RemoteCDSFMainTab extends CMainTab {
protected void updateTargetProgFromConfig(ILaunchConfiguration config) {
String targetPath = null;
try {
- targetPath = config.getAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH,
+ targetPath = config.getAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH,
REMOTE_PATH_DEFAULT);
} catch (CoreException e) {
// Ignore
@@ -524,10 +494,7 @@ public class RemoteCDSFMainTab extends CMainTab {
String prelaunchCmd = null;
try {
- prelaunchCmd = config
- .getAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_PRERUN_COMMANDS,
- ""); //$NON-NLS-1$
+ prelaunchCmd = config.getAttribute(IRemoteConnectionConfigurationConstants.ATTR_PRERUN_COMMANDS, ""); //$NON-NLS-1$
} catch (CoreException e) {
// Ignore
}
@@ -537,10 +504,8 @@ public class RemoteCDSFMainTab extends CMainTab {
protected void updateSkipDownloadFromConfig(ILaunchConfiguration config) {
boolean downloadToTarget = true;
try {
- downloadToTarget = config
- .getAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_SKIP_DOWNLOAD_TO_TARGET,
- getDefaultSkipDownload());
+ downloadToTarget = config.getAttribute(IRemoteConnectionConfigurationConstants.ATTR_SKIP_DOWNLOAD_TO_TARGET,
+ getDefaultSkipDownload());
} catch (CoreException e) {
// Ignore for now
}
@@ -570,8 +535,7 @@ public class RemoteCDSFMainTab extends CMainTab {
exePath = project.getFile(programName).getLocation();
IPath wsRoot = project.getWorkspace().getRoot().getLocation();
- exePath = makeRelativeToWSRootLocation(exePath, remoteWsRoot,
- wsRoot);
+ exePath = makeRelativeToWSRootLocation(exePath, remoteWsRoot, wsRoot);
}
String path = exePath.toString();
remoteProgText.setText(path);
@@ -582,8 +546,9 @@ public class RemoteCDSFMainTab extends CMainTab {
// During initialization, we don't want to use the default
// values of the connection, but we want to use the ones
// that are part of the configuration
- if (isInitializing) return;
-
+ if (isInitializing)
+ return;
+
if ((remoteProgText != null) && !remoteProgText.isDisposed()) {
String remoteName = remoteProgText.getText().trim();
String remoteWsRoot = getRemoteWSRoot();
@@ -592,8 +557,7 @@ public class RemoteCDSFMainTab extends CMainTab {
} else {
// try to use remote path
IPath wsRoot = Platform.getLocation();
- IPath remotePath = makeRelativeToWSRootLocation(new Path(
- remoteName), remoteWsRoot, wsRoot);
+ IPath remotePath = makeRelativeToWSRootLocation(new Path(remoteName), remoteWsRoot, wsRoot);
remoteProgText.setText(remotePath.toString());
}
}
@@ -614,14 +578,12 @@ public class RemoteCDSFMainTab extends CMainTab {
}
}
- private IPath makeRelativeToWSRootLocation(IPath exePath,
- String remoteWsRoot, IPath wsRoot) {
+ private IPath makeRelativeToWSRootLocation(IPath exePath, String remoteWsRoot, IPath wsRoot) {
if (remoteWsRoot.length() != 0) {
// use remoteWSRoot instead of Workspace Root
if (wsRoot.isPrefixOf(exePath)) {
- return new Path(remoteWsRoot).append(exePath
- .removeFirstSegments(wsRoot.segmentCount()).setDevice(
- null));
+ return new Path(remoteWsRoot)
+ .append(exePath.removeFirstSegments(wsRoot.segmentCount()).setDevice(null));
}
}
return exePath;
@@ -629,10 +591,9 @@ public class RemoteCDSFMainTab extends CMainTab {
private String getRemoteWSRoot() {
IRemoteConnection host = getCurrentConnection();
- if(host != null) {
- String value = RemoteUIHelper.getConnectionProperty(host,
- IRemoteConnectionHostConstants.REMOTE_WS_ROOT);
- if(!value.isEmpty()) {
+ if (host != null) {
+ String value = RemoteUIHelper.getConnectionProperty(host, IRemoteConnectionHostConstants.REMOTE_WS_ROOT);
+ if (!value.isEmpty()) {
return value;
}
}
@@ -642,12 +603,12 @@ public class RemoteCDSFMainTab extends CMainTab {
private boolean getDefaultSkipDownload() {
IRemoteConnection host = getCurrentConnection();
if (host != null) {
- if(RemoteHelper.getFileSubsystem(host) == null){
+ if (RemoteHelper.getFileSubsystem(host) == null) {
return true;
}
String value = RemoteUIHelper.getConnectionProperty(host,
IRemoteConnectionHostConstants.DEFAULT_SKIP_DOWNLOAD);
- if(!value.isEmpty()) {
+ if (!value.isEmpty()) {
return Boolean.valueOf(value).booleanValue();
}
}
@@ -659,10 +620,7 @@ public class RemoteCDSFMainTab extends CMainTab {
isInitializing = true;
String remoteConnection = null;
try {
- remoteConnection = config
- .getAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_REMOTE_CONNECTION,
- ""); //$NON-NLS-1$
+ remoteConnection = config.getAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_CONNECTION, ""); //$NON-NLS-1$
} catch (CoreException ce) {
// Ignore
}
@@ -691,26 +649,19 @@ public class RemoteCDSFMainTab extends CMainTab {
/*
* performApply
- *
+ *
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply
*/
@Override
public void performApply(ILaunchConfigurationWorkingCopy config) {
int currentSelection = connectionCombo.getSelectionIndex();
- config.setAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_REMOTE_CONNECTION,
- currentSelection >= 0 ? connectionCombo
- .getItem(currentSelection) : null);
- config.setAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH,
- remoteProgText.getText());
- config.setAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_SKIP_DOWNLOAD_TO_TARGET,
+ config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_CONNECTION,
+ currentSelection >= 0 ? connectionCombo.getItem(currentSelection) : null);
+ config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH, remoteProgText.getText());
+ config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_SKIP_DOWNLOAD_TO_TARGET,
skipDownloadButton.getSelection());
- config.setAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_PRERUN_COMMANDS,
- preRunText.getText());
+ config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_PRERUN_COMMANDS, preRunText.getText());
super.performApply(config);
}
@@ -722,18 +673,11 @@ public class RemoteCDSFMainTab extends CMainTab {
@Override
public void setDefaults(ILaunchConfigurationWorkingCopy config) {
super.setDefaults(config);
- config.setAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_REMOTE_CONNECTION,
- EMPTY_STRING);
- config.setAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH,
- REMOTE_PATH_DEFAULT);
- config.setAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_SKIP_DOWNLOAD_TO_TARGET,
+ config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_CONNECTION, EMPTY_STRING);
+ config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH, REMOTE_PATH_DEFAULT);
+ config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_SKIP_DOWNLOAD_TO_TARGET,
SKIP_DOWNLOAD_TO_REMOTE_DEFAULT);
- config.setAttribute(
- IRemoteConnectionConfigurationConstants.ATTR_PRERUN_COMMANDS,
- EMPTY_STRING);
+ config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_PRERUN_COMMANDS, EMPTY_STRING);
}
}
diff --git a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteDSFGDBDebuggerPage.java b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteDSFGDBDebuggerPage.java
index db8641776e..7e24600024 100644
--- a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteDSFGDBDebuggerPage.java
+++ b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/tabs/RemoteDSFGDBDebuggerPage.java
@@ -1,16 +1,16 @@
/*******************************************************************************
* Copyright (c) 2006, 2018 PalmSource, Inc. and others.
*
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
* Ewa Matejska (PalmSource)
- *
+ *
* Referenced GDBDebuggerPage code to write this.
* Anna Dushistova (Mentor Graphics) - adapted from RemoteGDBDebuggerPage
* Anna Dushistova (Mentor Graphics) - moved to org.eclipse.cdt.launch.remote.tabs
@@ -39,48 +39,46 @@ import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Text;
-public class RemoteDSFGDBDebuggerPage extends GdbDebuggerPage{
+public class RemoteDSFGDBDebuggerPage extends GdbDebuggerPage {
protected Text fGDBServerCommandText;
protected Text fGDBServerPortNumberText;
protected Text fGDBServerOptionsText;
-
+
protected Button fRemoteTimeoutEnabledCheckbox;
-
+
protected Text fRemoteTimeoutValueText;
private boolean fIsInitializing = false;
-
public RemoteDSFGDBDebuggerPage() {
super();
}
-
@Override
public String getName() {
return Messages.Remote_GDB_Debugger_Options;
}
-
+
@Override
- public void setDefaults( ILaunchConfigurationWorkingCopy configuration ) {
+ 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 );
- configuration.setAttribute( IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_ENABLED,
- LaunchUtils.getRemoteTimeoutEnabledDefault());
- configuration.setAttribute( IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_VALUE,
- LaunchUtils.getRemoteTimeoutValueDefault());
+ 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);
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_ENABLED,
+ LaunchUtils.getRemoteTimeoutEnabledDefault());
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_VALUE,
+ LaunchUtils.getRemoteTimeoutValueDefault());
}
-
+
@Override
- public void initializeFrom( ILaunchConfiguration configuration ) {
+ public void initializeFrom(ILaunchConfiguration configuration) {
setInitializing(true);
super.initializeFrom(configuration);
@@ -90,147 +88,146 @@ public class RemoteDSFGDBDebuggerPage extends GdbDebuggerPage{
boolean remoteTimeoutEnabled = false;
String remoteTimeoutValue = null;
try {
- gdbserverCommand = configuration.getAttribute( IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_COMMAND,
- IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_COMMAND_DEFAULT);
- }
- catch( CoreException e ) {
+ 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 ) {
+ 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 ) {
+ gdbserverOptions = configuration.getAttribute(
+ IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_OPTIONS,
+ IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_OPTIONS_DEFAULT);
+ } catch (CoreException e) {
}
try {
- remoteTimeoutEnabled = configuration.getAttribute( IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_ENABLED,
- LaunchUtils.getRemoteTimeoutEnabledDefault() );
- }
- catch( CoreException e ) {
+ 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 ) {
+ remoteTimeoutValue = configuration.getAttribute(
+ IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_VALUE,
+ LaunchUtils.getRemoteTimeoutValueDefault());
+ } catch (CoreException e) {
}
- fGDBServerCommandText.setText( gdbserverCommand );
- fGDBServerPortNumberText.setText( gdbserverPortNumber );
- fGDBServerOptionsText.setText( gdbserverOptions );
- fRemoteTimeoutEnabledCheckbox.setSelection( remoteTimeoutEnabled );
- fRemoteTimeoutValueText.setText( remoteTimeoutValue );
+ fGDBServerCommandText.setText(gdbserverCommand);
+ fGDBServerPortNumberText.setText(gdbserverPortNumber);
+ fGDBServerOptionsText.setText(gdbserverOptions);
+ fRemoteTimeoutEnabledCheckbox.setSelection(remoteTimeoutEnabled);
+ fRemoteTimeoutValueText.setText(remoteTimeoutValue);
remoteTimeoutEnabledChanged();
setInitializing(false);
}
-
+
@Override
- public void performApply( ILaunchConfigurationWorkingCopy configuration ) {
+ public void performApply(ILaunchConfigurationWorkingCopy configuration) {
super.performApply(configuration);
String str = fGDBServerCommandText.getText();
str.trim();
- configuration.setAttribute( IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_COMMAND, str );
+ configuration.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_COMMAND, str);
str = fGDBServerPortNumberText.getText();
str.trim();
- configuration.setAttribute( IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_PORT, str );
+ configuration.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_PORT, str);
str = fGDBServerOptionsText.getText();
str.trim();
- configuration.setAttribute( IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_OPTIONS, str );
+ configuration.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_OPTIONS, str);
boolean b = fRemoteTimeoutEnabledCheckbox.getSelection();
- configuration.setAttribute( IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_ENABLED, b );
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_ENABLED, b);
str = fRemoteTimeoutValueText.getText();
str.trim();
- configuration.setAttribute( IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_VALUE, str );
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_VALUE, str);
}
-
- protected void createGdbserverSettingsTab( TabFolder tabFolder ) {
- TabItem tabItem = new TabItem( tabFolder, SWT.NONE );
- tabItem.setText( Messages.Gdbserver_Settings_Tab_Name );
-
+
+ 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 );
-
+ ((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);
+ ((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 );
-
-
+ 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() {
+ fGDBServerCommandText.addModifyListener(new ModifyListener() {
- public void modifyText( ModifyEvent evt ) {
+ 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 );
-
+ 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() {
+ fGDBServerPortNumberText.addModifyListener(new ModifyListener() {
- public void modifyText( ModifyEvent evt ) {
+ 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 );
+ 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() {
+ fGDBServerOptionsText.addModifyListener(new ModifyListener() {
- public void modifyText( ModifyEvent evt ) {
+ public void modifyText(ModifyEvent evt) {
updateLaunchConfigurationDialog();
}
- } );
+ });
fRemoteTimeoutEnabledCheckbox = new Button(subComp, SWT.CHECK);
fRemoteTimeoutEnabledCheckbox.setText(Messages.Remotetimeout_label);
fRemoteTimeoutEnabledCheckbox.setToolTipText(Messages.Remotetimeout_tooltip);
gd = new GridData();
- fRemoteTimeoutEnabledCheckbox.setLayoutData( gd );
- fRemoteTimeoutEnabledCheckbox.addSelectionListener( new SelectionAdapter() {
+ 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.Remotetimeout_tooltip);
- fRemoteTimeoutValueText.addModifyListener( new ModifyListener() {
+ fRemoteTimeoutValueText.addModifyListener(new ModifyListener() {
- public void modifyText( ModifyEvent evt ) {
+ public void modifyText(ModifyEvent evt) {
updateLaunchConfigurationDialog();
}
- } );
+ });
remoteTimeoutEnabledChanged();
}
@@ -242,9 +239,9 @@ public class RemoteDSFGDBDebuggerPage extends GdbDebuggerPage{
* @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 );
+ public void createTabs(TabFolder tabFolder) {
+ super.createTabs(tabFolder);
+ createGdbserverSettingsTab(tabFolder);
}
@Override
diff --git a/cross/org.eclipse.cdt.launch.serial.ui/src/org/eclipse/cdt/launch/serial/ui/internal/NewSerialFlashTargetWizardPage.java b/cross/org.eclipse.cdt.launch.serial.ui/src/org/eclipse/cdt/launch/serial/ui/internal/NewSerialFlashTargetWizardPage.java
index 81b7ab53bb..c6a6ed71ff 100644
--- a/cross/org.eclipse.cdt.launch.serial.ui/src/org/eclipse/cdt/launch/serial/ui/internal/NewSerialFlashTargetWizardPage.java
+++ b/cross/org.eclipse.cdt.launch.serial.ui/src/org/eclipse/cdt/launch/serial/ui/internal/NewSerialFlashTargetWizardPage.java
@@ -110,7 +110,8 @@ public class NewSerialFlashTargetWizardPage extends WizardPage {
}
}
} catch (IOException e) {
- Activator.log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NewSerialFlashTargetWizardPage_Fetching, e));
+ Activator.log(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
+ Messages.NewSerialFlashTargetWizardPage_Fetching, e));
}
}

Back to the top