mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 01:35:39 +02:00
Fix for bug 76340: CDT hogs Windows input loop when double clicking on a breakpoint.
This commit is contained in:
parent
ce1679aa17
commit
9119f8ed49
3 changed files with 108 additions and 69 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2004-11-10 Mikhail Khodjaiants
|
||||||
|
Fix for bug 76340: CDT hogs Windows input loop when double clicking on a breakpoint.
|
||||||
|
* InternalDebugCoreMessages.properties
|
||||||
|
* CBreakpointManager.java
|
||||||
|
|
||||||
2004-11-09 Mikhail Khodjaiants
|
2004-11-09 Mikhail Khodjaiants
|
||||||
Fix for bug 77275: Disassembly causes Java exception for fn's with 0 bytes fn prologues.
|
Fix for bug 77275: Disassembly causes Java exception for fn's with 0 bytes fn prologues.
|
||||||
* DisassemblyBlock.java
|
* DisassemblyBlock.java
|
||||||
|
|
|
@ -296,19 +296,14 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
||||||
ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint );
|
ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint );
|
||||||
if ( cdiBreakpoint == null ) {
|
if ( cdiBreakpoint == null ) {
|
||||||
if ( breakpoint instanceof ICFunctionBreakpoint )
|
if ( breakpoint instanceof ICFunctionBreakpoint )
|
||||||
cdiBreakpoint = setFunctionBreakpoint( (ICFunctionBreakpoint)breakpoint );
|
setFunctionBreakpoint( (ICFunctionBreakpoint)breakpoint );
|
||||||
else if ( breakpoint instanceof ICAddressBreakpoint )
|
else if ( breakpoint instanceof ICAddressBreakpoint )
|
||||||
cdiBreakpoint = setAddressBreakpoint( (ICAddressBreakpoint)breakpoint );
|
setAddressBreakpoint( (ICAddressBreakpoint)breakpoint );
|
||||||
else if ( breakpoint instanceof ICLineBreakpoint )
|
else if ( breakpoint instanceof ICLineBreakpoint )
|
||||||
cdiBreakpoint = setLineBreakpoint( (ICLineBreakpoint)breakpoint );
|
setLineBreakpoint( (ICLineBreakpoint)breakpoint );
|
||||||
else if ( breakpoint instanceof ICWatchpoint )
|
else if ( breakpoint instanceof ICWatchpoint )
|
||||||
cdiBreakpoint = setWatchpoint( (ICWatchpoint)breakpoint );
|
setWatchpoint( (ICWatchpoint)breakpoint );
|
||||||
}
|
}
|
||||||
if ( cdiBreakpoint == null )
|
|
||||||
return;
|
|
||||||
boolean enabled = breakpoint.isEnabled();
|
|
||||||
if ( !enabled )
|
|
||||||
cdiBreakpoint.setEnabled( false );
|
|
||||||
}
|
}
|
||||||
catch( CoreException e ) {
|
catch( CoreException e ) {
|
||||||
requestFailed( MessageFormat.format( InternalDebugCoreMessages.getString( "CBreakpointManager.0" ), new String[] { e.getMessage() } ), e ); //$NON-NLS-1$
|
requestFailed( MessageFormat.format( InternalDebugCoreMessages.getString( "CBreakpointManager.0" ), new String[] { e.getMessage() } ), e ); //$NON-NLS-1$
|
||||||
|
@ -326,15 +321,18 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void doRemoveBreakpoint( ICBreakpoint breakpoint ) throws DebugException {
|
protected void doRemoveBreakpoint( ICBreakpoint breakpoint ) throws DebugException {
|
||||||
ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint );
|
final ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint );
|
||||||
if ( cdiBreakpoint != null ) {
|
if ( cdiBreakpoint != null ) {
|
||||||
ICDITarget cdiTarget = getCDITarget();
|
final ICDITarget cdiTarget = getCDITarget();
|
||||||
try {
|
DebugPlugin.getDefault().asyncExec( new Runnable() {
|
||||||
cdiTarget.deleteBreakpoints( new ICDIBreakpoint[]{ cdiBreakpoint } );
|
public void run() {
|
||||||
}
|
try {
|
||||||
catch( CDIException e ) {
|
cdiTarget.deleteBreakpoints( new ICDIBreakpoint[]{ cdiBreakpoint } );
|
||||||
targetRequestFailed( MessageFormat.format( InternalDebugCoreMessages.getString( "CBreakpointManager.3" ), new String[] { e.getMessage() } ), e ); //$NON-NLS-1$
|
}
|
||||||
}
|
catch( CDIException e ) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,12 +341,12 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void doChangeBreakpointProperties( ICBreakpoint breakpoint, IMarkerDelta delta ) throws DebugException {
|
protected void doChangeBreakpointProperties( ICBreakpoint breakpoint, IMarkerDelta delta ) throws DebugException {
|
||||||
ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint );
|
final ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint );
|
||||||
if ( cdiBreakpoint == null )
|
if ( cdiBreakpoint == null )
|
||||||
return;
|
return;
|
||||||
ICDITarget cdiTarget = getCDITarget();
|
ICDITarget cdiTarget = getCDITarget();
|
||||||
try {
|
try {
|
||||||
boolean enabled = breakpoint.isEnabled();
|
final boolean enabled = breakpoint.isEnabled();
|
||||||
boolean oldEnabled = ( delta != null ) ? delta.getAttribute( IBreakpoint.ENABLED, true ) : enabled;
|
boolean oldEnabled = ( delta != null ) ? delta.getAttribute( IBreakpoint.ENABLED, true ) : enabled;
|
||||||
int ignoreCount = breakpoint.getIgnoreCount();
|
int ignoreCount = breakpoint.getIgnoreCount();
|
||||||
int oldIgnoreCount = ( delta != null ) ? delta.getAttribute( ICBreakpoint.IGNORE_COUNT, 0 ) : ignoreCount;
|
int oldIgnoreCount = ( delta != null ) ? delta.getAttribute( ICBreakpoint.IGNORE_COUNT, 0 ) : ignoreCount;
|
||||||
|
@ -356,19 +354,32 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
||||||
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 );
|
||||||
if ( enabled != oldEnabled ) {
|
if ( enabled != oldEnabled ) {
|
||||||
cdiBreakpoint.setEnabled( enabled );
|
DebugPlugin.getDefault().asyncExec( new Runnable() {
|
||||||
|
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 ) ) {
|
||||||
ICDICondition cdiCondition = cdiTarget.createCondition( ignoreCount, condition, newThreadIs );
|
final ICDICondition cdiCondition = cdiTarget.createCondition( ignoreCount, condition, newThreadIs );
|
||||||
cdiBreakpoint.setCondition( cdiCondition );
|
DebugPlugin.getDefault().asyncExec( new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
cdiBreakpoint.setCondition( cdiCondition );
|
||||||
|
}
|
||||||
|
catch( CDIException e ) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
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$
|
||||||
}
|
}
|
||||||
catch( CDIException e ) {
|
|
||||||
targetRequestFailed( MessageFormat.format( InternalDebugCoreMessages.getString( "CBreakpointManager.5" ), new String[] { e.getMessage() } ), e ); //$NON-NLS-1$
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleBreakpointCreatedEvent( final ICDIBreakpoint cdiBreakpoint ) {
|
private void handleBreakpointCreatedEvent( final ICDIBreakpoint cdiBreakpoint ) {
|
||||||
|
@ -498,68 +509,93 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private ICDIBreakpoint setFunctionBreakpoint( ICFunctionBreakpoint breakpoint ) throws CDIException, CoreException {
|
private void setLocationBreakpointOnTarget( final ICBreakpoint breakpoint, final ICDITarget target, final ICDILocation location, final ICDICondition condition, final boolean enabled ) {
|
||||||
ICDITarget cdiTarget = getCDITarget();
|
DebugPlugin.getDefault().asyncExec( new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
synchronized ( getBreakpointMap() ) {
|
||||||
|
ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint );
|
||||||
|
if ( cdiBreakpoint == null ) {
|
||||||
|
cdiBreakpoint = target.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, condition, true );
|
||||||
|
if ( !enabled ) {
|
||||||
|
cdiBreakpoint.setEnabled( false );
|
||||||
|
}
|
||||||
|
getBreakpointMap().put( breakpoint, cdiBreakpoint );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch( CDIException e ) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setFunctionBreakpoint( ICFunctionBreakpoint breakpoint ) throws CDIException, CoreException {
|
||||||
|
final boolean enabled = breakpoint.isEnabled();
|
||||||
|
final ICDITarget cdiTarget = getCDITarget();
|
||||||
String function = breakpoint.getFunction();
|
String function = breakpoint.getFunction();
|
||||||
String fileName = (function != null && function.indexOf( "::" ) == -1) ? breakpoint.getFileName() : null; //$NON-NLS-1$
|
String fileName = (function != null && function.indexOf( "::" ) == -1) ? breakpoint.getFileName() : null; //$NON-NLS-1$
|
||||||
ICDILocation location = cdiTarget.createLocation( fileName, function, -1 );
|
final ICDILocation location = cdiTarget.createLocation( fileName, function, -1 );
|
||||||
ICDICondition condition = createCondition( breakpoint );
|
final ICDICondition condition = createCondition( breakpoint );
|
||||||
ICDIBreakpoint cdiBreakpoint = null;
|
setLocationBreakpointOnTarget( breakpoint, cdiTarget, location, condition, enabled );
|
||||||
synchronized ( getBreakpointMap() ) {
|
|
||||||
cdiBreakpoint = cdiTarget.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, condition, true );
|
|
||||||
getBreakpointMap().put( breakpoint, cdiBreakpoint );
|
|
||||||
}
|
|
||||||
return cdiBreakpoint;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ICDIBreakpoint setAddressBreakpoint( ICAddressBreakpoint breakpoint ) throws CDIException, CoreException, NumberFormatException {
|
private void setAddressBreakpoint( ICAddressBreakpoint breakpoint ) throws CDIException, CoreException, NumberFormatException {
|
||||||
ICDIBreakpoint cdiBreakpoint = null;
|
final boolean enabled = breakpoint.isEnabled();
|
||||||
ICDITarget cdiTarget = getCDITarget();
|
final ICDITarget cdiTarget = getCDITarget();
|
||||||
String address = breakpoint.getAddress();
|
String address = breakpoint.getAddress();
|
||||||
if ( address.startsWith( "0x" ) ) { //$NON-NLS-1$
|
if ( address.startsWith( "0x" ) ) { //$NON-NLS-1$
|
||||||
ICDILocation location = cdiTarget.createLocation( new BigInteger ( breakpoint.getAddress().substring( 2 ), 16 ) );
|
final ICDILocation location = cdiTarget.createLocation( new BigInteger ( breakpoint.getAddress().substring( 2 ), 16 ) );
|
||||||
ICDICondition condition = createCondition( breakpoint );
|
final ICDICondition condition = createCondition( breakpoint );
|
||||||
synchronized ( getBreakpointMap() ) {
|
setLocationBreakpointOnTarget( breakpoint, cdiTarget, location, condition, enabled );
|
||||||
cdiBreakpoint = cdiTarget.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, condition, true );
|
|
||||||
getBreakpointMap().put( breakpoint, cdiBreakpoint );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return cdiBreakpoint;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ICDIBreakpoint setLineBreakpoint( ICLineBreakpoint breakpoint ) throws CDIException, CoreException {
|
private void setLineBreakpoint( ICLineBreakpoint breakpoint ) throws CDIException, CoreException {
|
||||||
ICDITarget cdiTarget = getCDITarget();
|
final boolean enabled = breakpoint.isEnabled();
|
||||||
|
final ICDITarget cdiTarget = getCDITarget();
|
||||||
String handle = breakpoint.getSourceHandle();
|
String handle = breakpoint.getSourceHandle();
|
||||||
IPath path = new Path( handle );
|
IPath path = new Path( handle );
|
||||||
if ( path.isValidPath( handle ) ) {
|
if ( path.isValidPath( handle ) ) {
|
||||||
ICDILocation location = cdiTarget.createLocation( path.lastSegment(), null, breakpoint.getLineNumber() );
|
final ICDILocation location = cdiTarget.createLocation( path.lastSegment(), null, breakpoint.getLineNumber() );
|
||||||
ICDICondition condition = createCondition( breakpoint );
|
final ICDICondition condition = createCondition( breakpoint );
|
||||||
ICDIBreakpoint cdiBreakpoint = null;
|
setLocationBreakpointOnTarget( breakpoint, cdiTarget, location, condition, enabled );
|
||||||
synchronized ( getBreakpointMap() ) {
|
|
||||||
cdiBreakpoint = cdiTarget.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, condition, true );
|
|
||||||
getBreakpointMap().put( breakpoint, cdiBreakpoint );
|
|
||||||
}
|
|
||||||
return cdiBreakpoint;
|
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ICDIBreakpoint setWatchpoint( ICWatchpoint watchpoint ) throws CDIException, CoreException {
|
private void setWatchpointOnTarget( final ICWatchpoint watchpoint, final ICDITarget target, final int accessType, final String expression, final ICDICondition condition, final boolean enabled ) {
|
||||||
ICDITarget cdiTarget = getCDITarget();
|
DebugPlugin.getDefault().asyncExec( new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
synchronized ( getBreakpointMap() ) {
|
||||||
|
if ( getBreakpointMap().getCDIBreakpoint( watchpoint ) == null ) {
|
||||||
|
ICDIWatchpoint cdiWatchpoint = target.setWatchpoint( ICDIBreakpoint.REGULAR, accessType, expression, condition );
|
||||||
|
if ( !enabled ) {
|
||||||
|
cdiWatchpoint.setEnabled( false );
|
||||||
|
}
|
||||||
|
getBreakpointMap().put( watchpoint, cdiWatchpoint );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch( CDIException e ) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setWatchpoint( ICWatchpoint watchpoint ) throws CDIException, CoreException {
|
||||||
|
final boolean enabled = watchpoint.isEnabled();
|
||||||
|
final ICDITarget cdiTarget = getCDITarget();
|
||||||
int accessType = 0;
|
int accessType = 0;
|
||||||
accessType |= (watchpoint.isWriteType()) ? ICDIWatchpoint.WRITE : 0;
|
accessType |= (watchpoint.isWriteType()) ? ICDIWatchpoint.WRITE : 0;
|
||||||
accessType |= (watchpoint.isReadType()) ? ICDIWatchpoint.READ : 0;
|
accessType |= (watchpoint.isReadType()) ? ICDIWatchpoint.READ : 0;
|
||||||
String expression = watchpoint.getExpression();
|
final int accessType1 = accessType;
|
||||||
ICDICondition condition = createCondition( watchpoint );
|
final String expression = watchpoint.getExpression();
|
||||||
ICDIWatchpoint cdiWatchpoint = null;
|
final ICDICondition condition = createCondition( watchpoint );
|
||||||
synchronized ( getBreakpointMap() ) {
|
setWatchpointOnTarget( watchpoint, cdiTarget, accessType1, expression, condition, enabled );
|
||||||
cdiWatchpoint = cdiTarget.setWatchpoint( ICDIBreakpoint.REGULAR, accessType, expression, condition );
|
|
||||||
getBreakpointMap().put( watchpoint, cdiWatchpoint );
|
|
||||||
}
|
|
||||||
return cdiWatchpoint;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private BreakpointMap getBreakpointMap() {
|
protected BreakpointMap getBreakpointMap() {
|
||||||
return fMap;
|
return fMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,7 @@
|
||||||
CBreakpointManager.0=Set breakpoint failed. Reason: {0}.
|
CBreakpointManager.0=Set breakpoint failed. Reason: {0}.
|
||||||
CBreakpointManager.1=Set breakpoint failed. Reason: {0}.
|
CBreakpointManager.1=Set breakpoint failed. Reason: {0}.
|
||||||
CBreakpointManager.2=Set breakpoint failed. Reason: {0}.
|
CBreakpointManager.2=Set breakpoint failed. Reason: {0}.
|
||||||
CBreakpointManager.3=Delete breakpoint failed. Reason: {0}.
|
|
||||||
CBreakpointManager.4=Change breakpoint properties failed. Reason: {0}.
|
CBreakpointManager.4=Change breakpoint properties failed. Reason: {0}.
|
||||||
CBreakpointManager.5=Change breakpoint properties failed. Reason: {0}.
|
|
||||||
CGlobalVariableManager.0=Invalid global variables data.
|
CGlobalVariableManager.0=Invalid global variables data.
|
||||||
CExtendedMemoryBlockRetrieval.0=Expression ''{0}'' evaluated to invalid address value: {1}.
|
CExtendedMemoryBlockRetrieval.0=Expression ''{0}'' evaluated to invalid address value: {1}.
|
||||||
DebugConfiguration.0=This debugger no longer supports this operation
|
DebugConfiguration.0=This debugger no longer supports this operation
|
||||||
|
|
Loading…
Add table
Reference in a new issue