From 624a55093f188f01321eb2151923799cb4489d9f Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Fri, 13 May 2011 11:13:02 +0000 Subject: [PATCH] Bug 343862: Infinite assertions when an error happens when setting breakpoints --- .../cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java | 11 ++++++++++- .../org/eclipse/cdt/dsf/mi/service/MIRunControl.java | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) 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) {