* Breakpoint attribute storing a breakpoint's hit count value
* (value <code>"net.sourceforge.phpeclipse.debug.hitCount"</code>). This attribute is stored as an
* <code>int</code>.
+ *
+ * For DBG the hit count is really a skip count.
+ * Explanation: A hit count of e.g. 4 would break on the fourth occurence of the breakpoint.
+ * A skip count means skip the first four occurences of the breakpoint, and break on the fifth occurence.
*/
protected static final String HIT_COUNT = "net.sourceforge.phpeclipse.debug.hitCount"; //$NON-NLS-1$
/**
+ * Breakpoint attribute storing a breakpoint's changeID.
+ * This is used for checking whether the breakpoint properties menu was finished with
+ * a OK-button. Which means a possible change of breakpoint condition or skip count.
+ * This is necessary because in method breakpointChanged in class PHPDebugTarget we need to know,
+ * whether the breakpoint has changed or not (breakpointChanged is called also when
+ * a PHP source file is modified and saved).
+ */
+ protected static final String CHANGE_ID = "net.sourceforge.phpeclipse.debug.changeID"; //$NON-NLS-1$
+
+ /**
+ * Breakpoint attribute storing a breakpoint's condition
+ * (value <code>"net.sourceforge.phpeclipse.debug.condition"</code>). This attribute is stored as an
+ * <code>string</code>.
+ */
+ protected static final String CONDITION = "net.sourceforge.phpeclipse.debug.condition"; //$NON-NLS-1$
+
+ /**
+ * Breakpoint attribute storing whether a breakpoint's condition is enabled or not
+ * (value <code>"net.sourceforge.phpeclipse.debug.conditionEnabled"</code>). This attribute is stored as an
+ * <code>boolean</code>.
+ */
+ protected static final String CONDITION_ENABLED = "net.sourceforge.phpeclipse.debug.conditionEnabled"; //$NON-NLS-1$
+
+ /**
* Breakpoint attribute storing the fully qualified name of the type
* this breakpoint is located in.
* (value <code>"net.sourceforge.phpeclipse.debug.typeName"</code>). This attribute is a <code>String</code>.
}
public void setDBGBpNo(int bpNo) {
- this.DBGBpNo= bpNo;
+ this.DBGBpNo = bpNo;
}
public int getDBGBpNo() {
return this.DBGBpNo;
}
+
+ public int getHitCount () throws CoreException {
+ return getMarker ().getAttribute (HIT_COUNT, -1);
+ }
+
+ public void setHitCount (int hitCount) throws CoreException {
+ if (hitCount > 0) {
+ if (!isEnabled ()) {
+ getMarker ().setAttribute (ENABLED, true);
+ }
+ }
+
+ getMarker ().setAttribute (HIT_COUNT, hitCount);
+ }
}