From 0b13d5449936a49a6ae8e64173fd73b76b9d04d0 Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Fri, 12 Nov 2004 19:25:28 +0000 Subject: [PATCH] Apply the breakpoint's condition changes to the associated gdb breakpoint only if there are differences. --- debug/org.eclipse.cdt.debug.core/ChangeLog | 5 ++++ .../internal/core/CBreakpointManager.java | 23 +++++++++++-------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog index 1f663035882..f0b59f27cd0 100644 --- a/debug/org.eclipse.cdt.debug.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.core/ChangeLog @@ -1,3 +1,8 @@ +2004-11-12 Mikhail Khodjaiants + Apply the breakpoint's condition changes to the associated gdb breakpoint + only if there are differences. + * CBreakpointManager.java + 2004-11-12 Mikhail Khodjaiants Compare breakpoint source handles as pathes. * CDIDebugModel.java diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java index 22300d04767..ae6cc961e4d 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java @@ -353,7 +353,7 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent String condition = breakpoint.getCondition(); String oldCondition = ( delta != null ) ? delta.getAttribute( ICBreakpoint.CONDITION, "" ) : condition; //$NON-NLS-1$ String[] newThreadIs = getThreadNames( breakpoint ); - if ( enabled != oldEnabled ) { + if ( enabled != oldEnabled && enabled != cdiBreakpoint.isEnabled() ) { DebugPlugin.getDefault().asyncExec( new Runnable() { public void run() { try { @@ -366,20 +366,25 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent } if ( ignoreCount != oldIgnoreCount || condition.compareTo( oldCondition ) != 0 || areThreadFiltersChanged( newThreadIs, cdiBreakpoint ) ) { final ICDICondition cdiCondition = cdiTarget.createCondition( ignoreCount, condition, newThreadIs ); - DebugPlugin.getDefault().asyncExec( new Runnable() { - public void run() { - try { - cdiBreakpoint.setCondition( cdiCondition ); + if ( ! cdiCondition.equals( cdiBreakpoint.getCondition() ) ) { + DebugPlugin.getDefault().asyncExec( new Runnable() { + public void run() { + try { + cdiBreakpoint.setCondition( cdiCondition ); + } + catch( CDIException e ) { + } } - catch( CDIException e ) { - } - } - } ); + } ); + } } } catch( CoreException e ) { requestFailed( MessageFormat.format( InternalDebugCoreMessages.getString( "CBreakpointManager.4" ), new String[] { e.getMessage() } ), e ); //$NON-NLS-1$ } + catch( CDIException e ) { + requestFailed( MessageFormat.format( InternalDebugCoreMessages.getString( "CBreakpointManager.4" ), new String[] { e.getMessage() } ), e ); //$NON-NLS-1$ + } } private void handleBreakpointCreatedEvent( final ICDIBreakpoint cdiBreakpoint ) {