1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Reset breakpoints install count at startup and shutdown of CDebugCorePlugin.

This commit is contained in:
Mikhail Khodjaiants 2002-09-19 17:18:39 +00:00
parent de190fac8a
commit e71171b519
2 changed files with 49 additions and 0 deletions

View file

@ -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() );
}
}
}
}
}

View file

@ -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
*/