1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 358754: NPE in MIBreakpointsManager

This commit is contained in:
Marc Khouzam 2011-10-19 15:53:31 -04:00
parent 1a8212ca62
commit bc856eeea5

View file

@ -1447,9 +1447,6 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
*/ */
private void clearBreakpointStatus(final ICBreakpoint[] bps, final IBreakpointsTargetDMContext ctx) private void clearBreakpointStatus(final ICBreakpoint[] bps, final IBreakpointsTargetDMContext ctx)
{ {
new Job("Clear Breakpoints Status") { //$NON-NLS-1$
@Override
protected IStatus run(IProgressMonitor monitor) {
IWorkspaceRunnable wr = new IWorkspaceRunnable() { IWorkspaceRunnable wr = new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException { public void run(IProgressMonitor monitor) throws CoreException {
// For every platform breakpoint that has at least one target breakpoint installed // For every platform breakpoint that has at least one target breakpoint installed
@ -1466,17 +1463,6 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
} }
}; };
// First clear any problem markers
for (IMarker marker : fBreakpointMarkerProblems.values()) {
if (marker != null) {
try {
marker.delete();
} catch (CoreException e) {
}
}
}
fBreakpointMarkerProblems.clear();
// Create the scheduling rule to clear all bp planted. // Create the scheduling rule to clear all bp planted.
ISchedulingRule rule = null; ISchedulingRule rule = null;
List<ISchedulingRule> markerRules = new ArrayList<ISchedulingRule>(); List<ISchedulingRule> markerRules = new ArrayList<ISchedulingRule>();
@ -1499,10 +1485,27 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
} }
try { try {
// Will run the workspace runnable on the current thread, which
// is the DSF executor.
ResourcesPlugin.getWorkspace().run(wr, rule, 0, null); ResourcesPlugin.getWorkspace().run(wr, rule, 0, null);
} catch (CoreException e) { } catch (CoreException e) {
return e.getStatus(); GdbPlugin.getDefault().getLog().log(e.getStatus());
} }
new Job("Clear Breakpoints Status") { //$NON-NLS-1$
@Override
protected IStatus run(IProgressMonitor monitor) {
// Clear any problem markers
for (IMarker marker : fBreakpointMarkerProblems.values()) {
if (marker != null) {
try {
marker.delete();
} catch (CoreException e) {
}
}
}
fBreakpointMarkerProblems.clear();
return Status.OK_STATUS; return Status.OK_STATUS;
} }
}.schedule(); }.schedule();