View | Details | Raw Unified | Return to bug 235298
Collapse All | Expand All

(-)src/org/eclipse/rse/internal/remotecdt/RemoteRunLaunchDelegate.java (-2 / +10 lines)
Lines 11-16 Link Here
11
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
11
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
12
 * Martin Oberhuber (Wind River) - [226301][api] IShellService should throw SystemMessageException on error
12
 * Martin Oberhuber (Wind River) - [226301][api] IShellService should throw SystemMessageException on error
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
 *******************************************************************************/
15
 *******************************************************************************/
15
16
16
17
Lines 49-54 Link Here
49
import org.eclipse.rse.core.model.IHost;
50
import org.eclipse.rse.core.model.IHost;
50
import org.eclipse.rse.core.subsystems.ISubSystem;
51
import org.eclipse.rse.core.subsystems.ISubSystem;
51
import org.eclipse.rse.services.IService;
52
import org.eclipse.rse.services.IService;
53
import org.eclipse.rse.services.clientserver.messages.SystemOperationCancelledException;
52
import org.eclipse.rse.services.files.IFileService;
54
import org.eclipse.rse.services.files.IFileService;
53
import org.eclipse.rse.services.shells.HostShellProcessAdapter;
55
import org.eclipse.rse.services.shells.HostShellProcessAdapter;
54
import org.eclipse.rse.services.shells.IHostShell;
56
import org.eclipse.rse.services.shells.IHostShell;
Lines 94-99 Link Here
94
				ICDISession dsession = null;
96
				ICDISession dsession = null;
95
				try {
97
				try {
96
					// Download the binary to the remote before debugging.
98
					// Download the binary to the remote before debugging.
99
					monitor.setTaskName("Downloading"); //$NON-NLS-1$
97
					remoteFileDownload(config, launch, exePath.toString(), remoteExePath, new SubProgressMonitor(monitor, 80));
100
					remoteFileDownload(config, launch, exePath.toString(), remoteExePath, new SubProgressMonitor(monitor, 80));
98
101
99
					// Automatically start up the gdbserver.  In the future this should be expanded to launch
102
					// Automatically start up the gdbserver.  In the future this should be expanded to launch
Lines 106-111 Link Here
106
												+ spaceEscapify(remoteExePath);
109
												+ spaceEscapify(remoteExePath);
107
					if(arguments != null && !arguments.equals("")) //$NON-NLS-1$
110
					if(arguments != null && !arguments.equals("")) //$NON-NLS-1$
108
						command_arguments += " " + arguments; //$NON-NLS-1$
111
						command_arguments += " " + arguments; //$NON-NLS-1$
112
					monitor.setTaskName("Launching"); //$NON-NLS-1$
109
					remoteShellProcess = remoteShellExec(config, gdbserver_command,
113
					remoteShellProcess = remoteShellExec(config, gdbserver_command,
110
														 command_arguments, new SubProgressMonitor(monitor, 5));
114
														 command_arguments, new SubProgressMonitor(monitor, 5));
111
					DebugPlugin.newProcess(launch, remoteShellProcess, Messages.RemoteRunLaunchDelegate_RemoteShell);
115
					DebugPlugin.newProcess(launch, remoteShellProcess, Messages.RemoteRunLaunchDelegate_RemoteShell);
Lines 165-172 Link Here
165
			Process remoteProcess = null;
169
			Process remoteProcess = null;
166
			try {
170
			try {
167
				// Download the binary to the remote before debugging.
171
				// Download the binary to the remote before debugging.
172
				monitor.setTaskName("Downloading"); //$NON-NLS-1$
168
				remoteFileDownload(config, launch, exePath.toString(),remoteExePath, new SubProgressMonitor(monitor,80));
173
				remoteFileDownload(config, launch, exePath.toString(),remoteExePath, new SubProgressMonitor(monitor,80));
169
				// Use a remote shell to launch the binary.
174
				// Use a remote shell to launch the binary.
175
				monitor.setTaskName("Launching"); //$NON-NLS-1$
170
				remoteProcess = remoteShellExec(config, remoteExePath, arguments, new SubProgressMonitor(monitor,20));
176
				remoteProcess = remoteShellExec(config, remoteExePath, arguments, new SubProgressMonitor(monitor,20));
171
				DebugPlugin.newProcess(launch, remoteProcess, renderProcessLabel(exePath.toOSString()));
177
				DebugPlugin.newProcess(launch, remoteProcess, renderProcessLabel(exePath.toOSString()));
172
			} catch (CoreException e) {
178
			} catch (CoreException e) {
Lines 266-271 Link Here
266
			Process p = remoteShellExec(config, "chmod", "+x " + spaceEscapify(remotePath.toString()), new SubProgressMonitor(monitor, 5)); //$NON-NLS-1$ //$NON-NLS-2$
272
			Process p = remoteShellExec(config, "chmod", "+x " + spaceEscapify(remotePath.toString()), new SubProgressMonitor(monitor, 5)); //$NON-NLS-1$ //$NON-NLS-2$
267
			Thread.sleep(500);
273
			Thread.sleep(500);
268
			p.destroy();
274
			p.destroy();
275
		} catch (SystemOperationCancelledException e) {
276
			cancel(e.getLocalizedMessage(), IStatus.CANCEL);
269
		} catch (Exception e) {
277
		} catch (Exception e) {
270
			abort(Messages.RemoteRunLaunchDelegate_6, e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR );
278
			abort(Messages.RemoteRunLaunchDelegate_6, e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR );
271
		} finally {
279
		} finally {
Lines 289-301 Link Here
289
		String remote_command = real_remote_command + CMD_DELIMITER + EXIT_CMD;
297
		String remote_command = real_remote_command + CMD_DELIMITER + EXIT_CMD;
290
298
291
		
299
		
292
		IShellService shellService = (IShellService) getConnectedRemoteService(config, SHELL_SERVICE, monitor);
300
		IShellService shellService = (IShellService) getConnectedRemoteService(config, SHELL_SERVICE, new SubProgressMonitor(monitor,7));
293
301
294
		// This is necessary because runCommand does not actually run the command right now.
302
		// This is necessary because runCommand does not actually run the command right now.
295
		String env[] = new String[0];
303
		String env[] = new String[0];
296
		Process p = null;
304
		Process p = null;
297
		try {
305
		try {
298
			IHostShell hostShell = shellService.launchShell("", env, new NullProgressMonitor()); //$NON-NLS-1$
306
			IHostShell hostShell = shellService.launchShell("", env, new SubProgressMonitor(monitor,3)); //$NON-NLS-1$
299
			hostShell.writeToShell(remote_command);
307
			hostShell.writeToShell(remote_command);
300
			p = new HostShellProcessAdapter(hostShell);
308
			p = new HostShellProcessAdapter(hostShell);
301
		} catch (Exception e) {
309
		} catch (Exception e) {

Return to bug 235298