summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleem Rehman2013-06-12 13:32:46 (EDT)
committerMikhail Khodjaiants2013-06-17 14:38:37 (EDT)
commitb93e00da7dc453bdf07321d6eea064f48d12341e (patch)
tree7ab9dba8104981f8310f609f91c0a6e06f7cff63
parent2a976059185b0b008919a96a18b45a269662d17a (diff)
downloadorg.eclipse.cdt-b93e00da7dc453bdf07321d6eea064f48d12341e.zip
org.eclipse.cdt-b93e00da7dc453bdf07321d6eea064f48d12341e.tar.gz
org.eclipse.cdt-b93e00da7dc453bdf07321d6eea064f48d12341e.tar.bz2
Bug 409890 - Launch is not terminated when an error occurs inrefs/changes/53/13753/3
FinalLaunchSequence Change-Id: I96e8c377ffefa87bd6ab71d01965a255f9ebce11 Reviewed-on: https://git.eclipse.org/r/13753 Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com> IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com> Tested-by: Marc Khouzam <marc.khouzam@ericsson.com> Reviewed-by: Mikhail Khodjaiants <mikhailkhod@googlemail.com> IP-Clean: Mikhail Khodjaiants <mikhailkhod@googlemail.com> Tested-by: Mikhail Khodjaiants <mikhailkhod@googlemail.com>
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java37
1 files changed, 33 insertions, 4 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java
index efaa5bd..175d36c 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java
@@ -29,6 +29,7 @@ import org.eclipse.cdt.dsf.concurrent.ImmediateExecutor;
import org.eclipse.cdt.dsf.concurrent.ImmediateRequestMonitor;
import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
import org.eclipse.cdt.dsf.concurrent.Sequence;
+import org.eclipse.cdt.dsf.concurrent.Sequence.Step;
import org.eclipse.cdt.dsf.concurrent.ThreadSafe;
import org.eclipse.cdt.dsf.concurrent.ThreadSafeAndProhibitedFromDsfExecutor;
import org.eclipse.cdt.dsf.debug.model.DsfLaunch;
@@ -219,8 +220,8 @@ public class GdbLaunch extends DsfLaunch
///////////////////////////////////////////////////////////////////////////
/**
- * Shuts down the services, the session and the executor associated with
- * this launch.
+ * Terminates the gdb session, shuts down the services, the session and
+ * the executor associated with this launch.
* <p>
* Note: The argument request monitor to this method should NOT use the
* executor that belongs to this launch. By the time the shutdown is
@@ -238,7 +239,7 @@ public class GdbLaunch extends DsfLaunch
}
fShutDown = true;
- Sequence shutdownSeq = new ShutdownSequence(
+ final Sequence shutdownSeq = new ShutdownSequence(
getDsfExecutor(), fSession.getId(),
new RequestMonitor(fSession.getExecutor(), rm) {
@Override
@@ -281,7 +282,35 @@ public class GdbLaunch extends DsfLaunch
rm.done();
}
});
- fExecutor.execute(shutdownSeq);
+
+ final Step[] steps = new Step[] {
+ new Step() {
+ @Override
+ public void execute(RequestMonitor rm) {
+ IGDBControl control = fTracker.getService(IGDBControl.class);
+ if (control == null) {
+ rm.done();
+ return;
+ }
+ control.terminate(rm);
+ }
+ },
+
+ new Step() {
+ @Override
+ public void execute(RequestMonitor rm) {
+ fExecutor.execute(shutdownSeq);
+ }
+ }
+ };
+
+ fExecutor.execute(new Sequence(fExecutor) {
+
+ @Override
+ public Step[] getSteps() {
+ return steps;
+ }
+ });
}
@SuppressWarnings("rawtypes")