mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 14:12:10 +02:00
Bug 409890 - Launch is not terminated when an error occurs in
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>
This commit is contained in:
parent
2a97605918
commit
b93e00da7d
1 changed files with 33 additions and 4 deletions
|
@ -29,6 +29,7 @@ import org.eclipse.cdt.dsf.concurrent.ImmediateExecutor;
|
||||||
import org.eclipse.cdt.dsf.concurrent.ImmediateRequestMonitor;
|
import org.eclipse.cdt.dsf.concurrent.ImmediateRequestMonitor;
|
||||||
import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
|
import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
|
||||||
import org.eclipse.cdt.dsf.concurrent.Sequence;
|
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.ThreadSafe;
|
||||||
import org.eclipse.cdt.dsf.concurrent.ThreadSafeAndProhibitedFromDsfExecutor;
|
import org.eclipse.cdt.dsf.concurrent.ThreadSafeAndProhibitedFromDsfExecutor;
|
||||||
import org.eclipse.cdt.dsf.debug.model.DsfLaunch;
|
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
|
* Terminates the gdb session, shuts down the services, the session and
|
||||||
* this launch.
|
* the executor associated with this launch.
|
||||||
* <p>
|
* <p>
|
||||||
* Note: The argument request monitor to this method should NOT use the
|
* Note: The argument request monitor to this method should NOT use the
|
||||||
* executor that belongs to this launch. By the time the shutdown is
|
* executor that belongs to this launch. By the time the shutdown is
|
||||||
|
@ -238,7 +239,7 @@ public class GdbLaunch extends DsfLaunch
|
||||||
}
|
}
|
||||||
fShutDown = true;
|
fShutDown = true;
|
||||||
|
|
||||||
Sequence shutdownSeq = new ShutdownSequence(
|
final Sequence shutdownSeq = new ShutdownSequence(
|
||||||
getDsfExecutor(), fSession.getId(),
|
getDsfExecutor(), fSession.getId(),
|
||||||
new RequestMonitor(fSession.getExecutor(), rm) {
|
new RequestMonitor(fSession.getExecutor(), rm) {
|
||||||
@Override
|
@Override
|
||||||
|
@ -281,8 +282,36 @@ public class GdbLaunch extends DsfLaunch
|
||||||
rm.done();
|
rm.done();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
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(shutdownSeq);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
fExecutor.execute(new Sequence(fExecutor) {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Step[] getSteps() {
|
||||||
|
return steps;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Reference in a new issue