From b9255e88a54c84de5af5774cecb4bdad0373e5fa Mon Sep 17 00:00:00 2001 From: Scott Tepavich Date: Tue, 31 Jan 2012 21:21:26 -0800 Subject: [PATCH] Bug 360280 - [breakpoints] Reposition breakpoints when planted on invalid line --- .../eclipse/cdt/debug/core/CDIDebugModel.java | 19 ++ .../eclipse/cdt/debug/core/CDebugUtils.java | 18 +- .../cdt/debug/core/model/ICBreakpoint.java | 2 +- .../cdt/debug/core/model/ICBreakpoint2.java | 39 ++++ .../debug/core/model/ICLineBreakpoint2.java | 178 ++++++++++++++++++ .../breakpoints/AbstractLineBreakpoint.java | 115 ++++++++++- .../breakpoints/BreakpointMessages.properties | 2 + .../core/breakpoints/CAddressBreakpoint.java | 5 +- .../core/breakpoints/CAddressTracepoint.java | 2 +- .../core/breakpoints/CBreakpoint.java | 20 +- .../core/breakpoints/CFunctionBreakpoint.java | 7 +- .../core/breakpoints/CFunctionTracepoint.java | 2 +- .../core/breakpoints/CLineBreakpoint.java | 28 ++- .../core/breakpoints/CLineTracepoint.java | 117 +++++++++++- .../core/breakpoints/CWatchpoint.java | 6 +- .../CBreakpointPropertyPage.java | 11 +- 16 files changed, 532 insertions(+), 39 deletions(-) create mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICBreakpoint2.java create mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICLineBreakpoint2.java diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java index 1d445fade22..ea88c2b8ef5 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java @@ -33,6 +33,7 @@ import org.eclipse.cdt.debug.core.model.ICBreakpointType; import org.eclipse.cdt.debug.core.model.ICEventBreakpoint; import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint; import org.eclipse.cdt.debug.core.model.ICLineBreakpoint; +import org.eclipse.cdt.debug.core.model.ICLineBreakpoint2; import org.eclipse.cdt.debug.core.model.ICWatchpoint; import org.eclipse.cdt.debug.core.model.ICWatchpoint2; import org.eclipse.cdt.debug.internal.core.breakpoints.CAddressBreakpoint; @@ -269,6 +270,24 @@ public class CDIDebugModel { attributes.put( ICBreakpoint.CONDITION, condition ); attributes.put( ICBreakpoint.SOURCE_HANDLE, sourceHandle ); attributes.put( ICBreakpointType.TYPE, type ); + + // Added for source relocated breakpoints. + if (!attributes.containsKey(ICLineBreakpoint2.REQUESTED_SOURCE_HANDLE)) { + attributes.put( ICLineBreakpoint2.REQUESTED_SOURCE_HANDLE, sourceHandle ); + } + if (!attributes.containsKey( ICLineBreakpoint2.REQUESTED_LINE )) { + attributes.put( ICLineBreakpoint2.REQUESTED_LINE, new Integer( lineNumber )); + } + if (attributes.containsKey(IMarker.CHAR_START) && + !attributes.containsKey( ICLineBreakpoint2.REQUESTED_CHAR_START )) + { + attributes.put( ICLineBreakpoint2.REQUESTED_CHAR_START, attributes.get(IMarker.CHAR_START)); + } + if (attributes.containsKey(IMarker.CHAR_END) && + !attributes.containsKey( ICLineBreakpoint2.REQUESTED_CHAR_END )) + { + attributes.put( ICLineBreakpoint2.REQUESTED_CHAR_END, attributes.get(IMarker.CHAR_END)); + } } /** diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java index b70f911ef9e..b5795ec4946 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java @@ -396,7 +396,7 @@ public class CDebugUtils { int lineNumber = breakpoint.getLineNumber(); if (lineNumber > 0) { label.append(' '); - label.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.0"), new String[]{ Integer.toString(lineNumber) })); //$NON-NLS-1$ + label.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.0"), (Object[])new String[]{ Integer.toString(lineNumber) })); //$NON-NLS-1$ } return label; } @@ -404,7 +404,7 @@ public class CDebugUtils { protected static StringBuffer appendAddress(ICAddressBreakpoint breakpoint, StringBuffer label) throws CoreException { try { label.append(' '); - label.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.1"), new String[]{ breakpoint.getAddress() })); //$NON-NLS-1$ + label.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.1"), (Object[])new String[]{ breakpoint.getAddress() })); //$NON-NLS-1$ } catch (NumberFormatException e) { } return label; @@ -414,7 +414,7 @@ public class CDebugUtils { String function = breakpoint.getFunction(); if (function != null && function.trim().length() > 0) { label.append(' '); - label.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.2"), new String[]{ function.trim() })); //$NON-NLS-1$ + label.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.2"), (Object[])new String[]{ function.trim() })); //$NON-NLS-1$ } return label; } @@ -423,7 +423,7 @@ public class CDebugUtils { int ignoreCount = breakpoint.getIgnoreCount(); if (ignoreCount > 0) { label.append(' '); - label.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.3"), new String[]{ Integer.toString(ignoreCount) })); //$NON-NLS-1$ + label.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.3"), (Object[])new String[]{ Integer.toString(ignoreCount) })); //$NON-NLS-1$ } return label; } @@ -432,7 +432,7 @@ public class CDebugUtils { String condition = breakpoint.getCondition(); if (condition != null && condition.length() > 0) { buffer.append(' '); - buffer.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.4"), new String[] { condition })); //$NON-NLS-1$ + buffer.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.4"), (Object[])new String[] { condition })); //$NON-NLS-1$ } } @@ -440,7 +440,7 @@ public class CDebugUtils { String expression = watchpoint.getExpression(); if (expression != null && expression.length() > 0) { label.append(' '); - label.append(MessageFormat.format( DebugCoreMessages.getString("CDebugUtils.5"), new String[] { expression })); //$NON-NLS-1$ + label.append(MessageFormat.format( DebugCoreMessages.getString("CDebugUtils.5"), (Object[])new String[] { expression })); //$NON-NLS-1$ } } @@ -448,7 +448,7 @@ public class CDebugUtils { String memorySpace = watchpoint.getMemorySpace(); if (memorySpace != null && memorySpace.length() > 0) { label.append(' '); - label.append(MessageFormat.format( DebugCoreMessages.getString("CDebugUtils.6"), new String[] { memorySpace })); //$NON-NLS-1$ + label.append(MessageFormat.format( DebugCoreMessages.getString("CDebugUtils.6"), (Object[])new String[] { memorySpace })); //$NON-NLS-1$ } } @@ -456,7 +456,7 @@ public class CDebugUtils { String range = watchpoint.getRange().toString(); if (range.length() > 0 && !range.equals("0")) { //$NON-NLS-1$ label.append(' '); - label.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.7"), new String[]{ range })); //$NON-NLS-1$ + label.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.7"), (Object[])new String[]{ range })); //$NON-NLS-1$ } } @@ -489,7 +489,7 @@ public class CDebugUtils { if (typeString.length() > 0) { label.append(' '); label.append(MessageFormat.format( - DebugCoreMessages.getString("CDebugUtils.8"), new String[] { typeString })); //$NON-NLS-1$ + DebugCoreMessages.getString("CDebugUtils.8"), (Object[])new String[] { typeString })); //$NON-NLS-1$ } } return label; diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICBreakpoint.java index 41c463630a2..4d00e6c4528 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICBreakpoint.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICBreakpoint.java @@ -236,5 +236,5 @@ public interface ICBreakpoint extends IBreakpoint { * @return Extension instance. * @throws CoreException Throws exception in case the extension doesn't exist or cannot be initialized. */ - public ICBreakpointExtension getExtension(String debugModelId, Class extensionType) throws CoreException ; + public V getExtension(String debugModelId, Class extensionType) throws CoreException; } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICBreakpoint2.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICBreakpoint2.java new file mode 100644 index 00000000000..3e7acd6b207 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICBreakpoint2.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2012 Wind River 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.debug.core.model; + +import org.eclipse.core.runtime.CoreException; + +/** + * Extension that allows client to force breakpoint message to refresh. + * + * @since 7.2 + * @noimplement This interface is not intended to be implemented by clients. + * @noextend This interface is not intended to be extended by clients. + */ +public interface ICBreakpoint2 extends ICBreakpoint { + /** + * Refresh the marker message for the breakpoint. + *

+ * Many of breakpoint settings are backed by marker attributes and it is + * sometimes more convenient to modify those attributes in the marker + * directly rather than through accessor methods of the breakpoint. This + * method allows the client to force the breakpoint to refresh its + * {@link org.eclipse.core.resources.IMarker#MESSAGE} attribute to reflect + * its current attribute values. + *

+ * + * @throws CoreException if unable to access the property + * on this breakpoint's underlying marker + */ + public void refreshMessage() throws CoreException; + +} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICLineBreakpoint2.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICLineBreakpoint2.java new file mode 100644 index 00000000000..b2f67e2350c --- /dev/null +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICLineBreakpoint2.java @@ -0,0 +1,178 @@ +/******************************************************************************* + * Copyright (c) 2012 Wind River 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.debug.core.model; + +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.runtime.CoreException; + +/** + * Line breakpoint extension that allows a breakpoint to be relocated by a + * debugger to a valid source line. + *

Clients which can determine a valid source based on debuggers symbol + * information should call the various setInstalled... methods with + * the corrected location attributes. Note, there is no setInstalledSourceHandle, + * clients should call {@link ICBreakpoint#setSourceHandle(String)}. If multiple + * clients try to change the installed breakpoint location, the last call will + * take precedence. This way debuggers may update the location upon active debug + * context change.
+ * The original breakpoint location as configured by the user can always be + * retrieved using the getRequested... methods. + *

+ * @since 7.2 + * @noimplement This interface is not intended to be implemented by clients. + * @noextend This interface is not intended to be extended by clients. + */ +public interface ICLineBreakpoint2 extends ICLineBreakpoint, ICBreakpoint2 { + + /** + * Breakpoint attribute storing the original requested line for this breakpoint + * This attribute is a int. + */ + public static final String REQUESTED_LINE = "requestedLine"; //$NON-NLS-1$ + + /** + * Breakpoint attribute storing the original requested column for this breakpoint + * This attribute is a int. + */ + public static final String REQUESTED_CHAR_START = "requestedCharStart"; //$NON-NLS-1$ + + /** + * Breakpoint attribute storing the original requested column for this breakpoint + * This attribute is a int. + */ + public static final String REQUESTED_CHAR_END = "requestedCharEnd"; //$NON-NLS-1$ + + /** + * Breakpoint attribute storing the original requested file name this breakpoint + * is set in. + * This attribute is a String. + */ + public static final String REQUESTED_SOURCE_HANDLE = "requestedSourceHandle"; //$NON-NLS-1$ + + /** + * Returns the line number where the breakpoint was set before it was relocated to a + * valid source line. + * + * @return Returns the requested line number attribute. + * @exception CoreException if unable to access the property on this breakpoint's + * underlying marker + */ + public int getRequestedLine() throws CoreException; + + /** + * Sets the line number where the breakpoint should be set. + * + * @param The requested line number attribute. + * @exception CoreException if unable to access the property on this breakpoint's + * underlying marker + */ + public void setRequestedLine(int line) throws CoreException; + + /** + * Returns starting source index where the breakpoint was set before it + * was moved to a valid source location. + * + * @return Returns the requested start index attribute. + * @exception CoreException if unable to access the property on this breakpoint's + * underlying marker + */ + public int getRequestedCharStart() throws CoreException; + + + /** + * Sets the starting source index where the breakpoint should be set. + * + * @param The requested start index attribute. + * @exception CoreException if unable to access the property on this breakpoint's + * underlying marker + */ + public void setRequestedCharStart(int charStart) throws CoreException; + + /** + * Returns ending source index where the breakpoint was set before it + * was moved to a valid source location. + * + * @return Returns the requested end index attribute. + * @exception CoreException if unable to access the property on this breakpoint's + * underlying marker + */ + public int getRequestedCharEnd() throws CoreException; + + /** + * Sets the staring source index where the breakpoint should be set. + * + * @param The requested end index attribute. + * @exception CoreException if unable to access the property on this breakpoint's + * underlying marker + */ + public void setRequestedCharEnd(int charEnd) throws CoreException; + + /** + * Returns the file name where the breakpoint was set before it was relocated to a + * valid file. + * + * @return Returns the requested file name. + * @exception CoreException if unable to access the property on this breakpoint's + * underlying marker + */ + public String getRequestedSourceHandle() throws CoreException; + + /** + * Sets the file name where the breakpoint should be set. May be an empty string + * if the file is not known. + * + * @param Requested file name. + * @exception CoreException if unable to access the property on this breakpoint's + * underlying marker + */ + public void setRequestedSourceHandle(String fileName) throws CoreException; + + /** + * Sets the line number where the breakpoint is actually installed. This + * method only updates the {@link IMarker#LINE_NUMBER} attribute and the + * breakpoint message. + * + * @param line Installed line number + * @throws CoreException if unable to access the property + * on this breakpoint's underlying marker + */ + public void setInstalledLineNumber(int line) throws CoreException; + + /** + * Sets the start index where the breakpoint is actually installed. This method + * only updates the {@link IMarker#CHAR_START} attribute and the breakpoint + * message. + * + * @param charStart Installed char start + * @throws CoreException + */ + public void setInstalledCharStart(int charStart) throws CoreException; + + /** + * Sets the end index where the breakpoint is actually installed. This method + * only updates the {@link IMarker#CHAR_END} attribute and the breakpoint + * message. + * + * @param charEnd Installed char start + * @throws CoreException + */ + public void setInstalledCharEnd(int charStart) throws CoreException; + + /** + * Resets the breakpoint location back to the values specified by the + * REQUESTED_* attributes. This operation should be called automatically + * by the implementation when the install count is reset to 0, and does + * not need to be called by the client at that time. + * + * @throws CoreException + */ + public void resetInstalledLocation() throws CoreException; +} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/AbstractLineBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/AbstractLineBreakpoint.java index ee0004fd4db..d5150ff1f75 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/AbstractLineBreakpoint.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/AbstractLineBreakpoint.java @@ -14,6 +14,7 @@ import java.util.Map; import org.eclipse.cdt.debug.core.model.ICBreakpoint; import org.eclipse.cdt.debug.core.model.ICLineBreakpoint; +import org.eclipse.cdt.debug.core.model.ICLineBreakpoint2; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; @@ -23,7 +24,7 @@ import org.eclipse.core.runtime.Path; /** * Base class for different types of location breakponts. */ -public abstract class AbstractLineBreakpoint extends CBreakpoint implements ICLineBreakpoint { +public abstract class AbstractLineBreakpoint extends CBreakpoint implements ICLineBreakpoint2 { /** * Constructor for AbstractLineBreakpoint. @@ -41,7 +42,7 @@ public abstract class AbstractLineBreakpoint extends CBreakpoint implements ICLi * @param add * @throws CoreException */ - public AbstractLineBreakpoint( IResource resource, String markerType, Map attributes, boolean add ) throws CoreException { + public AbstractLineBreakpoint( IResource resource, String markerType, Map attributes, boolean add ) throws CoreException { super( resource, markerType, attributes, add ); } @@ -110,4 +111,114 @@ public abstract class AbstractLineBreakpoint extends CBreakpoint implements ICLi public void setFunction( String function ) throws CoreException { setAttribute( ICLineBreakpoint.FUNCTION, function ); } + + @Override + public int getRequestedLine() throws CoreException { + return ensureMarker().getAttribute( ICLineBreakpoint2.REQUESTED_LINE, -1 ); + } + + @Override + public void setRequestedLine(int line) throws CoreException { + setAttribute( ICLineBreakpoint2.REQUESTED_LINE, line ); + } + + @Override + public int getRequestedCharStart() throws CoreException { + return ensureMarker().getAttribute( ICLineBreakpoint2.REQUESTED_CHAR_START, -1 ); + } + + @Override + public void setRequestedCharStart(int charStart) throws CoreException { + setAttribute( ICLineBreakpoint2.REQUESTED_CHAR_START, charStart ); + } + + @Override + public int getRequestedCharEnd() throws CoreException { + return ensureMarker().getAttribute( ICLineBreakpoint2.REQUESTED_CHAR_END, -1 ); + } + + @Override + public void setRequestedCharEnd(int charEnd) throws CoreException { + setAttribute( ICLineBreakpoint2.REQUESTED_CHAR_END, charEnd ); + } + + @Override + public String getRequestedSourceHandle() throws CoreException { + return ensureMarker().getAttribute( ICLineBreakpoint2.REQUESTED_SOURCE_HANDLE, "" ); //$NON-NLS-1$ + } + + @Override + public void setRequestedSourceHandle(String fileName) throws CoreException { + setAttribute( ICLineBreakpoint2.REQUESTED_SOURCE_HANDLE, fileName ); + } + + @Override + public synchronized int decrementInstallCount() throws CoreException { + int count = super.decrementInstallCount(); + if (count == 0) { + resetInstalledLocation(); + } + return count; + } + + @Override + public void setInstalledLineNumber(int line) throws CoreException { + int existingValue = ensureMarker().getAttribute(IMarker.LINE_NUMBER, -1); + if (line != existingValue) { + setAttribute(IMarker.LINE_NUMBER, line); + setAttribute( IMarker.MESSAGE, getMarkerMessage() ); + } + } + + @Override + public void setInstalledCharStart(int charStart) throws CoreException { + int existingValue = ensureMarker().getAttribute(IMarker.CHAR_START, -1); + if (charStart != existingValue) { + setAttribute(IMarker.CHAR_START, charStart); + setAttribute( IMarker.MESSAGE, getMarkerMessage() ); + } + } + + @Override + public void setInstalledCharEnd(int charEnd) throws CoreException { + int existingValue = ensureMarker().getAttribute(IMarker.CHAR_END, -1); + if (charEnd != existingValue) { + setAttribute(IMarker.CHAR_END, charEnd); + setAttribute( IMarker.MESSAGE, getMarkerMessage() ); + } + } + + @Override + public void resetInstalledLocation() throws CoreException { + boolean locationReset = false; + if (this.getMarker().getAttribute(REQUESTED_LINE) != null) { + int line = this.getMarker().getAttribute(REQUESTED_LINE, -1); + setAttribute(IMarker.LINE_NUMBER, line); + locationReset = true; + } + if (this.getMarker().getAttribute(REQUESTED_CHAR_START) != null) { + int charStart = this.getMarker().getAttribute(REQUESTED_CHAR_START, -1); + setAttribute(IMarker.CHAR_START, charStart); + locationReset = true; + } + if (this.getMarker().getAttribute(REQUESTED_CHAR_END) != null) { + int charEnd = this.getMarker().getAttribute(REQUESTED_CHAR_END, -1); + setAttribute(IMarker.CHAR_END, charEnd); + locationReset = true; + } + if (this.getMarker().getAttribute(REQUESTED_SOURCE_HANDLE) != null) { + String file = this.getMarker().getAttribute(REQUESTED_SOURCE_HANDLE, ""); //$NON-NLS-1$ + setAttribute(ICBreakpoint.SOURCE_HANDLE, file); + locationReset = true; + } + if (locationReset) { + setAttribute( IMarker.MESSAGE, getMarkerMessage() ); + } + } + + @Override + public void refreshMessage() throws CoreException { + IMarker marker = ensureMarker(); + marker.setAttribute(IMarker.MESSAGE, getMarkerMessage()); + } } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/BreakpointMessages.properties b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/BreakpointMessages.properties index 9824818bd46..e4dacfadbf3 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/BreakpointMessages.properties +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/BreakpointMessages.properties @@ -25,6 +25,8 @@ CFunctionTracepoint.0=Function tracepoint: {0} # The marker message of a line breakpoint. CLineBreakpoint.0=Line breakpoint: {0} +# The marker message of a relocated line breakpoint. +CLineBreakpoint.1=Line breakpoint (relocated): {0} # The marker message of a line tracepoint. CLineTracepoint.0=Line tracepoint: {0} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java index bb10180f928..7d31ce0ae1c 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java @@ -16,6 +16,7 @@ import org.eclipse.cdt.debug.core.CDebugUtils; import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; + import com.ibm.icu.text.MessageFormat; /** @@ -34,7 +35,7 @@ public class CAddressBreakpoint extends AbstractLineBreakpoint implements ICAddr /** * Constructor for CAddressBreakpoint. */ - public CAddressBreakpoint( IResource resource, Map attributes, boolean add ) throws CoreException { + public CAddressBreakpoint( IResource resource, Map attributes, boolean add ) throws CoreException { super( resource, getMarkerType(), attributes, add ); } @@ -52,6 +53,6 @@ public class CAddressBreakpoint extends AbstractLineBreakpoint implements ICAddr */ @Override protected String getMarkerMessage() throws CoreException { - return MessageFormat.format( BreakpointMessages.getString( "CAddressBreakpoint.0" ), new String[] { CDebugUtils.getBreakpointText( this, false ) } ); //$NON-NLS-1$ + return MessageFormat.format( BreakpointMessages.getString( "CAddressBreakpoint.0" ), (Object[])new String[] { CDebugUtils.getBreakpointText( this, false ) } ); //$NON-NLS-1$ } } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressTracepoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressTracepoint.java index 1b13c3eb632..0106803b448 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressTracepoint.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressTracepoint.java @@ -56,6 +56,6 @@ public class CAddressTracepoint extends AbstractTracepoint implements ICAddressB */ @Override protected String getMarkerMessage() throws CoreException { - return MessageFormat.format( BreakpointMessages.getString( "CAddressTracepoint.0" ), new String[] { CDebugUtils.getBreakpointText( this, false ) } ); //$NON-NLS-1$ + return MessageFormat.format( BreakpointMessages.getString( "CAddressTracepoint.0" ), (Object[])new String[] { CDebugUtils.getBreakpointText( this, false ) } ); //$NON-NLS-1$ } } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java index 7d8efe54df2..b8a8ccdb11d 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java @@ -48,7 +48,7 @@ public abstract class CBreakpoint extends Breakpoint implements ICBreakpoint, IC * Map of breakpoint extensions. The keys to the map are debug model IDs * and values are arrays of breakpoint extensions. */ - private Map fExtensions = new HashMap(1); + private Map fExtensions = new HashMap(1); /** * The number of debug targets the breakpoint is installed in. We don't use @@ -67,7 +67,7 @@ public abstract class CBreakpoint extends Breakpoint implements ICBreakpoint, IC /** * Constructor for CBreakpoint. */ - public CBreakpoint( final IResource resource, final String markerType, final Map attributes, final boolean add ) throws CoreException { + public CBreakpoint( final IResource resource, final String markerType, final Map attributes, final boolean add ) throws CoreException { this(); IWorkspaceRunnable wr = new IWorkspaceRunnable() { @@ -86,7 +86,7 @@ public abstract class CBreakpoint extends Breakpoint implements ICBreakpoint, IC run( wr ); } - public void createMarker( final IResource resource, final String markerType, final Map attributes, final boolean add ) throws DebugException { + public void createMarker( final IResource resource, final String markerType, final Map attributes, final boolean add ) throws DebugException { IWorkspaceRunnable wr = new IWorkspaceRunnable() { @Override public void run( IProgressMonitor monitor ) throws CoreException { @@ -338,11 +338,11 @@ public abstract class CBreakpoint extends Breakpoint implements ICBreakpoint, IC StringBuffer sb = new StringBuffer(); int ignoreCount = getIgnoreCount(); if ( ignoreCount > 0 ) { - sb.append( MessageFormat.format( BreakpointMessages.getString( "CBreakpoint.1" ), new Integer[] { new Integer( ignoreCount ) } ) ); //$NON-NLS-1$ + sb.append( MessageFormat.format( BreakpointMessages.getString( "CBreakpoint.1" ), new Object[] { new Integer( ignoreCount ) } ) ); //$NON-NLS-1$ } String condition = getCondition(); if ( condition != null && condition.length() > 0 ) { - sb.append( MessageFormat.format( BreakpointMessages.getString( "CBreakpoint.2" ), new String[] { condition } ) ); //$NON-NLS-1$ + sb.append( MessageFormat.format( BreakpointMessages.getString( "CBreakpoint.2" ), new Object[] { condition } ) ); //$NON-NLS-1$ } return sb.toString(); } @@ -376,11 +376,13 @@ public abstract class CBreakpoint extends Breakpoint implements ICBreakpoint, IC } @Override - public ICBreakpointExtension getExtension(String debugModelId, Class extensionType) throws CoreException { + public V getExtension(String debugModelId, Class extensionType) throws CoreException { ICBreakpointExtension[] extensions = getExtensionsForModelId(debugModelId); for (int i = 0; i < extensions.length; i++) { if ( extensionType.isAssignableFrom(extensions[i].getClass()) ) { - return extensions[i]; + @SuppressWarnings("unchecked") + V retVal = (V) extensions[i]; + return retVal; } } throw new CoreException(new Status(IStatus.ERROR, CDebugCorePlugin.getUniqueIdentifier(), DebugPlugin.ERROR, "Extension " + extensionType + " not defined for breakpoint " + this, null)); //$NON-NLS-1$ //$NON-NLS-2$ @@ -402,7 +404,7 @@ public abstract class CBreakpoint extends Breakpoint implements ICBreakpoint, IC IMarker marker = ensureMarker(); // Read the extension registry and create applicable extensions. - List extensions = new ArrayList(4); + List extensions = new ArrayList(4); IExtensionPoint ep = Platform.getExtensionRegistry().getExtensionPoint(CDebugCorePlugin.getUniqueIdentifier(), CDebugCorePlugin.BREAKPOINT_EXTENSION_EXTENSION_POINT_ID); IConfigurationElement[] elements = ep.getConfigurationElements(); for (int i= 0; i < elements.length; i++) { @@ -432,7 +434,7 @@ public abstract class CBreakpoint extends Breakpoint implements ICBreakpoint, IC } fExtensions.put(debugModelId, extensions.toArray(new ICBreakpointExtension[extensions.size()])); } - return (ICBreakpointExtension[])fExtensions.get(debugModelId); + return fExtensions.get(debugModelId); } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CFunctionBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CFunctionBreakpoint.java index 2d56d76629f..a9f27aeb4fa 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CFunctionBreakpoint.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CFunctionBreakpoint.java @@ -10,7 +10,6 @@ *******************************************************************************/ package org.eclipse.cdt.debug.internal.core.breakpoints; -import com.ibm.icu.text.MessageFormat; import java.util.Map; import org.eclipse.cdt.debug.core.CDebugUtils; @@ -18,6 +17,8 @@ import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; +import com.ibm.icu.text.MessageFormat; + /** * A breakpoint that suspends the execution when a function is entered. */ @@ -34,7 +35,7 @@ public class CFunctionBreakpoint extends AbstractLineBreakpoint implements ICFun /** * Constructor for CFunctionBreakpoint. */ - public CFunctionBreakpoint( IResource resource, Map attributes, boolean add ) throws CoreException { + public CFunctionBreakpoint( IResource resource, Map attributes, boolean add ) throws CoreException { super( resource, getMarkerType(), attributes, add ); } @@ -50,6 +51,6 @@ public class CFunctionBreakpoint extends AbstractLineBreakpoint implements ICFun */ @Override protected String getMarkerMessage() throws CoreException { - return MessageFormat.format( BreakpointMessages.getString( "CFunctionBreakpoint.0" ), new String[] { CDebugUtils.getBreakpointText( this, false ) } ); //$NON-NLS-1$ + return MessageFormat.format( BreakpointMessages.getString( "CFunctionBreakpoint.0" ), (Object[])new String[] { CDebugUtils.getBreakpointText( this, false ) } ); //$NON-NLS-1$ } } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CFunctionTracepoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CFunctionTracepoint.java index 81f939ef616..ea0503cf0d6 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CFunctionTracepoint.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CFunctionTracepoint.java @@ -54,6 +54,6 @@ public class CFunctionTracepoint extends AbstractTracepoint implements ICFunctio */ @Override protected String getMarkerMessage() throws CoreException { - return MessageFormat.format( BreakpointMessages.getString( "CFunctionTracepoint.0" ), new String[] { CDebugUtils.getBreakpointText( this, false ) } ); //$NON-NLS-1$ + return MessageFormat.format( BreakpointMessages.getString( "CFunctionTracepoint.0" ), (Object[])new String[] { CDebugUtils.getBreakpointText( this, false ) } ); //$NON-NLS-1$ } } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineBreakpoint.java index e35fb4d3866..37f16afd8fd 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineBreakpoint.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineBreakpoint.java @@ -14,6 +14,9 @@ import com.ibm.icu.text.MessageFormat; import java.util.Map; import org.eclipse.cdt.debug.core.CDebugUtils; +import org.eclipse.cdt.debug.core.model.ICBreakpoint; +import org.eclipse.cdt.debug.core.model.ICLineBreakpoint2; +import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; @@ -34,7 +37,7 @@ public class CLineBreakpoint extends AbstractLineBreakpoint { /** * Constructor for CLineBreakpoint. */ - public CLineBreakpoint( IResource resource, Map attributes, boolean add ) throws CoreException { + public CLineBreakpoint( IResource resource, Map attributes, boolean add ) throws CoreException { super( resource, getMarkerType(), attributes, add ); } @@ -50,6 +53,27 @@ public class CLineBreakpoint extends AbstractLineBreakpoint { */ @Override protected String getMarkerMessage() throws CoreException { - return MessageFormat.format( BreakpointMessages.getString( "CLineBreakpoint.0" ), new String[] { CDebugUtils.getBreakpointText( this, false ) } ); //$NON-NLS-1$ + IMarker marker = this.getMarker(); + int bp_line = 0; + int bp_request_line = 0; + String bp_file = null; + String bp_reqest_file = null; + + if (marker != null) { + bp_line = marker.getAttribute(IMarker.LINE_NUMBER, -1); + bp_request_line = marker.getAttribute(ICLineBreakpoint2.REQUESTED_LINE, -1); + bp_file = marker.getAttribute(ICBreakpoint.SOURCE_HANDLE, (String)null); + bp_reqest_file = marker.getAttribute(ICLineBreakpoint2.REQUESTED_SOURCE_HANDLE, (String)null); + } + + if (bp_line != bp_request_line || + (bp_file == null && bp_reqest_file != null) || + (bp_file != null && !bp_file.equals(bp_reqest_file)) ) + { + return MessageFormat.format( BreakpointMessages.getString( "CLineBreakpoint.1" ), (Object[])new String[] { CDebugUtils.getBreakpointText( this, false ) } ); //$NON-NLS-1$ + } + else { + return MessageFormat.format( BreakpointMessages.getString( "CLineBreakpoint.0" ), (Object[])new String[] { CDebugUtils.getBreakpointText( this, false ) } ); //$NON-NLS-1$ + } } } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineTracepoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineTracepoint.java index 803d59389d6..c911cc63daf 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineTracepoint.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineTracepoint.java @@ -13,7 +13,10 @@ package org.eclipse.cdt.debug.internal.core.breakpoints; import java.util.Map; import org.eclipse.cdt.debug.core.CDebugUtils; +import org.eclipse.cdt.debug.core.model.ICBreakpoint; +import org.eclipse.cdt.debug.core.model.ICLineBreakpoint2; import org.eclipse.cdt.debug.core.model.ICTracepoint; +import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; @@ -24,7 +27,7 @@ import com.ibm.icu.text.MessageFormat; * * @since 6.1 */ -public class CLineTracepoint extends AbstractTracepoint implements ICTracepoint { +public class CLineTracepoint extends AbstractTracepoint implements ICTracepoint, ICLineBreakpoint2 { private static final String C_LINE_TRACEPOINT_MARKER = "org.eclipse.cdt.debug.core.cLineTracepointMarker"; //$NON-NLS-1$ @@ -48,11 +51,121 @@ public class CLineTracepoint extends AbstractTracepoint implements ICTracepoint return C_LINE_TRACEPOINT_MARKER; } + @Override + public synchronized int decrementInstallCount() throws CoreException { + int count = super.decrementInstallCount(); + if (count == 0) { + resetInstalledLocation(); + } + return count; + } + /*(non-Javadoc) * @see org.eclipse.cdt.debug.internal.core.breakpoints.CBreakpoint#getMarkerMessage() */ @Override protected String getMarkerMessage() throws CoreException { - return MessageFormat.format( BreakpointMessages.getString( "CLineTracepoint.0" ), new String[] { CDebugUtils.getBreakpointText( this, false ) } ); //$NON-NLS-1$ + return MessageFormat.format( BreakpointMessages.getString( "CLineTracepoint.0" ), (Object[])new String[] { CDebugUtils.getBreakpointText( this, false ) } ); //$NON-NLS-1$ } + + @Override + public int getRequestedLine() throws CoreException { + return ensureMarker().getAttribute( ICLineBreakpoint2.REQUESTED_LINE, -1 ); + } + + @Override + public void setRequestedLine(int line) throws CoreException { + setAttribute( ICLineBreakpoint2.REQUESTED_LINE, line ); + } + + @Override + public int getRequestedCharStart() throws CoreException { + return ensureMarker().getAttribute( ICLineBreakpoint2.REQUESTED_CHAR_START, -1 ); + } + + @Override + public void setRequestedCharStart(int charStart) throws CoreException { + setAttribute( ICLineBreakpoint2.REQUESTED_CHAR_START, charStart ); + } + + @Override + public int getRequestedCharEnd() throws CoreException { + return ensureMarker().getAttribute( ICLineBreakpoint2.REQUESTED_CHAR_END, -1 ); + } + + @Override + public void setRequestedCharEnd(int charEnd) throws CoreException { + setAttribute( ICLineBreakpoint2.REQUESTED_CHAR_END, charEnd ); + } + + @Override + public String getRequestedSourceHandle() throws CoreException { + return ensureMarker().getAttribute( ICLineBreakpoint2.REQUESTED_SOURCE_HANDLE, "" ); //$NON-NLS-1$ + } + + @Override + public void setRequestedSourceHandle(String fileName) throws CoreException { + setAttribute( ICLineBreakpoint2.REQUESTED_SOURCE_HANDLE, fileName ); + } + + @Override + public void setInstalledLineNumber(int line) throws CoreException { + int existingValue = ensureMarker().getAttribute(IMarker.LINE_NUMBER, -1); + if (line != existingValue) { + setAttribute(IMarker.LINE_NUMBER, line); + setAttribute( IMarker.MESSAGE, getMarkerMessage() ); + } + } + + @Override + public void setInstalledCharStart(int charStart) throws CoreException { + int existingValue = ensureMarker().getAttribute(IMarker.CHAR_START, -1); + if (charStart != existingValue) { + setAttribute(IMarker.CHAR_START, charStart); + setAttribute( IMarker.MESSAGE, getMarkerMessage() ); + } + } + + @Override + public void setInstalledCharEnd(int charEnd) throws CoreException { + int existingValue = ensureMarker().getAttribute(IMarker.CHAR_END, -1); + if (charEnd != existingValue) { + setAttribute(IMarker.CHAR_END, charEnd); + setAttribute( IMarker.MESSAGE, getMarkerMessage() ); + } + } + + @Override + public void resetInstalledLocation() throws CoreException { + boolean locationReset = false; + if (this.getMarker().getAttribute(REQUESTED_LINE) != null) { + int line = this.getMarker().getAttribute(REQUESTED_LINE, -1); + setAttribute(IMarker.LINE_NUMBER, line); + locationReset = true; + } + if (this.getMarker().getAttribute(REQUESTED_CHAR_START) != null) { + int charStart = this.getMarker().getAttribute(REQUESTED_CHAR_START, -1); + setAttribute(IMarker.CHAR_START, charStart); + locationReset = true; + } + if (this.getMarker().getAttribute(REQUESTED_CHAR_END) != null) { + int charEnd = this.getMarker().getAttribute(REQUESTED_CHAR_END, -1); + setAttribute(IMarker.CHAR_END, charEnd); + locationReset = true; + } + if (this.getMarker().getAttribute(REQUESTED_SOURCE_HANDLE) != null) { + String file = this.getMarker().getAttribute(REQUESTED_SOURCE_HANDLE, ""); //$NON-NLS-1$ + setAttribute(ICBreakpoint.SOURCE_HANDLE, file); + locationReset = true; + } + if (locationReset) { + setAttribute( IMarker.MESSAGE, getMarkerMessage() ); + } + } + + @Override + public void refreshMessage() throws CoreException { + IMarker marker = ensureMarker(); + marker.setAttribute(IMarker.MESSAGE, getMarkerMessage()); + } } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CWatchpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CWatchpoint.java index b995859cab8..75f992d126d 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CWatchpoint.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CWatchpoint.java @@ -36,11 +36,11 @@ public class CWatchpoint extends CBreakpoint implements ICWatchpoint2 { /** * Constructor for CWatchpoint. */ - public CWatchpoint( IResource resource, Map attributes, boolean add ) throws CoreException { + public CWatchpoint( IResource resource, Map attributes, boolean add ) throws CoreException { super( resource, getMarkerType(), attributes, add ); } - protected CWatchpoint( IResource resource, String marker, Map attributes, boolean add ) throws CoreException { + protected CWatchpoint( IResource resource, String marker, Map attributes, boolean add ) throws CoreException { super( resource, marker, attributes, add ); } @@ -87,7 +87,7 @@ public class CWatchpoint extends CBreakpoint implements ICWatchpoint2 { format = BreakpointMessages.getString( "CWatchpoint.1" ); //$NON-NLS-1$ else if ( isWriteType() && isReadType() ) format = BreakpointMessages.getString( "CWatchpoint.2" ); //$NON-NLS-1$ - return MessageFormat.format( format, new String[] { CDebugUtils.getBreakpointText( this, false ) } ); + return MessageFormat.format( format, new Object[] { CDebugUtils.getBreakpointText( this, false ) } ); } /* (non-Javadoc) diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/CBreakpointPropertyPage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/CBreakpointPropertyPage.java index 1b188d0660f..006f98937e8 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/CBreakpointPropertyPage.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/CBreakpointPropertyPage.java @@ -21,6 +21,7 @@ import org.eclipse.cdt.debug.core.model.ICBreakpoint; import org.eclipse.cdt.debug.core.model.ICEventBreakpoint; import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint; import org.eclipse.cdt.debug.core.model.ICLineBreakpoint; +import org.eclipse.cdt.debug.core.model.ICLineBreakpoint2; import org.eclipse.cdt.debug.core.model.ICWatchpoint; import org.eclipse.cdt.debug.ui.CDebugUIPlugin; import org.eclipse.cdt.debug.ui.breakpoints.CBreakpointUIContributionFactory; @@ -424,12 +425,12 @@ public class CBreakpointPropertyPage extends FieldEditorPreferencePage implement fElement = element; } - @Override + @Override public IPreferenceStore getPreferenceStore() { return fCBreakpointPreferenceStore; } - @Override + @Override public boolean performOk() { final List changedProperties = new ArrayList( 5 ); getPreferenceStore().addPropertyChangeListener( new IPropertyChangeListener() { @@ -437,7 +438,7 @@ public class CBreakpointPropertyPage extends FieldEditorPreferencePage implement /** * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent) */ - @Override + @Override public void propertyChange( PropertyChangeEvent event ) { changedProperties.add( event.getProperty() ); } @@ -450,7 +451,7 @@ public class CBreakpointPropertyPage extends FieldEditorPreferencePage implement protected void setBreakpointProperties( final List changedProperties ) { IWorkspaceRunnable wr = new IWorkspaceRunnable() { - @Override + @Override public void run( IProgressMonitor monitor ) throws CoreException { ICBreakpoint breakpoint = getBreakpoint(); Iterator changed = changedProperties.iterator(); @@ -468,6 +469,7 @@ public class CBreakpointPropertyPage extends FieldEditorPreferencePage implement else if ( property.equals( CBreakpointPreferenceStore.LINE ) ) { // already workspace runnable, setting markers are safe breakpoint.getMarker().setAttribute(IMarker.LINE_NUMBER, getPreferenceStore().getInt(CBreakpointPreferenceStore.LINE)); + breakpoint.getMarker().setAttribute(ICLineBreakpoint2.REQUESTED_LINE, getPreferenceStore().getInt(CBreakpointPreferenceStore.LINE)); } else { // this allow set attributes contributed by other plugins String value = getPropertyAsString(property); @@ -483,6 +485,7 @@ public class CBreakpointPropertyPage extends FieldEditorPreferencePage implement CDebugUIPlugin.log( ce ); } } + /** * Creates field editors contributed using breakpointUIContribution extension point * @param breakpoint