mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Fixes for breakpoint filtering.
This commit is contained in:
parent
c656bd7009
commit
bdcd736bb3
7 changed files with 42 additions and 23 deletions
|
@ -1,3 +1,9 @@
|
|||
2004-09-10 Mikhail Khodjaiants
|
||||
Fixes for breakpoint filtering.
|
||||
* CBreakpointManager.java
|
||||
* CBreakpoint.java
|
||||
* CDebugTarget.java
|
||||
|
||||
2004-09-09 Alain Magloire
|
||||
Introduction of new classes in the CDI interface
|
||||
* ICDIExecuteStep.java
|
||||
|
|
|
@ -291,7 +291,6 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
|||
}
|
||||
if ( cdiBreakpoint == null )
|
||||
return;
|
||||
breakpoint.setTargetFilter( getDebugTarget() );
|
||||
boolean enabled = breakpoint.isEnabled();
|
||||
setBreakpointCondition( breakpoint );
|
||||
if ( !enabled )
|
||||
|
@ -318,14 +317,10 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
|||
ICDITarget cdiTarget = getCDITarget();
|
||||
try {
|
||||
cdiTarget.deleteBreakpoints( new ICDIBreakpoint[]{ cdiBreakpoint } );
|
||||
breakpoint.removeTargetFilter( getDebugTarget() );
|
||||
}
|
||||
catch( CDIException e ) {
|
||||
targetRequestFailed( MessageFormat.format( InternalDebugCoreMessages.getString( "CBreakpointManager.3" ), new String[] { e.getMessage() } ), e ); //$NON-NLS-1$
|
||||
}
|
||||
catch( CoreException e ) {
|
||||
DebugPlugin.log( e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -384,6 +379,11 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
|||
breakpoint = createLocationBreakpoint( cdiBreakpoint );
|
||||
}
|
||||
if ( breakpoint != null ) {
|
||||
try {
|
||||
breakpoint.setTargetFilter( getDebugTarget() );
|
||||
}
|
||||
catch( CoreException e ) {
|
||||
}
|
||||
getBreakpointNotifier().breakpointInstalled( getDebugTarget(), breakpoint );
|
||||
}
|
||||
}
|
||||
|
@ -409,6 +409,11 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
|||
getBreakpointMap().removeCDIBreakpoint( cdiBreakpoint );
|
||||
if ( breakpoint != null ) {
|
||||
if ( isFilteredByTarget( breakpoint, getDebugTarget() ) ) {
|
||||
try {
|
||||
breakpoint.removeTargetFilter( getDebugTarget() );
|
||||
}
|
||||
catch( CoreException e ) {
|
||||
}
|
||||
getBreakpointNotifier().breakpointRemoved( getDebugTarget(), breakpoint );
|
||||
}
|
||||
else {
|
||||
|
@ -695,7 +700,7 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
|||
boolean result = false;
|
||||
try {
|
||||
ICDebugTarget[] tfs = breakpoint.getTargetFilters();
|
||||
result = Arrays.asList( tfs ).contains( this );
|
||||
result = Arrays.asList( tfs ).contains( target );
|
||||
}
|
||||
catch( CoreException e1 ) {
|
||||
}
|
||||
|
|
|
@ -304,7 +304,6 @@ public abstract class CBreakpoint extends Breakpoint implements ICBreakpoint, ID
|
|||
public void removeTargetFilter( ICDebugTarget target ) throws CoreException {
|
||||
if ( fFilteredThreadsByTarget.containsKey( target ) ) {
|
||||
fFilteredThreadsByTarget.remove( target );
|
||||
fireChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -331,7 +330,6 @@ public abstract class CBreakpoint extends Breakpoint implements ICBreakpoint, ID
|
|||
*/
|
||||
public void setTargetFilter( ICDebugTarget target ) throws CoreException {
|
||||
fFilteredThreadsByTarget.put( target, null );
|
||||
fireChanged();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -348,7 +346,7 @@ public abstract class CBreakpoint extends Breakpoint implements ICBreakpoint, ID
|
|||
* does not exist, do not fire a change notificaiton (the marker may not
|
||||
* exist if the associated project was closed).
|
||||
*/
|
||||
protected void fireChanged() {
|
||||
public void fireChanged() {
|
||||
if ( markerExists() ) {
|
||||
DebugPlugin.getDefault().getBreakpointManager().fireBreakpointChanged( this );
|
||||
}
|
||||
|
|
|
@ -654,7 +654,7 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
|
|||
ICDebugTarget[] tfs = b.getTargetFilters();
|
||||
install = Arrays.asList( tfs ).contains( this );
|
||||
}
|
||||
catch( CoreException e1 ) {
|
||||
catch( CoreException e ) {
|
||||
}
|
||||
boolean registered = getBreakpointManager().isCDIRegistered( b );
|
||||
if ( registered && !install ) {
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2004-09-10 Mikhail Khodjaiants
|
||||
Fixes for breakpoint filtering.
|
||||
* CBreakpointUpdater.java
|
||||
* ThreadFilterEditor.java
|
||||
|
||||
2004-09-01 Mikhail Khodjaiants
|
||||
Fix for bug 73197: DisassemblyEditorInput.getAddress can crash.
|
||||
* DisassemblyEditorInput.java
|
||||
|
|
|
@ -13,6 +13,7 @@ package org.eclipse.cdt.debug.internal.ui;
|
|||
import java.util.Map;
|
||||
import org.eclipse.cdt.debug.core.ICBreakpointListener;
|
||||
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
|
||||
import org.eclipse.cdt.debug.core.model.ICDebugTarget;
|
||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.debug.core.DebugPlugin;
|
||||
|
@ -51,19 +52,22 @@ public class CBreakpointUpdater implements ICBreakpointListener {
|
|||
* @see org.eclipse.cdt.debug.core.ICBreakpointListener#breakpointInstalled(org.eclipse.debug.core.model.IDebugTarget,
|
||||
* org.eclipse.debug.core.model.IBreakpoint)
|
||||
*/
|
||||
public void breakpointInstalled( IDebugTarget target, final IBreakpoint breakpoint ) {
|
||||
asyncExec( new Runnable() {
|
||||
|
||||
public void run() {
|
||||
try {
|
||||
if ( ((ICBreakpoint)breakpoint).incrementInstallCount() == 1 )
|
||||
DebugPlugin.getDefault().getBreakpointManager().fireBreakpointChanged( breakpoint );
|
||||
}
|
||||
catch( CoreException e ) {
|
||||
CDebugUIPlugin.log( e.getStatus() );
|
||||
}
|
||||
}
|
||||
} );
|
||||
public void breakpointInstalled( final IDebugTarget target, IBreakpoint breakpoint ) {
|
||||
if ( breakpoint instanceof ICBreakpoint && target instanceof ICDebugTarget ) {
|
||||
final ICBreakpoint b = (ICBreakpoint)breakpoint;
|
||||
asyncExec( new Runnable() {
|
||||
|
||||
public void run() {
|
||||
try {
|
||||
if ( b.incrementInstallCount() == 1 )
|
||||
DebugPlugin.getDefault().getBreakpointManager().fireBreakpointChanged( b );
|
||||
}
|
||||
catch( CoreException e ) {
|
||||
CDebugUIPlugin.log( e.getStatus() );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -320,6 +320,7 @@ public class ThreadFilterEditor {
|
|||
else {
|
||||
breakpoint.removeTargetFilter( (ICDebugTarget)targets[i] );
|
||||
}
|
||||
DebugPlugin.getDefault().getBreakpointManager().fireBreakpointChanged( breakpoint );
|
||||
}
|
||||
catch( CoreException e ) {
|
||||
DebugUIPlugin.log( e );
|
||||
|
|
Loading…
Add table
Reference in a new issue