1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 09:46:02 +02:00

Check if breakpoint list is empty before deletion.

This commit is contained in:
Mikhail Khodjaiants 2002-09-20 21:47:39 +00:00
parent 5bd058f701
commit c58729d044

View file

@ -1076,24 +1076,27 @@ public class CDebugTarget extends CDebugElement
{ {
ICDIBreakpoint[] cdiBreakpoints = (ICDIBreakpoint[])getBreakpoints().values().toArray( new ICDIBreakpoint[0] ); ICDIBreakpoint[] cdiBreakpoints = (ICDIBreakpoint[])getBreakpoints().values().toArray( new ICDIBreakpoint[0] );
ICDIBreakpointManager bm = getCDISession().getBreakpointManager(); ICDIBreakpointManager bm = getCDISession().getBreakpointManager();
try if ( cdiBreakpoints.length > 0 )
{ {
bm.deleteBreakpoints( cdiBreakpoints ); try
Iterator it = getBreakpoints().keySet().iterator();
while( it.hasNext() )
{ {
((CBreakpoint)it.next()).decrementInstallCount(); bm.deleteBreakpoints( cdiBreakpoints );
Iterator it = getBreakpoints().keySet().iterator();
while( it.hasNext() )
{
((CBreakpoint)it.next()).decrementInstallCount();
}
getBreakpoints().clear();
}
catch( CoreException ce )
{
requestFailed( "Operation failed. Reason: ", ce );
}
catch( CDIException e )
{
requestFailed( "Operation failed. Reason: ", e );
} }
getBreakpoints().clear();
} }
catch( CoreException ce )
{
requestFailed( "Operation failed. Reason: ", ce );
}
catch( CDIException e )
{
requestFailed( "Operation failed. Reason: ", e );
}
} }
protected void removeBreakpoint( CBreakpoint breakpoint ) throws DebugException protected void removeBreakpoint( CBreakpoint breakpoint ) throws DebugException
@ -1126,15 +1129,18 @@ public class CDebugTarget extends CDebugElement
{ {
ICDIBreakpoint[] cdiBreakpoints = (ICDIBreakpoint[])getTemporaryBreakpoints().toArray( new ICDIBreakpoint[0] ); ICDIBreakpoint[] cdiBreakpoints = (ICDIBreakpoint[])getTemporaryBreakpoints().toArray( new ICDIBreakpoint[0] );
ICDIBreakpointManager bm = getCDISession().getBreakpointManager(); ICDIBreakpointManager bm = getCDISession().getBreakpointManager();
try if ( cdiBreakpoints.length > 0 )
{ {
bm.deleteBreakpoints( cdiBreakpoints ); try
getTemporaryBreakpoints().clear(); {
bm.deleteBreakpoints( cdiBreakpoints );
getTemporaryBreakpoints().clear();
}
catch( CDIException e )
{
logError( e );
}
} }
catch( CDIException e )
{
logError( e );
}
} }
protected void changeBreakpointProperties( CBreakpoint breakpoint, IMarkerDelta delta ) throws DebugException protected void changeBreakpointProperties( CBreakpoint breakpoint, IMarkerDelta delta ) throws DebugException