diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java index 8e088897ef4..c4941601740 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java @@ -1136,7 +1136,7 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService implements IMIRunCo // another request that we now need to process RequestMonitor sequenceCompletedRm = new RequestMonitor(getExecutor(), null) { @Override - protected void handleCompleted() { + protected void handleSuccess() { fOngoingOperation = false; if (fOperationsPending.size() > 0) { @@ -1147,6 +1147,15 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService implements IMIRunCo } // no other rm.done() needs to be called, they have all been handled already } + @Override + protected void handleFailure() { + // If the sequence failed, we have to give up on the operation(s). + // If we don't, we risk an infinite loop where we try, over and over + // to perform an operation that keeps on failing. + fOngoingOperation = false; + fOperationsPending.clear(); + super.handleFailure(); + } }; getExecutor().execute(new Sequence(getExecutor(), sequenceCompletedRm) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRunControl.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRunControl.java index d1cc321f984..cff1b912c76 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRunControl.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRunControl.java @@ -1139,7 +1139,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I // another request that we now need to process RequestMonitor sequenceCompletedRm = new RequestMonitor(getExecutor(), null) { @Override - protected void handleCompleted() { + protected void handleSuccess() { fOngoingOperation = false; if (fOperationsPending.size() > 0) { @@ -1150,6 +1150,15 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I } // no other rm.done() needs to be called, they have all been handled already } + @Override + protected void handleFailure() { + // If the sequence failed, we have to give up on the operation(s). + // If we don't, we risk an infinite loop where we try, over and over + // to perform an operation that keeps on failing. + fOngoingOperation = false; + fOperationsPending.clear(); + super.handleFailure(); + } }; getExecutor().execute(new Sequence(getExecutor(), sequenceCompletedRm) {