Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2010-07-14 04:13:58 -0400
committerAnton Leherbauer2010-07-14 04:13:58 -0400
commit8b068f8b8f01b98a6ba70ddbf30507762175fcf9 (patch)
treed85b27d64519cbaa1645c5e094e07e1e0ff79b64
parent629852887820dd9e65753835c6f27e236833e815 (diff)
downloadorg.eclipse.cdt-8b068f8b8f01b98a6ba70ddbf30507762175fcf9.tar.gz
org.eclipse.cdt-8b068f8b8f01b98a6ba70ddbf30507762175fcf9.tar.xz
org.eclipse.cdt-8b068f8b8f01b98a6ba70ddbf30507762175fcf9.zip
Bug 316905 - DebugMarkerAnnotationModel does not reliably remove annotations for removed breakpoints
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/DebugMarkerAnnotationModel.java40
1 files changed, 13 insertions, 27 deletions
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/DebugMarkerAnnotationModel.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/DebugMarkerAnnotationModel.java
index e7320912c2..8ca9512bc9 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/DebugMarkerAnnotationModel.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/DebugMarkerAnnotationModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 QNX Software Systems and others.
+ * Copyright (c) 2004, 2010 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,6 @@
package org.eclipse.cdt.debug.internal.ui;
import java.io.File;
-import org.eclipse.cdt.debug.core.CDIDebugModel;
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IMarkerDelta;
@@ -24,7 +23,7 @@ import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel;
public class DebugMarkerAnnotationModel extends AbstractMarkerAnnotationModel implements IBreakpointsListener {
- private File fFile;
+ private final File fFile;
public DebugMarkerAnnotationModel( File file ) {
super();
@@ -32,7 +31,7 @@ public class DebugMarkerAnnotationModel extends AbstractMarkerAnnotationModel im
}
protected IMarker[] retrieveMarkers() throws CoreException {
- IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints( CDIDebugModel.getPluginIdentifier() );
+ IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints();
IMarker[] markers = new IMarker[breakpoints.length];
for ( int i = 0; i < markers.length; ++i ) {
markers[i] = breakpoints[i].getMarker();
@@ -51,9 +50,10 @@ public class DebugMarkerAnnotationModel extends AbstractMarkerAnnotationModel im
}
protected boolean isAcceptable( IMarker marker ) {
- IBreakpoint b = DebugPlugin.getDefault().getBreakpointManager().getBreakpoint( marker );
- if ( b != null ) {
- return isAcceptable( b );
+ String handle = marker.getAttribute(ICBreakpoint.SOURCE_HANDLE, null);
+ if (handle != null) {
+ File file = new File( handle );
+ return file.equals( getFile() );
}
return false;
}
@@ -64,37 +64,23 @@ public class DebugMarkerAnnotationModel extends AbstractMarkerAnnotationModel im
public void breakpointsAdded( IBreakpoint[] breakpoints ) {
for ( int i = 0; i < breakpoints.length; ++i ) {
- if ( isAcceptable( breakpoints[i] ) ) {
- addMarkerAnnotation( breakpoints[i].getMarker() );
- fireModelChanged();
- }
+ addMarkerAnnotation( breakpoints[i].getMarker() );
}
+ fireModelChanged();
}
public void breakpointsRemoved( IBreakpoint[] breakpoints, IMarkerDelta[] deltas ) {
for ( int i = 0; i < breakpoints.length; ++i ) {
- if ( isAcceptable( breakpoints[i] ) ) {
- removeMarkerAnnotation( breakpoints[i].getMarker() );
- fireModelChanged();
- }
+ removeMarkerAnnotation( breakpoints[i].getMarker() );
}
+ fireModelChanged();
}
public void breakpointsChanged( IBreakpoint[] breakpoints, IMarkerDelta[] deltas ) {
for ( int i = 0; i < breakpoints.length; ++i ) {
- if ( isAcceptable( breakpoints[i] ) ) {
- modifyMarkerAnnotation( breakpoints[i].getMarker() );
- fireModelChanged();
- }
+ modifyMarkerAnnotation( breakpoints[i].getMarker() );
}
+ fireModelChanged();
}
- private boolean isAcceptable( IBreakpoint b ) {
- String handle = b.getMarker().getAttribute(ICBreakpoint.SOURCE_HANDLE, null);
- if (handle != null) {
- File file = new File( handle );
- return file.equals( getFile() );
- }
- return false;
- }
}

Back to the top