Lines 13-18
Link Here
|
13 |
* Anna Dushistova (MontaVista) - [234490][remotecdt] Launching with disconnected target fails |
13 |
* Anna Dushistova (MontaVista) - [234490][remotecdt] Launching with disconnected target fails |
14 |
* Anna Dushistova (MontaVista) - [235298][remotecdt] Further improve progress reporting and cancellation of Remote CDT Launch |
14 |
* Anna Dushistova (MontaVista) - [235298][remotecdt] Further improve progress reporting and cancellation of Remote CDT Launch |
15 |
* Anna Dushistova (MontaVista) - [244173][remotecdt][nls] Externalize Strings in RemoteRunLaunchDelegate |
15 |
* Anna Dushistova (MontaVista) - [244173][remotecdt][nls] Externalize Strings in RemoteRunLaunchDelegate |
|
|
16 |
* Anna Dushistova (MontaVista) - [181517][usability] Specify commands to be run before remote application launch |
16 |
*******************************************************************************/ |
17 |
*******************************************************************************/ |
17 |
|
18 |
|
18 |
|
19 |
|
Lines 82-87
Link Here
|
82 |
|
83 |
|
83 |
String arguments = getProgramArguments(config); |
84 |
String arguments = getProgramArguments(config); |
84 |
String remoteExePath = config.getAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH, ""); //$NON-NLS-1$ |
85 |
String remoteExePath = config.getAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH, ""); //$NON-NLS-1$ |
|
|
86 |
String prelaunchCmd = config.getAttribute(IRemoteConnectionConfigurationConstants.ATTR_PRERUN_COMMANDS, ""); //$NON-NLS-1$ |
85 |
|
87 |
|
86 |
if(monitor==null) |
88 |
if(monitor==null) |
87 |
monitor = new NullProgressMonitor(); |
89 |
monitor = new NullProgressMonitor(); |
Lines 111-117
Link Here
|
111 |
if(arguments != null && !arguments.equals("")) //$NON-NLS-1$ |
113 |
if(arguments != null && !arguments.equals("")) //$NON-NLS-1$ |
112 |
command_arguments += " " + arguments; //$NON-NLS-1$ |
114 |
command_arguments += " " + arguments; //$NON-NLS-1$ |
113 |
monitor.setTaskName(Messages.RemoteRunLaunchDelegate_9); |
115 |
monitor.setTaskName(Messages.RemoteRunLaunchDelegate_9); |
114 |
remoteShellProcess = remoteShellExec(config, gdbserver_command, |
116 |
remoteShellProcess = remoteShellExec(config, prelaunchCmd,gdbserver_command, |
115 |
command_arguments, new SubProgressMonitor(monitor, 5)); |
117 |
command_arguments, new SubProgressMonitor(monitor, 5)); |
116 |
DebugPlugin.newProcess(launch, remoteShellProcess, Messages.RemoteRunLaunchDelegate_RemoteShell); |
118 |
DebugPlugin.newProcess(launch, remoteShellProcess, Messages.RemoteRunLaunchDelegate_RemoteShell); |
117 |
|
119 |
|
Lines 174-184
Link Here
|
174 |
remoteFileDownload(config, launch, exePath.toString(),remoteExePath, new SubProgressMonitor(monitor,80)); |
176 |
remoteFileDownload(config, launch, exePath.toString(),remoteExePath, new SubProgressMonitor(monitor,80)); |
175 |
// Use a remote shell to launch the binary. |
177 |
// Use a remote shell to launch the binary. |
176 |
monitor.setTaskName(Messages.RemoteRunLaunchDelegate_12); |
178 |
monitor.setTaskName(Messages.RemoteRunLaunchDelegate_12); |
177 |
remoteProcess = remoteShellExec(config, remoteExePath, arguments, new SubProgressMonitor(monitor,20)); |
179 |
remoteProcess = remoteShellExec(config, prelaunchCmd, remoteExePath, arguments, new SubProgressMonitor(monitor,20)); |
178 |
DebugPlugin.newProcess(launch, remoteProcess, renderProcessLabel(exePath.toOSString())); |
180 |
DebugPlugin.newProcess(launch, remoteProcess, renderProcessLabel(exePath.toOSString())); |
179 |
} catch (CoreException e) { |
181 |
} catch (CoreException e) { |
180 |
if(remoteProcess != null) |
|
|
181 |
remoteProcess.destroy(); |
182 |
throw e; |
182 |
throw e; |
183 |
} finally { |
183 |
} finally { |
184 |
monitor.done(); |
184 |
monitor.done(); |
Lines 270-276
Link Here
|
270 |
fileService.upload(file, remotePath.removeLastSegments(1).toString(), remotePath.lastSegment(), |
270 |
fileService.upload(file, remotePath.removeLastSegments(1).toString(), remotePath.lastSegment(), |
271 |
true, null, null, new SubProgressMonitor(monitor, 85)); |
271 |
true, null, null, new SubProgressMonitor(monitor, 85)); |
272 |
// Need to change the permissions to match the original file permissions because of a bug in upload |
272 |
// Need to change the permissions to match the original file permissions because of a bug in upload |
273 |
Process p = remoteShellExec(config, "chmod", "+x " + spaceEscapify(remotePath.toString()), new SubProgressMonitor(monitor, 5)); //$NON-NLS-1$ //$NON-NLS-2$ |
273 |
Process p = remoteShellExec(config,"", "chmod", "+x " + spaceEscapify(remotePath.toString()), new SubProgressMonitor(monitor, 5)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
274 |
Thread.sleep(500); |
274 |
Thread.sleep(500); |
275 |
p.destroy(); |
275 |
p.destroy(); |
276 |
} catch (SystemOperationCancelledException e) { |
276 |
} catch (SystemOperationCancelledException e) { |
Lines 288-294
Link Here
|
288 |
return currentConnection.getHostName(); |
288 |
return currentConnection.getHostName(); |
289 |
} |
289 |
} |
290 |
|
290 |
|
291 |
protected Process remoteShellExec(ILaunchConfiguration config, String remoteCommandPath, |
291 |
protected Process remoteShellExec(ILaunchConfiguration config, String prelaunchCmd, String remoteCommandPath, |
292 |
String arguments, IProgressMonitor monitor) throws CoreException { |
292 |
String arguments, IProgressMonitor monitor) throws CoreException { |
293 |
// The exit command is called to force the remote shell to close after our command |
293 |
// The exit command is called to force the remote shell to close after our command |
294 |
// is executed. This is to prevent a running process at the end of the debug session. |
294 |
// is executed. This is to prevent a running process at the end of the debug session. |
Lines 296-303
Link Here
|
296 |
monitor.beginTask(NLS.bind(Messages.RemoteRunLaunchDelegate_8, remoteCommandPath,arguments), 10); |
296 |
monitor.beginTask(NLS.bind(Messages.RemoteRunLaunchDelegate_8, remoteCommandPath,arguments), 10); |
297 |
String real_remote_command = arguments == null ? spaceEscapify(remoteCommandPath) : |
297 |
String real_remote_command = arguments == null ? spaceEscapify(remoteCommandPath) : |
298 |
spaceEscapify(remoteCommandPath) + " " + arguments; //$NON-NLS-1$ |
298 |
spaceEscapify(remoteCommandPath) + " " + arguments; //$NON-NLS-1$ |
|
|
299 |
|
299 |
String remote_command = real_remote_command + CMD_DELIMITER + EXIT_CMD; |
300 |
String remote_command = real_remote_command + CMD_DELIMITER + EXIT_CMD; |
300 |
|
301 |
|
|
|
302 |
if(!prelaunchCmd.trim().equals("")) //$NON-NLS-1$ |
303 |
remote_command = prelaunchCmd + CMD_DELIMITER + remote_command; |
301 |
|
304 |
|
302 |
IShellService shellService = (IShellService) getConnectedRemoteService(config, SHELL_SERVICE, new SubProgressMonitor(monitor,7)); |
305 |
IShellService shellService = (IShellService) getConnectedRemoteService(config, SHELL_SERVICE, new SubProgressMonitor(monitor,7)); |
303 |
|
306 |
|