Skip to main content
summaryrefslogtreecommitdiffstats
path: root/debug
diff options
context:
space:
mode:
authorMikhail Khodjaiants2012-11-28 17:00:30 -0500
committerMikhail Khodjaiants2012-11-29 16:04:00 -0500
commit12de79d9b0ce1cafb20008269996058c5ba70979 (patch)
tree93e8f3ed592ac2dfd1e1a624d9509f73ebb43b57 /debug
parentdb3fa6a01f4c53bbe4b599587ab460fe5725e1fe (diff)
downloadorg.eclipse.cdt-12de79d9b0ce1cafb20008269996058c5ba70979.tar.gz
org.eclipse.cdt-12de79d9b0ce1cafb20008269996058c5ba70979.tar.xz
org.eclipse.cdt-12de79d9b0ce1cafb20008269996058c5ba70979.zip
Bug 392512 - Support GDB breakpoint notifications
Change-Id: I244ba995392806a56a52852e0d0d9ea72f87edfa Reviewed-on: https://git.eclipse.org/r/8327 Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com> IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com> Tested-by: Marc Khouzam <marc.khouzam@ericsson.com> Reviewed-by: Mikhail Khodjaiants <mikhailkhod@googlemail.com> IP-Clean: Mikhail Khodjaiants <mikhailkhod@googlemail.com> Tested-by: Mikhail Khodjaiants <mikhailkhod@googlemail.com>
Diffstat (limited to 'debug')
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java87
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java1
2 files changed, 88 insertions, 0 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 43539805dc..e02da67b6d 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
@@ -706,6 +706,52 @@ public class CDIDebugModel {
* @param resource
* the resource on which to create the associated watchpoint
* marker
+ * @param type
+ * a type constant from ICBreakpointType
+ * @param writeAccess
+ * whether this is write watchpoint
+ * @param readAccess
+ * whether this is read watchpoint
+ * @param expression
+ * the expression on which the watchpoint is set
+ * @param enabled
+ * whether to enable or disable this breakpoint
+ * @param ignoreCount
+ * the number of times this breakpoint will be ignored
+ * @param condition
+ * the breakpoint condition
+ * @param register
+ * whether to add this breakpoint to the breakpoint manager
+ * @return a watchpoint
+ * @throws CoreException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>Failure creating underlying marker. The exception's
+ * status contains the underlying exception responsible for the
+ * failure.</li>
+ * </ul>
+ *
+ * @since 7.3
+ */
+ public static ICWatchpoint createWatchpoint(String sourceHandle, IResource resource, int type, boolean writeAccess,
+ boolean readAccess, String expression, boolean enabled, int ignoreCount, String condition, boolean register)
+ throws CoreException {
+ HashMap<String, Object> attributes = new HashMap<String, Object>(10);
+ setWatchPointAttributes(attributes, sourceHandle, resource, type, writeAccess, readAccess, expression, "", //$NON-NLS-1$
+ BigInteger.ZERO, enabled, ignoreCount, condition);
+ return new CWatchpoint(resource, attributes, register);
+ }
+
+ /**
+ * Creates and returns a watchpoint for the source defined by the given
+ * source handle, at the given expression. The marker associated with the
+ * watchpoint will be created on the specified resource.
+ *
+ * @param sourceHandle
+ * the handle to the watchpoint source
+ * @param resource
+ * the resource on which to create the associated watchpoint
+ * marker
* @param charStart
* the first character index associated with the watchpoint, or
* -1 if unspecified, in the source file in which the watchpoint
@@ -851,6 +897,47 @@ public class CDIDebugModel {
}
/**
+ * Helper function for setting common watchpoint attributes.
+ *
+ * @param attributes
+ * Map to write the attributes into.
+ * @param sourceHandle
+ * the handle to the watchpoint source
+ * @param resource
+ * the resource on which to create the associated watchpoint
+ * marker
+ * @param type
+ * a type constant from ICBreakpointType
+ * @param writeAccess
+ * whether this is write watchpoint
+ * @param readAccess
+ * whether this is read watchpoint
+ * @param expression
+ * the expression on which the watchpoint is set
+ * @param memorySpace
+ * the memory space in which the watchpoint is set
+ * @param range
+ * the range of the watchpoint in addressable units
+ * @param enabled
+ * whether to enable or disable this breakpoint
+ * @param ignoreCount
+ * the number of times this breakpoint will be ignored
+ * @param condition
+ * the breakpoint condition
+ * @param register
+ * whether to add this breakpoint to the breakpoint manager
+ *
+ * @since 7.3
+ */
+ public static void setWatchPointAttributes(Map<String, Object> attributes, String sourceHandle, IResource resource,
+ int type, boolean writeAccess, boolean readAccess, String expression, String memorySpace, BigInteger range,
+ boolean enabled, int ignoreCount, String condition) {
+ setWatchPointAttributes(attributes, sourceHandle, resource,
+ writeAccess, readAccess, expression, memorySpace, range, enabled, ignoreCount, condition);
+ attributes.put(ICBreakpointType.TYPE, type);
+ }
+
+ /**
* Creates and returns a breakpoint for the function defined by the given
* name. The marker associated with the breakpoint will be created on the
* specified resource.
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 ed986b883e..f88761ee33 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
@@ -357,6 +357,7 @@ public class CDebugUtils {
appendWatchMemorySpace(wp2, label);
appendWatchRange(wp2, label);
}
+ appendBreakpointType(watchpoint, label);
appendIgnoreCount(watchpoint, label);
appendCondition(watchpoint, label);
return label.toString();

Back to the top