1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-21 16:05:25 +02:00

Batch breakpoint updates in one job.

This commit is contained in:
Mikhail Khodjaiants 2004-11-15 20:47:48 +00:00
parent ee27feda67
commit 4c5be532cc
2 changed files with 33 additions and 19 deletions

View file

@ -1,3 +1,7 @@
2004-11-15 Mikhail Khodjaiants
Batch breakpoint updates in one job.
* CBreakpointManager.java
2004-11-12 Mikhail Khodjaiants 2004-11-12 Mikhail Khodjaiants
Apply the breakpoint's condition changes to the associated gdb breakpoint Apply the breakpoint's condition changes to the associated gdb breakpoint
only if there are differences. only if there are differences.

View file

@ -353,31 +353,20 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
String condition = breakpoint.getCondition(); String condition = breakpoint.getCondition();
String oldCondition = ( delta != null ) ? delta.getAttribute( ICBreakpoint.CONDITION, "" ) : condition; //$NON-NLS-1$ String oldCondition = ( delta != null ) ? delta.getAttribute( ICBreakpoint.CONDITION, "" ) : condition; //$NON-NLS-1$
String[] newThreadIs = getThreadNames( breakpoint ); String[] newThreadIs = getThreadNames( breakpoint );
Boolean enabled0 = null;
ICDICondition condition0 = null;
if ( enabled != oldEnabled && enabled != cdiBreakpoint.isEnabled() ) { if ( enabled != oldEnabled && enabled != cdiBreakpoint.isEnabled() ) {
DebugPlugin.getDefault().asyncExec( new Runnable() { enabled0 = ( enabled ) ? Boolean.TRUE : Boolean.FALSE;
public void run() {
try {
cdiBreakpoint.setEnabled( enabled );
}
catch( CDIException e ) {
}
}
} );
} }
if ( ignoreCount != oldIgnoreCount || condition.compareTo( oldCondition ) != 0 || areThreadFiltersChanged( newThreadIs, cdiBreakpoint ) ) { if ( ignoreCount != oldIgnoreCount || condition.compareTo( oldCondition ) != 0 || areThreadFiltersChanged( newThreadIs, cdiBreakpoint ) ) {
final ICDICondition cdiCondition = cdiTarget.createCondition( ignoreCount, condition, newThreadIs ); final ICDICondition cdiCondition = cdiTarget.createCondition( ignoreCount, condition, newThreadIs );
if ( ! cdiCondition.equals( cdiBreakpoint.getCondition() ) ) { if ( !cdiCondition.equals( cdiBreakpoint.getCondition() ) ) {
DebugPlugin.getDefault().asyncExec( new Runnable() { condition0 = cdiCondition;
public void run() {
try {
cdiBreakpoint.setCondition( cdiCondition );
}
catch( CDIException e ) {
}
}
} );
} }
} }
if ( enabled0 != null || condition0 != null ) {
changeBreakpointPropertiesOnTarget( cdiBreakpoint, enabled0, condition0 );
}
} }
catch( CoreException e ) { catch( CoreException e ) {
requestFailed( MessageFormat.format( InternalDebugCoreMessages.getString( "CBreakpointManager.4" ), new String[] { e.getMessage() } ), e ); //$NON-NLS-1$ requestFailed( MessageFormat.format( InternalDebugCoreMessages.getString( "CBreakpointManager.4" ), new String[] { e.getMessage() } ), e ); //$NON-NLS-1$
@ -387,6 +376,27 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
} }
} }
private void changeBreakpointPropertiesOnTarget( final ICDIBreakpoint breakpoint, final Boolean enabled, final ICDICondition condition ) {
DebugPlugin.getDefault().asyncExec( new Runnable() {
public void run() {
if ( enabled != null ) {
try {
breakpoint.setEnabled( enabled.booleanValue() );
}
catch( CDIException e ) {
}
}
if ( condition != null ) {
try {
breakpoint.setCondition( condition );
}
catch( CDIException e ) {
}
}
}
} );
}
private void handleBreakpointCreatedEvent( final ICDIBreakpoint cdiBreakpoint ) { private void handleBreakpointCreatedEvent( final ICDIBreakpoint cdiBreakpoint ) {
if ( cdiBreakpoint instanceof ICDIWatchpoint ) if ( cdiBreakpoint instanceof ICDIWatchpoint )
doHandleWatchpointCreatedEvent( (ICDIWatchpoint)cdiBreakpoint ); doHandleWatchpointCreatedEvent( (ICDIWatchpoint)cdiBreakpoint );