Skip to main content
summaryrefslogtreecommitdiffstats
path: root/cross
diff options
context:
space:
mode:
authorMarc Khouzam2011-05-26 13:13:30 -0400
committerMarc Khouzam2011-05-26 13:13:30 -0400
commitac5e2040b0b757922155a0b55dabe1207b43395e (patch)
tree31bb25c2e1f69745e16ae058f56c33fe790e582f /cross
parent908bfad797f6b16bf41a055ef4a04fbd89e79f10 (diff)
downloadorg.eclipse.cdt-ac5e2040b0b757922155a0b55dabe1207b43395e.tar.gz
org.eclipse.cdt-ac5e2040b0b757922155a0b55dabe1207b43395e.tar.xz
org.eclipse.cdt-ac5e2040b0b757922155a0b55dabe1207b43395e.zip
Bug 320839 - If gdb cannot be started for some reason, gdbserver doesn't get killed on target.
Diffstat (limited to 'cross')
-rw-r--r--cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteGdbLaunchDelegate.java21
1 files changed, 16 insertions, 5 deletions
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 029b478fc7..b57b929960 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Mentor Graphics Corporation and others.
+ * Copyright (c) 2010, 2011 Mentor Graphics Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.launch.remote.launching;
-import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants;
import org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate;
@@ -49,6 +48,7 @@ public class RemoteGdbLaunchDelegate extends GdbLaunchDelegate {
}
IPath exePath = checkBinaryDetails(config);
+ Process remoteShellProcess = null;
if (exePath != null) {
// 1.Download binary if needed
String remoteExePath = config.getAttribute(
@@ -77,7 +77,7 @@ public class RemoteGdbLaunchDelegate extends GdbLaunchDelegate {
if (arguments != null && !arguments.equals("")) //$NON-NLS-1$
commandArguments += " " + arguments; //$NON-NLS-1$
monitor.setTaskName(Messages.RemoteRunLaunchDelegate_9);
- Process remoteShellProcess = RSEHelper.remoteShellExec(config,
+ remoteShellProcess = RSEHelper.remoteShellExec(config,
prelaunchCmd, gdbserverCommand, commandArguments,
new SubProgressMonitor(monitor, 5));
@@ -96,8 +96,19 @@ public class RemoteGdbLaunchDelegate extends GdbLaunchDelegate {
wc.doSave();
}
-
- super.launch(config, mode, launch, monitor);
+ try{
+ super.launch(config, mode, launch, monitor);
+ } catch(CoreException ex) {
+ //launch failed, need to kill gdbserver
+ if (remoteShellProcess != null) {
+ remoteShellProcess.destroy();
+ }
+
+ //report failure further
+ throw ex;
+ } finally {
+ monitor.done();
+ }
}
protected String getProgramArguments(ILaunchConfiguration config)

Back to the top