mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-11 18:25:40 +02:00
Bug 403166 - [breakpoints] Breakpoint message is not updated when
changing line number Change-Id: I3f28365acdc638e1c1007a0e916fec5edcf686f5 Reviewed-on: https://git.eclipse.org/r/11175 Reviewed-by: Pawel Piech <pawel.1.piech@gmail.com> Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com> IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com> Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
This commit is contained in:
parent
527d60717b
commit
17569f4581
1 changed files with 16 additions and 3 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue