mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 09:45:39 +02:00
Bug 79371: Setting breakpoints in the left hand side ruler of the disassembly view is sluggish. Asynchronous breakpoint handling.
This commit is contained in:
parent
c299e7df97
commit
690d999a7c
6 changed files with 630 additions and 569 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2005-07-08 Mikhail Khodjaiants
|
||||||
|
Bug 79371: Setting breakpoints in the left hand side ruler of the disassembly view is sluggish.
|
||||||
|
Asynchronous breakpoint handling.
|
||||||
|
* CBreakpointManager.java
|
||||||
|
* InternalDebugCoreMessages.properties
|
||||||
|
* CDebugTarget.java
|
||||||
|
|
||||||
2005-07-04 Mikhail Khodjaiants
|
2005-07-04 Mikhail Khodjaiants
|
||||||
Removed the "IBreakpointTarget" interface.
|
Removed the "IBreakpointTarget" interface.
|
||||||
- IBreakpointTarget.java
|
- IBreakpointTarget.java
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -8,10 +8,6 @@
|
||||||
# Contributors:
|
# Contributors:
|
||||||
# QNX Software Systems - initial API and implementation
|
# QNX Software Systems - initial API and implementation
|
||||||
###############################################################################
|
###############################################################################
|
||||||
CBreakpointManager.0=Set breakpoint failed. Reason: {0}.
|
|
||||||
CBreakpointManager.1=Set breakpoint failed. Reason: {0}.
|
|
||||||
CBreakpointManager.2=Set breakpoint failed. Reason: {0}.
|
|
||||||
CBreakpointManager.4=Change breakpoint properties failed. Reason: {0}.
|
|
||||||
CGlobalVariableManager.0=Invalid global variables data.
|
CGlobalVariableManager.0=Invalid global variables data.
|
||||||
CMemoryBlockRetrievalExtension.0=Expression ''{0}'' evaluated to invalid address value: {1}.
|
CMemoryBlockRetrievalExtension.0=Expression ''{0}'' evaluated to invalid address value: {1}.
|
||||||
CMemoryBlockRetrievalExtension.1=Invalid expression type: ''{0}''
|
CMemoryBlockRetrievalExtension.1=Invalid expression type: ''{0}''
|
||||||
|
|
|
@ -12,7 +12,6 @@ package org.eclipse.cdt.debug.internal.core.model;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
@ -60,7 +59,6 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDITargetConfiguration;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor;
|
||||||
import org.eclipse.cdt.debug.core.model.CDebugElementState;
|
import org.eclipse.cdt.debug.core.model.CDebugElementState;
|
||||||
import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint;
|
|
||||||
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
|
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.model.ICDebugElement;
|
import org.eclipse.cdt.debug.core.model.ICDebugElement;
|
||||||
import org.eclipse.cdt.debug.core.model.ICDebugElementStatus;
|
import org.eclipse.cdt.debug.core.model.ICDebugElementStatus;
|
||||||
|
@ -87,7 +85,6 @@ import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants;
|
||||||
import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceLookupParticipant;
|
import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceLookupParticipant;
|
||||||
import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceManager;
|
import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceManager;
|
||||||
import org.eclipse.core.resources.IContainer;
|
import org.eclipse.core.resources.IContainer;
|
||||||
import org.eclipse.core.resources.IFile;
|
|
||||||
import org.eclipse.core.resources.IMarkerDelta;
|
import org.eclipse.core.resources.IMarkerDelta;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IResourceChangeListener;
|
import org.eclipse.core.resources.IResourceChangeListener;
|
||||||
|
@ -103,7 +100,6 @@ import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
|
||||||
import org.eclipse.debug.core.DebugEvent;
|
import org.eclipse.debug.core.DebugEvent;
|
||||||
import org.eclipse.debug.core.DebugException;
|
import org.eclipse.debug.core.DebugException;
|
||||||
import org.eclipse.debug.core.DebugPlugin;
|
import org.eclipse.debug.core.DebugPlugin;
|
||||||
import org.eclipse.debug.core.IBreakpointManager;
|
|
||||||
import org.eclipse.debug.core.IExpressionListener;
|
import org.eclipse.debug.core.IExpressionListener;
|
||||||
import org.eclipse.debug.core.IExpressionManager;
|
import org.eclipse.debug.core.IExpressionManager;
|
||||||
import org.eclipse.debug.core.ILaunch;
|
import org.eclipse.debug.core.ILaunch;
|
||||||
|
@ -265,8 +261,8 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeBreakpoints() {
|
private void initializeBreakpoints() {
|
||||||
DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener( this );
|
getBreakpointManager().initialize();
|
||||||
setBreakpoints();
|
getBreakpointManager().setBreakpoints();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -299,27 +295,6 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Installs all C/C++ breakpoints that currently exist in the breakpoint manager.
|
|
||||||
*/
|
|
||||||
public void setBreakpoints() {
|
|
||||||
IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager();
|
|
||||||
IBreakpoint[] bps = manager.getBreakpoints( CDIDebugModel.getPluginIdentifier() );
|
|
||||||
for( int i = 0; i < bps.length; i++ ) {
|
|
||||||
if ( bps[i] instanceof ICBreakpoint && getBreakpointManager().isTargetBreakpoint( (ICBreakpoint)bps[i] ) && !getBreakpointManager().isCDIRegistered( (ICBreakpoint)bps[i] ) ) {
|
|
||||||
if ( bps[i] instanceof ICAddressBreakpoint ) {
|
|
||||||
// disable address breakpoints to prevent the debugger to insert them prematurely
|
|
||||||
try {
|
|
||||||
bps[i].setEnabled( false );
|
|
||||||
}
|
|
||||||
catch( CoreException e ) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
breakpointAdded0( bps[i] );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void initializeRegisters() {
|
protected void initializeRegisters() {
|
||||||
getRegisterManager().initialize();
|
getRegisterManager().initialize();
|
||||||
}
|
}
|
||||||
|
@ -421,7 +396,7 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
|
||||||
public boolean supportsBreakpoint( IBreakpoint breakpoint ) {
|
public boolean supportsBreakpoint( IBreakpoint breakpoint ) {
|
||||||
if ( !getConfiguration().supportsBreakpoints() )
|
if ( !getConfiguration().supportsBreakpoints() )
|
||||||
return false;
|
return false;
|
||||||
return (breakpoint instanceof ICBreakpoint && getBreakpointManager().isCDIRegistered( (ICBreakpoint)breakpoint ));
|
return (breakpoint instanceof ICBreakpoint && getBreakpointManager().supportsBreakpoint( (ICBreakpoint)breakpoint ));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -626,74 +601,18 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
|
||||||
* @see org.eclipse.debug.core.IBreakpointListener#breakpointAdded(org.eclipse.debug.core.model.IBreakpoint)
|
* @see org.eclipse.debug.core.IBreakpointListener#breakpointAdded(org.eclipse.debug.core.model.IBreakpoint)
|
||||||
*/
|
*/
|
||||||
public void breakpointAdded( IBreakpoint breakpoint ) {
|
public void breakpointAdded( IBreakpoint breakpoint ) {
|
||||||
if ( !(breakpoint instanceof ICBreakpoint) || !isAvailable() || !getBreakpointManager().isTargetBreakpoint( (ICBreakpoint)breakpoint ) )
|
|
||||||
return;
|
|
||||||
breakpointAdded0( breakpoint );
|
|
||||||
}
|
|
||||||
|
|
||||||
private void breakpointAdded0( IBreakpoint breakpoint ) {
|
|
||||||
if ( !isAvailable() )
|
|
||||||
return;
|
|
||||||
if ( breakpoint instanceof ICAddressBreakpoint && !getBreakpointManager().supportsAddressBreakpoint( (ICAddressBreakpoint)breakpoint ) )
|
|
||||||
return;
|
|
||||||
if ( getConfiguration().supportsBreakpoints() ) {
|
|
||||||
try {
|
|
||||||
getBreakpointManager().setBreakpoint( (ICBreakpoint)breakpoint );
|
|
||||||
}
|
|
||||||
catch( DebugException e ) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.debug.core.IBreakpointListener#breakpointRemoved(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.resources.IMarkerDelta)
|
* @see org.eclipse.debug.core.IBreakpointListener#breakpointRemoved(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.resources.IMarkerDelta)
|
||||||
*/
|
*/
|
||||||
public void breakpointRemoved( IBreakpoint breakpoint, IMarkerDelta delta ) {
|
public void breakpointRemoved( IBreakpoint breakpoint, IMarkerDelta delta ) {
|
||||||
if ( !(breakpoint instanceof ICBreakpoint) || !isAvailable() || !getBreakpointManager().isCDIRegistered( (ICBreakpoint)breakpoint ) )
|
|
||||||
return;
|
|
||||||
try {
|
|
||||||
getBreakpointManager().removeBreakpoint( (ICBreakpoint)breakpoint );
|
|
||||||
}
|
|
||||||
catch( DebugException e ) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.debug.core.IBreakpointListener#breakpointChanged(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.resources.IMarkerDelta)
|
* @see org.eclipse.debug.core.IBreakpointListener#breakpointChanged(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.resources.IMarkerDelta)
|
||||||
*/
|
*/
|
||||||
public void breakpointChanged( IBreakpoint breakpoint, IMarkerDelta delta ) {
|
public void breakpointChanged( IBreakpoint breakpoint, IMarkerDelta delta ) {
|
||||||
if ( !(breakpoint instanceof ICBreakpoint) || !isAvailable() )
|
|
||||||
return;
|
|
||||||
ICBreakpoint b = (ICBreakpoint)breakpoint;
|
|
||||||
boolean install = false;
|
|
||||||
try {
|
|
||||||
ICDebugTarget[] tfs = b.getTargetFilters();
|
|
||||||
install = Arrays.asList( tfs ).contains( this );
|
|
||||||
}
|
|
||||||
catch( CoreException e ) {
|
|
||||||
}
|
|
||||||
boolean registered = getBreakpointManager().isCDIRegistered( b );
|
|
||||||
if ( registered && !install ) {
|
|
||||||
try {
|
|
||||||
getBreakpointManager().removeBreakpoint( b );
|
|
||||||
}
|
|
||||||
catch( DebugException e ) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ( !registered && install ) {
|
|
||||||
try {
|
|
||||||
getBreakpointManager().setBreakpoint( b );
|
|
||||||
}
|
|
||||||
catch( DebugException e ) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// if ( delta != null ) {
|
|
||||||
try {
|
|
||||||
getBreakpointManager().changeBreakpointProperties( b, delta );
|
|
||||||
}
|
|
||||||
catch( DebugException e ) {
|
|
||||||
}
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -986,7 +905,6 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
|
||||||
resetStatus();
|
resetStatus();
|
||||||
removeAllThreads();
|
removeAllThreads();
|
||||||
getCDISession().getEventManager().removeEventListener( this );
|
getCDISession().getEventManager().removeEventListener( this );
|
||||||
DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener( this );
|
|
||||||
DebugPlugin.getDefault().getExpressionManager().removeExpressionListener( this );
|
DebugPlugin.getDefault().getExpressionManager().removeExpressionListener( this );
|
||||||
DebugPlugin.getDefault().getLaunchManager().removeLaunchListener( this );
|
DebugPlugin.getDefault().getLaunchManager().removeLaunchListener( this );
|
||||||
saveGlobalVariables();
|
saveGlobalVariables();
|
||||||
|
@ -1133,17 +1051,9 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleWatchpointScope( ICDIWatchpointScope ws ) {
|
private void handleWatchpointScope( ICDIWatchpointScope ws ) {
|
||||||
ICBreakpoint watchpoint = getBreakpointManager().getBreakpoint( ws.getWatchpoint() );
|
getBreakpointManager().watchpointOutOfScope( ws.getWatchpoint() );
|
||||||
if ( watchpoint != null ) {
|
|
||||||
try {
|
|
||||||
getBreakpointManager().removeBreakpoint( watchpoint );
|
|
||||||
}
|
|
||||||
catch( DebugException e ) {
|
|
||||||
CDebugCorePlugin.log( e );
|
|
||||||
}
|
|
||||||
fireSuspendEvent( DebugEvent.BREAKPOINT );
|
fireSuspendEvent( DebugEvent.BREAKPOINT );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void handleSuspendedBySignal( ICDISignalReceived signal ) {
|
private void handleSuspendedBySignal( ICDISignalReceived signal ) {
|
||||||
fireSuspendEvent( DebugEvent.UNSPECIFIED );
|
fireSuspendEvent( DebugEvent.UNSPECIFIED );
|
||||||
|
@ -1481,16 +1391,6 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
|
||||||
getMemoryBlockRetrieval().dispose();
|
getMemoryBlockRetrieval().dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IFile getCurrentBreakpointFile() {
|
|
||||||
Object info = getCurrentStateInfo();
|
|
||||||
if ( info instanceof ICDIBreakpointHit ) {
|
|
||||||
ICDIBreakpoint cdiBreakpoint = ((ICDIBreakpointHit)info).getBreakpoint();
|
|
||||||
if ( cdiBreakpoint != null )
|
|
||||||
return getBreakpointManager().getCDIBreakpointFile( cdiBreakpoint );
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected CBreakpointManager getBreakpointManager() {
|
protected CBreakpointManager getBreakpointManager() {
|
||||||
return fBreakpointManager;
|
return fBreakpointManager;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2005-07-08 Mikhail Khodjaiants
|
||||||
|
Bug 79371: Setting breakpoints in the left hand side ruler of the disassembly view is sluggish.
|
||||||
|
Asynchronous breakpoint handling.
|
||||||
|
* DisassemblyEditorInput.java
|
||||||
|
|
||||||
2005-07-04 Mikhail Khodjaiants
|
2005-07-04 Mikhail Khodjaiants
|
||||||
Removed the "IBreakpointTarget" interface.
|
Removed the "IBreakpointTarget" interface.
|
||||||
* DisassemblyEditorInput.java
|
* DisassemblyEditorInput.java
|
||||||
|
|
|
@ -153,7 +153,7 @@ public class DisassemblyEditorInput implements IEditorInput {
|
||||||
if ( target != null ) {
|
if ( target != null ) {
|
||||||
try {
|
try {
|
||||||
IAddress address = target.getBreakpointAddress( breakpoint );
|
IAddress address = target.getBreakpointAddress( breakpoint );
|
||||||
if ( ! address.isZero() )
|
if ( address != null && !address.isZero() )
|
||||||
return getInstructionLine( address );
|
return getInstructionLine( address );
|
||||||
}
|
}
|
||||||
catch( DebugException e ) {
|
catch( DebugException e ) {
|
||||||
|
@ -332,7 +332,8 @@ public class DisassemblyEditorInput implements IEditorInput {
|
||||||
if ( bps[i] instanceof ICLineBreakpoint ) {
|
if ( bps[i] instanceof ICLineBreakpoint ) {
|
||||||
ICLineBreakpoint b = (ICLineBreakpoint)bps[i];
|
ICLineBreakpoint b = (ICLineBreakpoint)bps[i];
|
||||||
try {
|
try {
|
||||||
if ( address.compareTo(bt.getBreakpointAddress( b )) == 0)
|
IAddress a = bt.getBreakpointAddress( b );
|
||||||
|
if ( a != null && address.compareTo( a ) == 0 )
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
catch( NumberFormatException e ) {
|
catch( NumberFormatException e ) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue