mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 17:26:01 +02:00
Bug 267951 - Patch from Anna to support system types without files subsystem.
This commit is contained in:
parent
3f6473cfed
commit
bfb0f1ab9c
3 changed files with 214 additions and 97 deletions
|
@ -0,0 +1,153 @@
|
||||||
|
/********************************************************************************
|
||||||
|
* Copyright (c) 2009 MontaVista Software, Inc.
|
||||||
|
* 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:
|
||||||
|
* Anna Dushistova (MontaVista) - initial API and implementation
|
||||||
|
********************************************************************************/
|
||||||
|
|
||||||
|
package org.eclipse.cdt.launch.remote;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
|
import org.eclipse.core.runtime.OperationCanceledException;
|
||||||
|
import org.eclipse.core.runtime.Status;
|
||||||
|
import org.eclipse.rse.core.RSECorePlugin;
|
||||||
|
import org.eclipse.rse.core.model.IHost;
|
||||||
|
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||||
|
import org.eclipse.rse.services.IService;
|
||||||
|
import org.eclipse.rse.services.shells.IShellService;
|
||||||
|
import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem;
|
||||||
|
|
||||||
|
public class RSEHelper {
|
||||||
|
|
||||||
|
public static IHost getRemoteConnectionByName(String remoteConnection) {
|
||||||
|
if (remoteConnection == null)
|
||||||
|
return null;
|
||||||
|
IHost[] connections = RSECorePlugin.getTheSystemRegistry().getHosts();
|
||||||
|
for (int i = 0; i < connections.length; i++)
|
||||||
|
if (connections[i].getAliasName().equals(remoteConnection))
|
||||||
|
return connections[i];
|
||||||
|
return null; // TODO Connection is not found in the list--need to react
|
||||||
|
// somehow, throw the exception?
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IService getConnectedRemoteFileService(
|
||||||
|
IHost currentConnection, IProgressMonitor monitor) throws Exception {
|
||||||
|
final ISubSystem subsystem = getFileSubsystem(currentConnection);
|
||||||
|
|
||||||
|
if (subsystem == null)
|
||||||
|
throw new Exception(Messages.RemoteRunLaunchDelegate_4);
|
||||||
|
|
||||||
|
try {
|
||||||
|
subsystem.connect(monitor, false);
|
||||||
|
} catch (CoreException e) {
|
||||||
|
throw e;
|
||||||
|
} catch (OperationCanceledException e) {
|
||||||
|
throw new CoreException(Status.CANCEL_STATUS);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!subsystem.isConnected())
|
||||||
|
throw new Exception(Messages.RemoteRunLaunchDelegate_5);
|
||||||
|
|
||||||
|
return ((IFileServiceSubSystem) subsystem).getFileService();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IService getConnectedRemoteShellService(
|
||||||
|
IHost currentConnection, IProgressMonitor monitor) throws Exception {
|
||||||
|
ISubSystem subsystem = getSubSystemWithShellService(currentConnection);
|
||||||
|
if (subsystem != null) {
|
||||||
|
try {
|
||||||
|
subsystem.connect(monitor, false);
|
||||||
|
} catch (CoreException e) {
|
||||||
|
throw e;
|
||||||
|
} catch (OperationCanceledException e) {
|
||||||
|
throw new CoreException(Status.CANCEL_STATUS);
|
||||||
|
}
|
||||||
|
if (!subsystem.isConnected())
|
||||||
|
throw new Exception(Messages.RemoteRunLaunchDelegate_5);
|
||||||
|
|
||||||
|
return (IShellService) subsystem.getSubSystemConfiguration()
|
||||||
|
.getService(currentConnection).getAdapter(
|
||||||
|
IShellService.class);
|
||||||
|
} else {
|
||||||
|
throw new Exception(Messages.RemoteRunLaunchDelegate_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find the first shell service associated with the host.
|
||||||
|
*
|
||||||
|
* @param host
|
||||||
|
* the connection
|
||||||
|
* @return shell service object, or <code>null</code> if not found.
|
||||||
|
*/
|
||||||
|
public static IShellService getShellService(IHost host) {
|
||||||
|
ISubSystem ss = getSubSystemWithShellService(host);
|
||||||
|
if (ss != null) {
|
||||||
|
return (IShellService) ss.getSubSystemConfiguration().getService(
|
||||||
|
host).getAdapter(IShellService.class);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find the first IShellServiceSubSystem service associated with the host.
|
||||||
|
*
|
||||||
|
* @param host
|
||||||
|
* the connection
|
||||||
|
* @return shell service subsystem, or <code>null</code> if not found.
|
||||||
|
*/
|
||||||
|
public static ISubSystem getSubSystemWithShellService(IHost host) {
|
||||||
|
if (host == null)
|
||||||
|
return null;
|
||||||
|
ISubSystem[] subSystems = host.getSubSystems();
|
||||||
|
IShellService ssvc = null;
|
||||||
|
for (int i = 0; subSystems != null && i < subSystems.length; i++) {
|
||||||
|
IService svc = subSystems[i].getSubSystemConfiguration()
|
||||||
|
.getService(host);
|
||||||
|
if (svc != null) {
|
||||||
|
ssvc = (IShellService) svc.getAdapter(IShellService.class);
|
||||||
|
if (ssvc != null) {
|
||||||
|
return subSystems[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ISubSystem getFileSubsystem(IHost host) {
|
||||||
|
if (host == null)
|
||||||
|
return null;
|
||||||
|
ISubSystem[] subSystems = host.getSubSystems();
|
||||||
|
for (int i = 0; i < subSystems.length; i++) {
|
||||||
|
if (subSystems[i] instanceof IFileServiceSubSystem)
|
||||||
|
return subSystems[i];
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IHost[] getSuitableConnections() {
|
||||||
|
ArrayList shellConnections = new ArrayList(Arrays.asList(RSECorePlugin.getTheSystemRegistry()
|
||||||
|
.getHostsBySubSystemConfigurationCategory("shells"))); //$NON-NLS-1$
|
||||||
|
ArrayList terminalConnections = new ArrayList(Arrays.asList(RSECorePlugin.getTheSystemRegistry()
|
||||||
|
.getHostsBySubSystemConfigurationCategory("terminals")));//$NON-NLS-1$
|
||||||
|
|
||||||
|
Iterator iter = terminalConnections.iterator();
|
||||||
|
while(iter.hasNext()){
|
||||||
|
Object terminalConnection = iter.next();
|
||||||
|
if(!shellConnections.contains(terminalConnection)){
|
||||||
|
shellConnections.add(terminalConnection);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (IHost[]) shellConnections.toArray(new IHost[shellConnections.size()]);
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,6 +15,7 @@
|
||||||
* Johann Draschwandtner (Wind River) - [233057][remotecdt]Fix button enablement
|
* Johann Draschwandtner (Wind River) - [233057][remotecdt]Fix button enablement
|
||||||
* Anna Dushistova (MontaVista) - [181517][usability] Specify commands to be run before remote application launch
|
* 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) - [223728] [remotecdt] connection combo is not populated until RSE is activated
|
||||||
|
* Anna Dushistova (MontaVista) - [267951] [remotecdt] Support systemTypes without files subsystem
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.launch.remote;
|
package org.eclipse.cdt.launch.remote;
|
||||||
|
@ -368,15 +369,8 @@ public class RemoteCMainTab extends CMainTab {
|
||||||
int currentSelection = connectionCombo.getSelectionIndex();
|
int currentSelection = connectionCombo.getSelectionIndex();
|
||||||
String remoteConnection = currentSelection >= 0 ? connectionCombo
|
String remoteConnection = currentSelection >= 0 ? connectionCombo
|
||||||
.getItem(currentSelection) : null;
|
.getItem(currentSelection) : null;
|
||||||
if (remoteConnection == null)
|
return RSEHelper.getRemoteConnectionByName(remoteConnection);
|
||||||
return null;
|
}
|
||||||
IHost[] connections = RSECorePlugin.getTheSystemRegistry().getHosts();
|
|
||||||
int i = 0;
|
|
||||||
for (i = 0; i < connections.length; i++)
|
|
||||||
if (connections[i].getAliasName().equals(remoteConnection))
|
|
||||||
break;
|
|
||||||
return connections[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void handleRemoteBrowseSelected() {
|
protected void handleRemoteBrowseSelected() {
|
||||||
IHost currentConnectionSelected = getCurrentConnection();
|
IHost currentConnectionSelected = getCurrentConnection();
|
||||||
|
@ -494,8 +488,7 @@ public class RemoteCMainTab extends CMainTab {
|
||||||
}
|
}
|
||||||
// already initialized
|
// already initialized
|
||||||
connectionCombo.removeAll();
|
connectionCombo.removeAll();
|
||||||
IHost[] connections = RSECorePlugin.getTheSystemRegistry()
|
IHost[] connections = RSEHelper.getSuitableConnections();
|
||||||
.getHostsBySubSystemConfigurationCategory("shells"); //$NON-NLS-1$
|
|
||||||
for (int i = 0; i < connections.length; i++) {
|
for (int i = 0; i < connections.length; i++) {
|
||||||
IRSESystemType sysType = connections[i].getSystemType();
|
IRSESystemType sysType = connections[i].getSystemType();
|
||||||
if (sysType != null && sysType.isEnabled()) {
|
if (sysType != null && sysType.isEnabled()) {
|
||||||
|
@ -609,6 +602,18 @@ public class RemoteCMainTab extends CMainTab {
|
||||||
}
|
}
|
||||||
if ((skipDownloadButton != null) && !skipDownloadButton.isDisposed()) {
|
if ((skipDownloadButton != null) && !skipDownloadButton.isDisposed()) {
|
||||||
skipDownloadButton.setSelection(getDefaultSkipDownload());
|
skipDownloadButton.setSelection(getDefaultSkipDownload());
|
||||||
|
if(RSEHelper.getFileSubsystem(getCurrentConnection()) == null){
|
||||||
|
skipDownloadButton.setEnabled(false);
|
||||||
|
} else {
|
||||||
|
skipDownloadButton.setEnabled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if((remoteBrowseButton!=null) && !remoteBrowseButton.isDisposed()){
|
||||||
|
if(RSEHelper.getFileSubsystem(getCurrentConnection()) == null){
|
||||||
|
remoteBrowseButton.setEnabled(false);
|
||||||
|
} else {
|
||||||
|
remoteBrowseButton.setEnabled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -644,6 +649,9 @@ public class RemoteCMainTab extends CMainTab {
|
||||||
private boolean getDefaultSkipDownload() {
|
private boolean getDefaultSkipDownload() {
|
||||||
IHost host = getCurrentConnection();
|
IHost host = getCurrentConnection();
|
||||||
if (host != null) {
|
if (host != null) {
|
||||||
|
if(RSEHelper.getFileSubsystem(host) == null){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
IPropertySet propertySet = host
|
IPropertySet propertySet = host
|
||||||
.getPropertySet(IRemoteConnectionHostConstants.PI_REMOTE_CDT);
|
.getPropertySet(IRemoteConnectionHostConstants.PI_REMOTE_CDT);
|
||||||
if (propertySet != null) {
|
if (propertySet != null) {
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
* Anna Dushistova (MontaVista) - [244173][remotecdt][nls] Externalize Strings in RemoteRunLaunchDelegate
|
* Anna Dushistova (MontaVista) - [244173][remotecdt][nls] Externalize Strings in RemoteRunLaunchDelegate
|
||||||
* Anna Dushistova (MontaVista) - [181517][usability] Specify commands to be run before remote application launch
|
* Anna Dushistova (MontaVista) - [181517][usability] Specify commands to be run before remote application launch
|
||||||
* Nikita Shulga (EmbeddedAlley) - [265236][remotecdt] Wait for RSE to initialize before querying it for host list
|
* Nikita Shulga (EmbeddedAlley) - [265236][remotecdt] Wait for RSE to initialize before querying it for host list
|
||||||
|
* Anna Dushistova (MontaVista) - [267951] [remotecdt] Support systemTypes without files subsystem
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.launch.remote;
|
package org.eclipse.cdt.launch.remote;
|
||||||
|
@ -37,7 +38,6 @@ import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
import org.eclipse.core.runtime.OperationCanceledException;
|
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
import org.eclipse.core.runtime.SubProgressMonitor;
|
import org.eclipse.core.runtime.SubProgressMonitor;
|
||||||
|
@ -50,20 +50,14 @@ import org.eclipse.debug.core.model.IProcess;
|
||||||
import org.eclipse.osgi.util.NLS;
|
import org.eclipse.osgi.util.NLS;
|
||||||
import org.eclipse.rse.core.RSECorePlugin;
|
import org.eclipse.rse.core.RSECorePlugin;
|
||||||
import org.eclipse.rse.core.model.IHost;
|
import org.eclipse.rse.core.model.IHost;
|
||||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
|
||||||
import org.eclipse.rse.services.IService;
|
|
||||||
import org.eclipse.rse.services.clientserver.messages.SystemOperationCancelledException;
|
import org.eclipse.rse.services.clientserver.messages.SystemOperationCancelledException;
|
||||||
import org.eclipse.rse.services.files.IFileService;
|
import org.eclipse.rse.services.files.IFileService;
|
||||||
import org.eclipse.rse.services.shells.HostShellProcessAdapter;
|
import org.eclipse.rse.services.shells.HostShellProcessAdapter;
|
||||||
import org.eclipse.rse.services.shells.IHostShell;
|
import org.eclipse.rse.services.shells.IHostShell;
|
||||||
import org.eclipse.rse.services.shells.IShellService;
|
import org.eclipse.rse.services.shells.IShellService;
|
||||||
import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem;
|
|
||||||
import org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem.IShellServiceSubSystem;
|
|
||||||
|
|
||||||
public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate {
|
public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate {
|
||||||
|
|
||||||
private final static String SHELL_SERVICE = "shell.service"; //$NON-NLS-1$
|
|
||||||
private final static String FILE_SERVICE = "file.service"; //$NON-NLS-1$
|
|
||||||
private final static String EXIT_CMD = "exit"; //$NON-NLS-1$
|
private final static String EXIT_CMD = "exit"; //$NON-NLS-1$
|
||||||
private final static String CMD_DELIMITER = ";"; //$NON-NLS-1$
|
private final static String CMD_DELIMITER = ";"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
@ -92,13 +86,15 @@ public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate {
|
||||||
if (monitor == null)
|
if (monitor == null)
|
||||||
monitor = new NullProgressMonitor();
|
monitor = new NullProgressMonitor();
|
||||||
|
|
||||||
if (!RSECorePlugin.isInitComplete(RSECorePlugin.INIT_MODEL)) {
|
if (!RSECorePlugin.isInitComplete(RSECorePlugin.INIT_MODEL)) {
|
||||||
monitor.subTask(Messages.RemoteRunLaunchDelegate_10);
|
monitor.subTask(Messages.RemoteRunLaunchDelegate_10);
|
||||||
try {
|
try {
|
||||||
RSECorePlugin.waitForInitCompletion(RSECorePlugin.INIT_MODEL);
|
RSECorePlugin
|
||||||
|
.waitForInitCompletion(RSECorePlugin.INIT_MODEL);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
throw new CoreException(new Status(IStatus.ERROR, getPluginID(),
|
throw new CoreException(new Status(IStatus.ERROR,
|
||||||
IStatus.OK, e.getLocalizedMessage(), e));
|
getPluginID(), IStatus.OK, e.getLocalizedMessage(),
|
||||||
|
e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mode.equals(ILaunchManager.DEBUG_MODE)) {
|
if (mode.equals(ILaunchManager.DEBUG_MODE)) {
|
||||||
|
@ -255,65 +251,13 @@ public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate {
|
||||||
String remoteConnection = config.getAttribute(
|
String remoteConnection = config.getAttribute(
|
||||||
IRemoteConnectionConfigurationConstants.ATTR_REMOTE_CONNECTION,
|
IRemoteConnectionConfigurationConstants.ATTR_REMOTE_CONNECTION,
|
||||||
""); //$NON-NLS-1$
|
""); //$NON-NLS-1$
|
||||||
|
IHost connection = RSEHelper
|
||||||
IHost[] connections = RSECorePlugin.getTheSystemRegistry().getHosts();
|
.getRemoteConnectionByName(remoteConnection);
|
||||||
int i = 0;
|
if (connection == null) {
|
||||||
for (i = 0; i < connections.length; i++)
|
|
||||||
if (connections[i].getAliasName().equals(remoteConnection))
|
|
||||||
break;
|
|
||||||
if (i >= connections.length) {
|
|
||||||
abort(Messages.RemoteRunLaunchDelegate_13, null,
|
abort(Messages.RemoteRunLaunchDelegate_13, null,
|
||||||
ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
|
ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
|
||||||
}
|
}
|
||||||
return connections[i];
|
return connection;
|
||||||
}
|
|
||||||
|
|
||||||
protected IService getConnectedRemoteService(ILaunchConfiguration config,
|
|
||||||
String kindOfService, IProgressMonitor monitor)
|
|
||||||
throws CoreException {
|
|
||||||
|
|
||||||
// Check that the service requested is file or shell.
|
|
||||||
if (!kindOfService.equals(SHELL_SERVICE)
|
|
||||||
&& !kindOfService.equals(FILE_SERVICE))
|
|
||||||
abort(Messages.RemoteRunLaunchDelegate_3, null,
|
|
||||||
ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
|
|
||||||
|
|
||||||
IHost currentConnection = getCurrentConnection(config);
|
|
||||||
|
|
||||||
ISubSystem[] subSystems = currentConnection.getSubSystems();
|
|
||||||
int i = 0;
|
|
||||||
for (i = 0; i < subSystems.length; i++) {
|
|
||||||
if (subSystems[i] instanceof IShellServiceSubSystem
|
|
||||||
&& kindOfService.equals(SHELL_SERVICE))
|
|
||||||
break;
|
|
||||||
if (subSystems[i] instanceof IFileServiceSubSystem
|
|
||||||
&& kindOfService.equals(FILE_SERVICE))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (i >= subSystems.length)
|
|
||||||
abort(Messages.RemoteRunLaunchDelegate_4, null,
|
|
||||||
ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
|
|
||||||
|
|
||||||
final ISubSystem subsystem = subSystems[i];
|
|
||||||
try {
|
|
||||||
subsystem.connect(monitor, false);
|
|
||||||
} catch (CoreException e) {
|
|
||||||
throw e;
|
|
||||||
} catch (OperationCanceledException e) {
|
|
||||||
throw new CoreException(Status.CANCEL_STATUS);
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new CoreException(new Status(IStatus.ERROR, getPluginID(),
|
|
||||||
IStatus.OK, e.getLocalizedMessage(), e));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!subsystem.isConnected())
|
|
||||||
abort(Messages.RemoteRunLaunchDelegate_5, null,
|
|
||||||
ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
|
|
||||||
|
|
||||||
if (kindOfService.equals(SHELL_SERVICE))
|
|
||||||
return ((IShellServiceSubSystem) subsystem).getShellService();
|
|
||||||
else
|
|
||||||
return ((IFileServiceSubSystem) subsystem).getFileService();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Process remoteFileDownload(ILaunchConfiguration config,
|
protected Process remoteFileDownload(ILaunchConfiguration config,
|
||||||
|
@ -329,11 +273,14 @@ public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate {
|
||||||
// Nothing to do. Download is skipped.
|
// Nothing to do. Download is skipped.
|
||||||
return null;
|
return null;
|
||||||
monitor.beginTask(Messages.RemoteRunLaunchDelegate_2, 100);
|
monitor.beginTask(Messages.RemoteRunLaunchDelegate_2, 100);
|
||||||
IFileService fileService = (IFileService) getConnectedRemoteService(
|
IFileService fileService;
|
||||||
config, FILE_SERVICE, new SubProgressMonitor(monitor, 10));
|
|
||||||
File file = new File(localExePath);
|
|
||||||
Path remotePath = new Path(remoteExePath);
|
|
||||||
try {
|
try {
|
||||||
|
fileService = (IFileService) RSEHelper
|
||||||
|
.getConnectedRemoteFileService(
|
||||||
|
getCurrentConnection(config),
|
||||||
|
new SubProgressMonitor(monitor, 10));
|
||||||
|
File file = new File(localExePath);
|
||||||
|
Path remotePath = new Path(remoteExePath);
|
||||||
fileService.upload(file, remotePath.removeLastSegments(1)
|
fileService.upload(file, remotePath.removeLastSegments(1)
|
||||||
.toString(), remotePath.lastSegment(), true, null, null,
|
.toString(), remotePath.lastSegment(), true, null, null,
|
||||||
new SubProgressMonitor(monitor, 85));
|
new SubProgressMonitor(monitor, 85));
|
||||||
|
@ -379,28 +326,37 @@ public class RemoteRunLaunchDelegate extends AbstractCLaunchDelegate {
|
||||||
if (!prelaunchCmd.trim().equals("")) //$NON-NLS-1$
|
if (!prelaunchCmd.trim().equals("")) //$NON-NLS-1$
|
||||||
remote_command = prelaunchCmd + CMD_DELIMITER + remote_command;
|
remote_command = prelaunchCmd + CMD_DELIMITER + remote_command;
|
||||||
|
|
||||||
IShellService shellService = (IShellService) getConnectedRemoteService(
|
IShellService shellService;
|
||||||
config, SHELL_SERVICE, new SubProgressMonitor(monitor, 7));
|
|
||||||
|
|
||||||
// This is necessary because runCommand does not actually run the
|
|
||||||
// command right now.
|
|
||||||
String env[] = new String[0];
|
|
||||||
Process p = null;
|
Process p = null;
|
||||||
try {
|
try {
|
||||||
IHostShell hostShell = shellService.launchShell(
|
shellService = (IShellService) RSEHelper
|
||||||
"", env, new SubProgressMonitor(monitor, 3)); //$NON-NLS-1$
|
.getConnectedRemoteShellService(
|
||||||
hostShell.writeToShell(remote_command);
|
getCurrentConnection(config),
|
||||||
p = new HostShellProcessAdapter(hostShell);
|
new SubProgressMonitor(monitor, 7));
|
||||||
} catch (Exception e) {
|
|
||||||
if (p != null) {
|
// This is necessary because runCommand does not actually run the
|
||||||
p.destroy();
|
// command right now.
|
||||||
|
String env[] = new String[0];
|
||||||
|
try {
|
||||||
|
IHostShell hostShell = shellService.launchShell(
|
||||||
|
"", env, new SubProgressMonitor(monitor, 3)); //$NON-NLS-1$
|
||||||
|
hostShell.writeToShell(remote_command);
|
||||||
|
p = new HostShellProcessAdapter(hostShell);
|
||||||
|
} catch (Exception e) {
|
||||||
|
if (p != null) {
|
||||||
|
p.destroy();
|
||||||
|
}
|
||||||
|
abort(Messages.RemoteRunLaunchDelegate_7, e,
|
||||||
|
ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
|
||||||
}
|
}
|
||||||
abort(Messages.RemoteRunLaunchDelegate_7, e,
|
} catch (Exception e1) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
abort(e1.getMessage(), e1,
|
||||||
ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
|
ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
monitor.done();
|
monitor.done();
|
||||||
return p;
|
return p;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String getPluginID() {
|
protected String getPluginID() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue