From: robekras Date: Sun, 11 Dec 2005 14:44:09 +0000 (+0000) Subject: 1) Added attributes and methods for conditional breakpoints and skip/hit count. X-Git-Url: http://git.phpeclipse.com?hp=c768d51a583834f5b1143135eff368b7fe35685d 1) Added attributes and methods for conditional breakpoints and skip/hit count. --- diff --git a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/breakpoints/PHPBreakpoint.java b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/breakpoints/PHPBreakpoint.java index 4541160..8d4b084 100644 --- a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/breakpoints/PHPBreakpoint.java +++ b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/breakpoints/PHPBreakpoint.java @@ -79,10 +79,38 @@ public abstract class PHPBreakpoint extends Breakpoint implements IBreakpoint { * Breakpoint attribute storing a breakpoint's hit count value * (value "net.sourceforge.phpeclipse.debug.hitCount"). This attribute is stored as an * int. + * + * 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 "net.sourceforge.phpeclipse.debug.condition"). This attribute is stored as an + * string. + */ + 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 "net.sourceforge.phpeclipse.debug.conditionEnabled"). This attribute is stored as an + * boolean. + */ + 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 "net.sourceforge.phpeclipse.debug.typeName"). This attribute is a String. @@ -179,10 +207,24 @@ public abstract class PHPBreakpoint extends Breakpoint implements IBreakpoint { } 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); + } }