EA-58590 - CME: XDebugSessionImpl.a

This commit is contained in:
Egor.Ushakov
2014-08-01 19:03:01 +04:00
parent 907799dc65
commit a670c58a7a
2 changed files with 13 additions and 9 deletions
@@ -91,7 +91,7 @@ public class XDebugSessionImpl implements XDebugSession {
private XDebugProcess myDebugProcess;
private final Map<XBreakpoint<?>, CustomizedBreakpointPresentation> myRegisteredBreakpoints =
new THashMap<XBreakpoint<?>, CustomizedBreakpointPresentation>();
private final Set<XBreakpoint<?>> myInactiveSlaveBreakpoints = new SmartHashSet<XBreakpoint<?>>();
private final Set<XBreakpoint<?>> myInactiveSlaveBreakpoints = Collections.synchronizedSet(new SmartHashSet<XBreakpoint<?>>());
private boolean myBreakpointsDisabled;
private final XDebuggerManagerImpl myDebuggerManager;
private MyBreakpointListener myBreakpointListener;
@@ -295,12 +295,15 @@ public class XDebugSessionImpl implements XDebugSession {
XBreakpointManagerImpl breakpointManager = myDebuggerManager.getBreakpointManager();
XDependentBreakpointManager dependentBreakpointManager = breakpointManager.getDependentBreakpointManager();
disableSlaveBreakpoints(dependentBreakpointManager);
processAllBreakpoints(true, false);
// listeners have to be applied before processing all existing breakpoints,
// otherwise we may not process breakpoints added during the processing
myBreakpointListener = new MyBreakpointListener();
breakpointManager.addBreakpointListener(myBreakpointListener);
myDependentBreakpointListener = new MyDependentBreakpointListener();
dependentBreakpointManager.addListener(myDependentBreakpointListener);
processAllBreakpoints(true, false);
}
@Override
@@ -240,14 +240,15 @@ public class XBreakpointManagerImpl implements XBreakpointManager, PersistentSta
@NotNull
public <B extends XBreakpoint<?>> Collection<? extends B> getBreakpoints(@NotNull final XBreakpointType<B,?> type) {
ApplicationManager.getApplication().assertReadAccessAllowed();
Collection<? extends XBreakpointBase<?,?,?>> breakpoints = myBreakpoints.get(type);
Collection<? extends B> regular = breakpoints != null ? Collections.unmodifiableCollection((Collection<? extends B>)breakpoints) : Collections.<B>emptyList();
final XBreakpointBase<?, ?, ?> defaultBreakpoint = myDefaultBreakpoints.get(type);
if (defaultBreakpoint == null) return regular;
List<B> result = new ArrayList<B>();
result.add((B)defaultBreakpoint);
result.addAll(regular);
B defaultBreakpoint = getDefaultBreakpoint(type);
if (defaultBreakpoint != null) {
result.add(defaultBreakpoint);
}
Collection<XBreakpointBase<?, ?, ?>> breakpoints = myBreakpoints.get(type);
if (breakpoints != null) {
result.addAll((Collection<? extends B>)breakpoints);
}
return result;
}