From a9a60065f6312ab52975fecf0f943922f6cd0d79 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Wed, 4 May 2011 00:34:43 +0000 Subject: [PATCH] Bug 344635: Installed decorator no longer appears after an inferior runs to completion --- .../dsf/mi/service/MIBreakpointsManager.java | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java index 1c45278c385..3b3f673684e 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java @@ -736,16 +736,6 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo // Update the mappings platformBPs.remove(breakpoint); threadsIDs.remove(breakpoint); - - Vector contexts = breakpointIDs.get(breakpoint); - if (contexts != null) { - for (IBreakpointDMContext context : contexts) - targetBPs.remove(context); - } - - breakpointIDs.get(breakpoint).clear(); - breakpointIDs.remove(breakpoint); - fPendingRequests.remove(breakpoint); rm.done(); @@ -753,10 +743,14 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo }; // Remove the back-end breakpoints - Vector list = breakpointIDs.get(breakpoint); + // Remove the entry from the breakpointIDs map right away to indicate that we have already + // taken care of this breakpoint. This avoids race conditions with the shutdown + // which would also try to decrement the install count (bug 344635) + Vector list = breakpointIDs.remove(breakpoint); int count = 0; - if (list != null) { + if (list != null) { for (final IBreakpointDMContext bp : list) { + targetBPs.remove(bp); decrementInstallCount(bp, breakpoint, new RequestMonitor(getExecutor(), removeRM) { @Override protected void handleCompleted() { @@ -765,6 +759,7 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo }); } count = list.size(); + list.clear(); // probably not necessary } removeRM.setDoneCount(count); }