mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
Partial fix for bug 79371: Setting breakpoints in the left hand side ruler of the disassembly view is sluggish.
This commit is contained in:
parent
4da0ae86ac
commit
3915950c5d
2 changed files with 54 additions and 21 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2005-06-16 Mikhail Khodjaiants
|
||||||
|
Partial fix for bug 79371: Setting breakpoints in the left hand side ruler of the disassembly view is sluggish.
|
||||||
|
* CBreakpointManager.java
|
||||||
|
|
||||||
2005-06-14 Mikhail Khodjaiants
|
2005-06-14 Mikhail Khodjaiants
|
||||||
Bug 98814: NullPointerException and failed to launch debug session for a project.
|
Bug 98814: NullPointerException and failed to launch debug session for a project.
|
||||||
* CDebugTarget.java
|
* CDebugTarget.java
|
||||||
|
|
|
@ -18,7 +18,6 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import org.eclipse.cdt.core.IAddress;
|
import org.eclipse.cdt.core.IAddress;
|
||||||
import org.eclipse.cdt.core.IAddressFactory;
|
|
||||||
import org.eclipse.cdt.debug.core.CDIDebugModel;
|
import org.eclipse.cdt.debug.core.CDIDebugModel;
|
||||||
import org.eclipse.cdt.debug.core.CDebugUtils;
|
import org.eclipse.cdt.debug.core.CDebugUtils;
|
||||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||||
|
@ -96,11 +95,11 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
||||||
fCDIBreakpoints.put( cdiBreakpoint, breakpoint );
|
fCDIBreakpoints.put( cdiBreakpoint, breakpoint );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected synchronized ICDIBreakpoint getCDIBreakpoint( ICBreakpoint breakpoint ) {
|
protected ICDIBreakpoint getCDIBreakpoint( ICBreakpoint breakpoint ) {
|
||||||
return (ICDIBreakpoint)fCBreakpoints.get( breakpoint );
|
return (ICDIBreakpoint)fCBreakpoints.get( breakpoint );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected synchronized ICBreakpoint getCBreakpoint( ICDIBreakpoint cdiBreakpoint ) {
|
protected ICBreakpoint getCBreakpoint( ICDIBreakpoint cdiBreakpoint ) {
|
||||||
return (ICBreakpoint)fCDIBreakpoints.get( cdiBreakpoint );
|
return (ICBreakpoint)fCDIBreakpoints.get( cdiBreakpoint );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,18 +275,25 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
||||||
return getBreakpointMap().getCBreakpoint( cdiBreakpoint );
|
return getBreakpointMap().getCBreakpoint( cdiBreakpoint );
|
||||||
}
|
}
|
||||||
|
|
||||||
public IAddress getBreakpointAddress( ICBreakpoint breakpoint ) {
|
public IAddress getBreakpointAddress( ICLineBreakpoint breakpoint ) {
|
||||||
if ( breakpoint != null ) {
|
if ( breakpoint != null ) {
|
||||||
ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint );
|
try {
|
||||||
if ( cdiBreakpoint instanceof ICDILocationBreakpoint ) {
|
return fDebugTarget.getAddressFactory().createAddress( breakpoint.getAddress() );
|
||||||
ICDILocator locator = ((ICDILocationBreakpoint)cdiBreakpoint).getLocator();
|
|
||||||
if ( locator != null ) {
|
|
||||||
IAddressFactory factory = getDebugTarget().getAddressFactory();
|
|
||||||
BigInteger address = locator.getAddress();
|
|
||||||
if ( address != null )
|
|
||||||
return factory.createAddress( address );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
catch( CoreException e ) {
|
||||||
|
}
|
||||||
|
catch( NumberFormatException e ) {
|
||||||
|
}
|
||||||
|
// ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint );
|
||||||
|
// if ( cdiBreakpoint instanceof ICDILocationBreakpoint ) {
|
||||||
|
// ICDILocator locator = ((ICDILocationBreakpoint)cdiBreakpoint).getLocator();
|
||||||
|
// if ( locator != null ) {
|
||||||
|
// IAddressFactory factory = getDebugTarget().getAddressFactory();
|
||||||
|
// BigInteger address = locator.getAddress();
|
||||||
|
// if ( address != null )
|
||||||
|
// return factory.createAddress( address );
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
return fDebugTarget.getAddressFactory().getZero();
|
return fDebugTarget.getAddressFactory().getZero();
|
||||||
}
|
}
|
||||||
|
@ -425,6 +431,19 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
||||||
breakpoint = createLocationBreakpoint( cdiBreakpoint );
|
breakpoint = createLocationBreakpoint( cdiBreakpoint );
|
||||||
}
|
}
|
||||||
if ( breakpoint != null ) {
|
if ( breakpoint != null ) {
|
||||||
|
try {
|
||||||
|
if ( breakpoint instanceof ICLineBreakpoint ) {
|
||||||
|
ICDILocator locator = cdiBreakpoint.getLocator();
|
||||||
|
if ( locator != null ) {
|
||||||
|
BigInteger address = locator.getAddress();
|
||||||
|
if ( address != null ) {
|
||||||
|
((ICLineBreakpoint)breakpoint).setAddress( address.toString() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch( CoreException e1 ) {
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
breakpoint.setTargetFilter( getDebugTarget() );
|
breakpoint.setTargetFilter( getDebugTarget() );
|
||||||
}
|
}
|
||||||
|
@ -516,8 +535,10 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
||||||
DebugPlugin.getDefault().asyncExec( new Runnable() {
|
DebugPlugin.getDefault().asyncExec( new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
|
// FIXME: Shouldn't be doing this. The breakpoint management needs to be redesigned.
|
||||||
|
ICDIBreakpoint cdiBreakpoint = null;
|
||||||
synchronized ( getBreakpointMap() ) {
|
synchronized ( getBreakpointMap() ) {
|
||||||
ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint );
|
cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint );
|
||||||
if ( cdiBreakpoint == null ) {
|
if ( cdiBreakpoint == null ) {
|
||||||
if ( breakpoint instanceof ICFunctionBreakpoint ) {
|
if ( breakpoint instanceof ICFunctionBreakpoint ) {
|
||||||
cdiBreakpoint = target.setFunctionBreakpoint( ICDIBreakpoint.REGULAR,
|
cdiBreakpoint = target.setFunctionBreakpoint( ICDIBreakpoint.REGULAR,
|
||||||
|
@ -530,12 +551,12 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
||||||
cdiBreakpoint = target.setLineBreakpoint( ICDIBreakpoint.REGULAR,
|
cdiBreakpoint = target.setLineBreakpoint( ICDIBreakpoint.REGULAR,
|
||||||
(ICDILineLocation)location, condition, true );
|
(ICDILineLocation)location, condition, true );
|
||||||
}
|
}
|
||||||
if ( !enabled ) {
|
|
||||||
cdiBreakpoint.setEnabled( false );
|
|
||||||
}
|
|
||||||
getBreakpointMap().put( breakpoint, cdiBreakpoint );
|
getBreakpointMap().put( breakpoint, cdiBreakpoint );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ( cdiBreakpoint != null && !enabled ) {
|
||||||
|
cdiBreakpoint.setEnabled( false );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch( CDIException e ) {
|
catch( CDIException e ) {
|
||||||
}
|
}
|
||||||
|
@ -578,15 +599,16 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
||||||
DebugPlugin.getDefault().asyncExec( new Runnable() {
|
DebugPlugin.getDefault().asyncExec( new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
|
ICDIWatchpoint cdiWatchpoint = null;
|
||||||
synchronized ( getBreakpointMap() ) {
|
synchronized ( getBreakpointMap() ) {
|
||||||
if ( getBreakpointMap().getCDIBreakpoint( watchpoint ) == null ) {
|
if ( getBreakpointMap().getCDIBreakpoint( watchpoint ) == null ) {
|
||||||
ICDIWatchpoint cdiWatchpoint = target.setWatchpoint( ICDIBreakpoint.REGULAR, accessType, expression, condition );
|
cdiWatchpoint = target.setWatchpoint( ICDIBreakpoint.REGULAR, accessType, expression, condition );
|
||||||
if ( !enabled ) {
|
|
||||||
cdiWatchpoint.setEnabled( false );
|
|
||||||
}
|
|
||||||
getBreakpointMap().put( watchpoint, cdiWatchpoint );
|
getBreakpointMap().put( watchpoint, cdiWatchpoint );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ( !enabled ) {
|
||||||
|
cdiWatchpoint.setEnabled( false );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch( CDIException e ) {
|
catch( CDIException e ) {
|
||||||
}
|
}
|
||||||
|
@ -671,6 +693,13 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
||||||
cdiBreakpoint.getCondition().getIgnoreCount(),
|
cdiBreakpoint.getCondition().getIgnoreCount(),
|
||||||
cdiBreakpoint.getCondition().getExpression(),
|
cdiBreakpoint.getCondition().getExpression(),
|
||||||
false );
|
false );
|
||||||
|
ICDILocator locator = cdiBreakpoint.getLocator();
|
||||||
|
if ( locator != null ) {
|
||||||
|
BigInteger address = locator.getAddress();
|
||||||
|
if ( address != null ) {
|
||||||
|
breakpoint.setAddress( address.toString() );
|
||||||
|
}
|
||||||
|
}
|
||||||
getBreakpointMap().put( breakpoint, cdiBreakpoint );
|
getBreakpointMap().put( breakpoint, cdiBreakpoint );
|
||||||
((CBreakpoint)breakpoint).register( true );
|
((CBreakpoint)breakpoint).register( true );
|
||||||
return breakpoint;
|
return breakpoint;
|
||||||
|
|
Loading…
Add table
Reference in a new issue