diff options
author | Mikhail Khodjaiants | 2002-09-04 20:50:20 +0000 |
---|---|---|
committer | Mikhail Khodjaiants | 2002-09-04 20:50:20 +0000 |
commit | b4632f88d2c69e9866d2c79f5fd41615a625e25f (patch) | |
tree | 1a45675ad9c9c1c1d9b5c1e57b50bafd595b3458 /debug | |
parent | b5af571676c6d48c4f64f96f93583222bcc6fd65 (diff) | |
download | org.eclipse.cdt-b4632f88d2c69e9866d2c79f5fd41615a625e25f.tar.gz org.eclipse.cdt-b4632f88d2c69e9866d2c79f5fd41615a625e25f.tar.xz org.eclipse.cdt-b4632f88d2c69e9866d2c79f5fd41615a625e25f.zip |
Implementation of watchpoints.
Diffstat (limited to 'debug')
11 files changed, 264 insertions, 10 deletions
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 @@ <attribute name="org.eclipse.cdt.debug.core.expression"> </attribute> + <attribute + name="org.eclipse.cdt.debug.core.write"> + </attribute> + <attribute + name="org.eclipse.cdt.debug.core.read"> + </attribute> </extension> <extension point="org.eclipse.debug.core.breakpoints"> @@ -120,6 +126,11 @@ class="org.eclipse.cdt.debug.internal.core.breakpoints.CFunctionBreakpoint" id="cFunctionBreakpoint"> </breakpoint> + <breakpoint + markerType="org.eclipse.cdt.debug.core.cWatchpointMarker" + class="org.eclipse.cdt.debug.internal.core.breakpoints.CWatchpoint" + id="cWatchpoint"> + </breakpoint> </extension> </plugin> 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 <code>"org.eclipse.cdt.debug.core.condition"</code>). * This attribute is a <code>String</code>. */ 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 <code>"org.eclipse.cdt.debug.core.expression"</code>). + * This attribute is a <code>String</code>. + */ + public static final String EXPRESSION = "org.eclipse.cdt.debug.core.expression"; //$NON-NLS-1$ + + /** + * Write access watchpoint attribute (value <code>"org.eclipse.cdt.debug.core.write"</code>). + * This attribute is a <code>boolean</code>. + */ + public static final String WRITE = "org.eclipse.cdt.debug.core.write"; //$NON-NLS-1$ + + /** + * Read access watchpoint attribute (value <code>"org.eclipse.cdt.debug.core.read"</code>). + * This attribute is a <code>boolean</code>. + */ + 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 Binary files differnew file mode 100644 index 00000000000..0b1184d72a8 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/readwrite_obj.gif 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 Binary files differnew file mode 100644 index 00000000000..8eba2e1c289 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/readwrite_obj_disabled.gif 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 @@ </pluginState> </enablement> </action> + <action + label="%ManageWatchpointAction.label" + icon="icons/full/obj16/readwrite_obj.gif" + helpContextId="manage_watchpoint_action_context" + class="org.eclipse.cdt.debug.internal.ui.actions.ManageWatchpointActionDelegate" + menubarPath="org.eclipse.ui.run/breakpointGroup" + disabledIcon="icons/full/obj16/readwrite_obj_disabled.gif" + id="org.eclipse.cdt.debug.internal.ui.actions.ManageWatchpointActionDelegate"> + <enablement> + <pluginState + value="activated" + id="org.eclipse.cdt.debug.ui"> + </pluginState> + </enablement> + </action> </actionSet> </extension> <extension diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesDialog.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesDialog.java index 0ad260d1f93..501910e1936 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesDialog.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesDialog.java @@ -68,6 +68,7 @@ public class CBreakpointPropertiesDialog extends Dialog children[i].setSize( rect.width, rect.height ); } } + public Point computeSize( Composite composite, int wHint, int hHint, boolean force ) { if ( wHint != SWT.DEFAULT && hHint != SWT.DEFAULT ) diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageWatchpointActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageWatchpointActionDelegate.java new file mode 100644 index 00000000000..b4ed2bbbd0a --- /dev/null +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageWatchpointActionDelegate.java @@ -0,0 +1,95 @@ +/* + *(c) Copyright QNX Software Systems Ltd. 2002. + * All Rights Reserved. + * + */ +package org.eclipse.cdt.debug.internal.ui.actions; + +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.ui.IPartListener; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.IWorkbenchWindowActionDelegate; + +/** + * + * Action for adding/removing watchpoints at a selection in the active + * C/C++ or assembly editor. + * + * @since Sep 4, 2002 + */ +public class ManageWatchpointActionDelegate implements IWorkbenchWindowActionDelegate, + IPartListener +{ + /** + * Constructor for ManageWatchpointActionDelegate. + */ + public ManageWatchpointActionDelegate() + { + super(); + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose() + */ + public void dispose() + { + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(IWorkbenchWindow) + */ + public void init( IWorkbenchWindow window ) + { + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IPartListener#partActivated(IWorkbenchPart) + */ + public void partActivated( IWorkbenchPart part ) + { + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IPartListener#partBroughtToTop(IWorkbenchPart) + */ + public void partBroughtToTop( IWorkbenchPart part ) + { + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IPartListener#partClosed(IWorkbenchPart) + */ + public void partClosed( IWorkbenchPart part ) + { + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IPartListener#partDeactivated(IWorkbenchPart) + */ + public void partDeactivated( IWorkbenchPart part ) + { + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IPartListener#partOpened(IWorkbenchPart) + */ + public void partOpened( IWorkbenchPart part ) + { + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IActionDelegate#run(IAction) + */ + public void run( IAction action ) + { + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection) + */ + public void selectionChanged( IAction action, ISelection selection ) + { + } +} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersView.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersView.java index 5eb8a8d4717..500c336544e 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersView.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersView.java @@ -6,9 +6,7 @@ package org.eclipse.cdt.debug.internal.ui.views.registers; -import java.util.ArrayList; -import java.util.List; - +import org.eclipse.cdt.debug.internal.ui.CDTDebugModelPresentation; import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; import org.eclipse.cdt.debug.internal.ui.preferences.ICDebugPreferenceConstants; import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler; @@ -17,7 +15,6 @@ import org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler; import org.eclipse.cdt.debug.ui.CDebugUIPlugin; import org.eclipse.cdt.debug.ui.ICDebugUIConstants; import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.internal.ui.DelegatingModelPresentation; import org.eclipse.debug.ui.IDebugModelPresentation; import org.eclipse.debug.ui.IDebugUIConstants; import org.eclipse.jface.action.IMenuManager; @@ -48,7 +45,7 @@ public class RegistersView extends AbstractDebugEventHandlerView /** * The model presentation used as the label provider for the tree viewer. */ - private DelegatingModelPresentation fModelPresentation; + private CDTDebugModelPresentation fModelPresentation; protected static final String VARIABLES_SELECT_ALL_ACTION = SELECT_ALL_ACTION + ".Registers"; //$NON-NLS-1$ @@ -57,7 +54,7 @@ public class RegistersView extends AbstractDebugEventHandlerView */ protected Viewer createViewer( Composite parent ) { - fModelPresentation = new DelegatingModelPresentation(); + fModelPresentation = new CDTDebugModelPresentation(); CDebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener( this ); // add tree viewer @@ -132,7 +129,7 @@ public class RegistersView extends AbstractDebugEventHandlerView /* (non-Javadoc) * @see org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler#handleException(DebugException) */ - public void handleException(DebugException e) + public void handleException( DebugException e ) { } @@ -165,7 +162,7 @@ public class RegistersView extends AbstractDebugEventHandlerView { if ( fModelPresentation == null ) { - fModelPresentation = new DelegatingModelPresentation(); + fModelPresentation = new CDTDebugModelPresentation(); } return fModelPresentation; } |