mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-10 03:53:21 +02:00
Bug 318550 - SteppingController should clear step queue in case of stepping timeout
This commit is contained in:
parent
b3c3920a84
commit
874bc5564a
1 changed files with 19 additions and 17 deletions
|
@ -506,7 +506,7 @@ public final class SteppingController {
|
||||||
*
|
*
|
||||||
* @param execCtx
|
* @param execCtx
|
||||||
*/
|
*/
|
||||||
private void enableStepping(final IExecutionDMContext execCtx) {
|
public void enableStepping(final IExecutionDMContext execCtx) {
|
||||||
fStepInProgress.remove(execCtx);
|
fStepInProgress.remove(execCtx);
|
||||||
for (IExecutionDMContext disabledCtx : fStepInProgress.keySet()) {
|
for (IExecutionDMContext disabledCtx : fStepInProgress.keySet()) {
|
||||||
if (DMContexts.isAncestorOf(disabledCtx, execCtx)) {
|
if (DMContexts.isAncestorOf(disabledCtx, execCtx)) {
|
||||||
|
@ -550,32 +550,41 @@ public final class SteppingController {
|
||||||
@DsfServiceEventHandler
|
@DsfServiceEventHandler
|
||||||
public void eventDispatched(final ISuspendedDMEvent e) {
|
public void eventDispatched(final ISuspendedDMEvent e) {
|
||||||
// Take care of the stepping time out
|
// Take care of the stepping time out
|
||||||
fTimedOutFlags.remove(e.getDMContext());
|
IExecutionDMContext dmc = e.getDMContext();
|
||||||
ScheduledFuture<?> future = fTimedOutFutures.remove(e.getDMContext());
|
boolean timedout = fTimedOutFlags.remove(dmc) == Boolean.TRUE;
|
||||||
|
ScheduledFuture<?> future = fTimedOutFutures.remove(dmc);
|
||||||
if (future != null) future.cancel(false);
|
if (future != null) future.cancel(false);
|
||||||
|
|
||||||
|
if (timedout || e.getReason() != StateChangeReason.STEP) {
|
||||||
|
// after step timeout or any other suspend reason do not process queued steps
|
||||||
|
fStepQueues.remove(dmc);
|
||||||
|
} else {
|
||||||
// Check if there's a step pending, if so execute it
|
// Check if there's a step pending, if so execute it
|
||||||
processStepQueue(e.getDMContext());
|
processStepQueue(dmc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@DsfServiceEventHandler
|
@DsfServiceEventHandler
|
||||||
public void eventDispatched(final IResumedDMEvent e) {
|
public void eventDispatched(final IResumedDMEvent e) {
|
||||||
if (e.getReason().equals(StateChangeReason.STEP)) {
|
if (e.getReason().equals(StateChangeReason.STEP)) {
|
||||||
fTimedOutFlags.put(e.getDMContext(), Boolean.FALSE);
|
final IExecutionDMContext dmc = e.getDMContext();
|
||||||
|
fTimedOutFlags.put(dmc, Boolean.FALSE);
|
||||||
// We shouldn't have a stepping timeout running unless we get two
|
// We shouldn't have a stepping timeout running unless we get two
|
||||||
// stepping events in a row without a suspended, which would be a
|
// stepping events in a row without a suspended, which would be a
|
||||||
// protocol error.
|
// protocol error.
|
||||||
assert !fTimedOutFutures.containsKey(e.getDMContext());
|
assert !fTimedOutFutures.containsKey(dmc);
|
||||||
fTimedOutFutures.put(
|
fTimedOutFutures.put(
|
||||||
e.getDMContext(),
|
dmc,
|
||||||
getExecutor().schedule(
|
getExecutor().schedule(
|
||||||
new DsfRunnable() { public void run() {
|
new DsfRunnable() { public void run() {
|
||||||
fTimedOutFutures.remove(e.getDMContext());
|
fTimedOutFutures.remove(dmc);
|
||||||
|
|
||||||
if (getSession().isActive()) {
|
if (getSession().isActive()) {
|
||||||
|
fTimedOutFlags.put(dmc, Boolean.TRUE);
|
||||||
|
enableStepping(dmc);
|
||||||
// Issue the stepping time-out event.
|
// Issue the stepping time-out event.
|
||||||
getSession().dispatchEvent(
|
getSession().dispatchEvent(
|
||||||
new SteppingTimedOutEvent(e.getDMContext()),
|
new SteppingTimedOutEvent(dmc),
|
||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
|
@ -584,11 +593,4 @@ public final class SteppingController {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@DsfServiceEventHandler
|
|
||||||
public void eventDispatched(SteppingTimedOutEvent e) {
|
|
||||||
fTimedOutFlags.put(e.getDMContext(), Boolean.TRUE);
|
|
||||||
enableStepping(e.getDMContext());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue