diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugCorePlugin.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugCorePlugin.java index c7146154d2b..026e1f05314 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugCorePlugin.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugCorePlugin.java @@ -11,6 +11,7 @@ import java.util.HashMap; import java.util.List; import org.eclipse.cdt.debug.internal.core.DebugConfiguration; +import org.eclipse.cdt.debug.internal.core.breakpoints.CBreakpoint; import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; @@ -22,6 +23,8 @@ import org.eclipse.core.runtime.Plugin; import org.eclipse.core.runtime.Status; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.IBreakpointManager; +import org.eclipse.debug.core.model.IBreakpoint; /** * The main plugin class to be used in the desktop. @@ -160,4 +163,42 @@ public class CDebugCorePlugin extends Plugin } return dbgCfg; } + + /* (non-Javadoc) + * @see org.eclipse.core.runtime.Plugin#shutdown() + */ + public void shutdown() throws CoreException + { + resetBreakpointsInstallCount(); + super.shutdown(); + } + + /* (non-Javadoc) + * @see org.eclipse.core.runtime.Plugin#startup() + */ + public void startup() throws CoreException + { + super.startup(); + resetBreakpointsInstallCount(); + } + + protected void resetBreakpointsInstallCount() + { + IBreakpointManager bm = DebugPlugin.getDefault().getBreakpointManager(); + IBreakpoint[] breakpoints = bm.getBreakpoints( getUniqueIdentifier() ); + for ( int i = 0; i < breakpoints.length; ++i ) + { + if ( breakpoints[i] instanceof CBreakpoint ) + { + try + { + ((CBreakpoint)breakpoints[i]).resetInstallCount(); + } + catch( CoreException e ) + { + log( e.getStatus() ); + } + } + } + } } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java index 201203d7299..1af031dd1fb 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java @@ -172,6 +172,14 @@ public abstract class CBreakpoint extends Breakpoint return null; } + /** + * Resets the install count of this breakpoint + */ + public void resetInstallCount() throws CoreException + { + setAttribute( INSTALL_COUNT, 0 ); + } + /** * Increments the install count of this breakpoint */