From b4632f88d2c69e9866d2c79f5fd41615a625e25f Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Wed, 4 Sep 2002 20:50:20 +0000 Subject: [PATCH] Implementation of watchpoints. --- debug/org.eclipse.cdt.debug.core/plugin.xml | 11 ++ .../eclipse/cdt/debug/core/ICBreakpoint.java | 2 +- .../eclipse/cdt/debug/core/ICWatchpoint.java | 58 +++++++++++ .../core/breakpoints/CWatchpoint.java | 76 ++++++++++++++ .../icons/full/obj16/readwrite_obj.gif | Bin 0 -> 231 bytes .../full/obj16/readwrite_obj_disabled.gif | Bin 0 -> 135 bytes .../plugin.properties | 3 +- debug/org.eclipse.cdt.debug.ui/plugin.xml | 15 +++ .../actions/CBreakpointPropertiesDialog.java | 1 + .../ManageWatchpointActionDelegate.java | 95 ++++++++++++++++++ .../ui/views/registers/RegistersView.java | 13 +-- 11 files changed, 264 insertions(+), 10 deletions(-) create mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICWatchpoint.java create mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CWatchpoint.java create mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/readwrite_obj.gif create mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/readwrite_obj_disabled.gif create mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageWatchpointActionDelegate.java diff --git a/debug/org.eclipse.cdt.debug.core/plugin.xml b/debug/org.eclipse.cdt.debug.core/plugin.xml index f0d2bd64f4b..011367a78f7 100644 --- a/debug/org.eclipse.cdt.debug.core/plugin.xml +++ b/debug/org.eclipse.cdt.debug.core/plugin.xml @@ -102,6 +102,12 @@ + + + + @@ -120,6 +126,11 @@ class="org.eclipse.cdt.debug.internal.core.breakpoints.CFunctionBreakpoint" id="cFunctionBreakpoint"> + + diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICBreakpoint.java index 19fa29e7987..aab54fcbc03 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICBreakpoint.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICBreakpoint.java @@ -32,7 +32,7 @@ public interface ICBreakpoint extends IBreakpoint public static final String INSTALL_COUNT = "org.eclipse.cdt.debug.core.installCount"; //$NON-NLS-1$ /** - * Breakpoint attribute storing the the conditional expression + * Breakpoint attribute storing the conditional expression * associated with this breakpoint (value "org.eclipse.cdt.debug.core.condition"). * This attribute is a String. */ diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICWatchpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICWatchpoint.java new file mode 100644 index 00000000000..c255036bfb5 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICWatchpoint.java @@ -0,0 +1,58 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ +package org.eclipse.cdt.debug.core; + +import org.eclipse.core.runtime.CoreException; + +/** + * + * A watchpoint specific to the C/C++ debug model. + * + * @since Sep 4, 2002 + */ +public interface ICWatchpoint extends ICBreakpoint +{ + /** + * Watchpoint attribute storing the expression associated with this + * watchpoint (value "org.eclipse.cdt.debug.core.expression"). + * This attribute is a String. + */ + public static final String EXPRESSION = "org.eclipse.cdt.debug.core.expression"; //$NON-NLS-1$ + + /** + * Write access watchpoint attribute (value "org.eclipse.cdt.debug.core.write"). + * This attribute is a boolean. + */ + public static final String WRITE = "org.eclipse.cdt.debug.core.write"; //$NON-NLS-1$ + + /** + * Read access watchpoint attribute (value "org.eclipse.cdt.debug.core.read"). + * This attribute is a boolean. + */ + public static final String READ = "org.eclipse.cdt.debug.core.read"; //$NON-NLS-1$ + + /** + * Returns whether this watchppoint is a write watchpoint. + * + * @return whether this watchppoint is a write watchpoint + */ + boolean isWriteType() throws CoreException; + + /** + * Returns whether this watchppoint is a read watchpoint. + * + * @return whether this watchppoint is a read watchpoint + */ + boolean isReadType() throws CoreException; + + /** + * Returns the watchpoint's expression. + * + * @return the expression of this watchpoint + * @throws CDIException if this method fails. Reasons include: + */ + String getExpression() throws CoreException; +} 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 new file mode 100644 index 00000000000..42b06375e85 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CWatchpoint.java @@ -0,0 +1,76 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ +package org.eclipse.cdt.debug.internal.core.breakpoints; + +import java.util.Map; + +import org.eclipse.cdt.debug.core.ICWatchpoint; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.DebugException; + +/** + * + * Enter type comment. + * + * @since Sep 4, 2002 + */ +public class CWatchpoint extends CBreakpoint implements ICWatchpoint +{ + private static final String C_WATCHPOINT = "org.eclipse.cdt.debug.core.cWatchpointMarker"; //$NON-NLS-1$ + + /** + * Constructor for CWatchpoint. + */ + public CWatchpoint() + { + } + + /** + * Constructor for CWatchpoint. + * @param resource + * @param markerType + * @param attributes + * @param add + * @throws DebugException + */ + public CWatchpoint( IResource resource, Map attributes, boolean add ) throws DebugException + { + super( resource, getMarkerType(), attributes, add ); + } + + /* (non-Javadoc) + * @see org.eclipse.cdt.debug.core.ICWatchpoint#isWriteType() + */ + public boolean isWriteType() throws CoreException + { + return ensureMarker().getAttribute( WRITE, true ); + } + + /* (non-Javadoc) + * @see org.eclipse.cdt.debug.core.ICWatchpoint#isReadType() + */ + public boolean isReadType() throws CoreException + { + return ensureMarker().getAttribute( READ, false ); + } + + /* (non-Javadoc) + * @see org.eclipse.cdt.debug.core.ICWatchpoint#getExpression() + */ + public String getExpression() throws CoreException + { + return ensureMarker().getAttribute( EXPRESSION, "" ); + } + + /** + * Returns the type of marker associated with this type of breakpoints + */ + public static String getMarkerType() + { + return C_WATCHPOINT; + } +} diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/readwrite_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/readwrite_obj.gif new file mode 100644 index 0000000000000000000000000000000000000000..0b1184d72a8983761bf7190189104481e39f6540 GIT binary patch literal 231 zcmZ?wbhEHb6krfwIKseSZy!IEXCKFptAzkmPy|Gz){zdwI}z5V_9@%8cc|M%DL zpI?6;DE|NdexUUH`3(&X@$vBt3=BXKAW0A?{$ycfU=U`|0jUJp$-tWOK*g+I#rEut zHIH1pwBJlizh&`Z)#Hu6kA)OgDJq+BSxQ_on*^J^}sR6YUtDJa;=%u;KApUPb{P?(&=vA%?E{N;Qr4%7ipU25SH(R8#K& literal 0 HcmV?d00001 diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/readwrite_obj_disabled.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/readwrite_obj_disabled.gif new file mode 100644 index 0000000000000000000000000000000000000000..8eba2e1c28966262163b315c6781f8c4645cb420 GIT binary patch literal 135 zcmZ?wbhEHb6krfwSj51vV8N36_xJz*|9}7f{qyI~Z)j+UkBU=09?E;RQ5 literal 0 HcmV?d00001 diff --git a/debug/org.eclipse.cdt.debug.ui/plugin.properties b/debug/org.eclipse.cdt.debug.ui/plugin.properties index 6c77d2c81ce..01ffc8ee816 100644 --- a/debug/org.eclipse.cdt.debug.ui/plugin.properties +++ b/debug/org.eclipse.cdt.debug.ui/plugin.properties @@ -20,4 +20,5 @@ AddBreakpoint.label=Add/Remove &Breakpoint EnableBreakpoint.label=T&oggle Breakpoint BreakpointProperties.label=Breakpoint P&roperties... ManageBreakpointAction.label=Add/Remove C/C++ Brea&kpoint -BreakpointPropertiesAction.label=P&roperties... \ No newline at end of file +BreakpointPropertiesAction.label=P&roperties... +ManageWatchpointAction.label=Add/Remove C/C++ &Watchpoint diff --git a/debug/org.eclipse.cdt.debug.ui/plugin.xml b/debug/org.eclipse.cdt.debug.ui/plugin.xml index 091f6b20c41..9970c4e8501 100644 --- a/debug/org.eclipse.cdt.debug.ui/plugin.xml +++ b/debug/org.eclipse.cdt.debug.ui/plugin.xml @@ -111,6 +111,21 @@ + + + + + +