diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPreferenceStore.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPreferenceStore.java index 612bae3e6df..468898d3e8b 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPreferenceStore.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPreferenceStore.java @@ -23,6 +23,7 @@ import java.util.Set; import org.eclipse.cdt.debug.core.CDIDebugModel; import org.eclipse.cdt.debug.core.model.ICBreakpoint; +import org.eclipse.cdt.debug.core.model.ICBreakpoint2; import org.eclipse.cdt.debug.core.model.ICLineBreakpoint2; import org.eclipse.cdt.debug.core.model.ICTracepoint; import org.eclipse.core.resources.IMarker; @@ -141,14 +142,26 @@ public class CBreakpointPreferenceStore implements IPersistentPreferenceStore { breakpoint.setCondition( getString( ICBreakpoint.CONDITION ) ); } else if ( property.equals( IMarker.LINE_NUMBER ) ) { - // already workspace runnable, setting markers are safe - breakpoint.getMarker().setAttribute(IMarker.LINE_NUMBER, getInt(IMarker.LINE_NUMBER)); - breakpoint.getMarker().setAttribute(ICLineBreakpoint2.REQUESTED_LINE, getInt(IMarker.LINE_NUMBER)); + if (breakpoint instanceof ICLineBreakpoint2) { + // Must set the REQUESTED_LINE attribute first, or else the breakpoint + // message will be refreshed improperly + ((ICLineBreakpoint2)breakpoint).setRequestedLine(getInt(IMarker.LINE_NUMBER)); + ((ICLineBreakpoint2)breakpoint).setInstalledLineNumber(getInt(IMarker.LINE_NUMBER)); + } else { + // already workspace runnable, setting markers are safe + breakpoint.getMarker().setAttribute(IMarker.LINE_NUMBER, getInt(IMarker.LINE_NUMBER)); + breakpoint.getMarker().setAttribute(ICLineBreakpoint2.REQUESTED_LINE, getInt(IMarker.LINE_NUMBER)); + } } else { // this allow set attributes contributed by other plugins Object value = fProperties.get(property); if ( value != null ) { marker.setAttribute(property, value); + if (breakpoint instanceof ICBreakpoint2) { + // To be safe, refresh the breakpoint message as the property + // change might affect it. + ((ICBreakpoint2)breakpoint).refreshMessage(); + } } } }