summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Tepavich2012-02-01 00:21:26 (EST)
committerPawel Piech2012-02-08 14:16:58 (EST)
commitb9255e88a54c84de5af5774cecb4bdad0373e5fa (patch)
treedef78ff3c4084cf3a0fabe1876876632250be60a
parenteae1dbf5f8104ad7db01c6e29397b8b44c021628 (diff)
downloadorg.eclipse.cdt-b9255e88a54c84de5af5774cecb4bdad0373e5fa.zip
org.eclipse.cdt-b9255e88a54c84de5af5774cecb4bdad0373e5fa.tar.gz
org.eclipse.cdt-b9255e88a54c84de5af5774cecb4bdad0373e5fa.tar.bz2
Bug 360280 - [breakpoints] Reposition breakpoints when planted on invalid line
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java19
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java18
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICBreakpoint.java2
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICBreakpoint2.java39
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICLineBreakpoint2.java178
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/AbstractLineBreakpoint.java115
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/BreakpointMessages.properties2
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java5
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressTracepoint.java2
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java20
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CFunctionBreakpoint.java7
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CFunctionTracepoint.java2
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineBreakpoint.java28
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineTracepoint.java117
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CWatchpoint.java6
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/CBreakpointPropertyPage.java11
16 files changed, 532 insertions, 39 deletions
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 1d445fa..ea88c2b 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 b70f911..b5795ec 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 41c4636..4d00e6c 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 extends ICBreakpointExtension> V getExtension(String debugModelId, Class<V> 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 0000000..3e7acd6
--- /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.
+ * <p>
+ * 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.
+ * </p>
+ *
+ * @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 0000000..b2f67e2
--- /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.
+ * <p>Clients which can determine a valid source based on debuggers symbol
+ * information should call the various <code>setInstalled...</code> methods with
+ * the corrected location attributes. Note, there is no <code>setInstalledSourceHandle</code>,
+ * 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. <br/>
+ * The original breakpoint location as configured by the user can always be
+ * retrieved using the <code>getRequested...</code> methods.
+ * </p>
+ * @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 <code>int</code>.
+ */
+ public static final String REQUESTED_LINE = "requestedLine"; //$NON-NLS-1$
+
+ /**
+ * Breakpoint attribute storing the original requested column for this breakpoint
+ * This attribute is a <code>int</code>.
+ */
+ 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 <code>int</code>.
+ */
+ 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 <code>String</code>.
+ */
+ 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 ee0004f..d5150ff 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<String, Object> 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 9824818..e4dacfa 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 bb10180..7d31ce0 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<String, Object> 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 1b13c3e..0106803 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 7d8efe5..b8a8ccd 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<String, ICBreakpointExtension[]> fExtensions = new HashMap<String, ICBreakpointExtension[]>(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<String, Object> 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<String, Object> 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 extends ICBreakpointExtension> V getExtension(String debugModelId, Class<V> 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<ICBreakpointExtension> extensions = new ArrayList<ICBreakpointExtension>(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 2d56d76..a9f27ae 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<String, Object> 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 81f939e..ea0503c 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 e35fb4d..37f16af 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<String, Object> 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 803d593..c911cc6 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 b995859..75f992d 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<String, Object> 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<String, Object> 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 1b188d0..006f989 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