1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Partial fix for bug 39936 GDB hits modified conditional breakpoints when condition not satisfied.

Condition has to be set at the mi level.
This commit is contained in:
Mikhail Khodjaiants 2004-10-14 19:30:50 +00:00
parent 8d2f716193
commit a17fa3fe67
2 changed files with 13 additions and 12 deletions

View file

@ -1,3 +1,8 @@
2004-10-14 Mikhail Khodjaiants
Partial fix for bug 39936 GDB hits modified conditional breakpoints when condition not satisfied.
Condition has to be set at the mi level.
* CBreakpointManager.java
2004-10-08 Mikhail Khodjaiants
Added the launch configuration preference for the register bookkeeping.
* ICDTLaunchConfigurationConstants.java

View file

@ -298,7 +298,6 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
if ( cdiBreakpoint == null )
return;
boolean enabled = breakpoint.isEnabled();
setBreakpointCondition( breakpoint );
if ( !enabled )
cdiBreakpoint.setEnabled( false );
}
@ -494,9 +493,10 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
String function = breakpoint.getFunction();
String fileName = (function != null && function.indexOf( "::" ) == -1) ? breakpoint.getFileName() : null; //$NON-NLS-1$
ICDILocation location = cdiTarget.createLocation( fileName, function, -1 );
ICDICondition condition = cdiTarget.createCondition( breakpoint.getIgnoreCount(), breakpoint.getCondition() );
ICDIBreakpoint cdiBreakpoint = null;
synchronized ( getBreakpointMap() ) {
cdiBreakpoint = cdiTarget.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, null, null, true );
cdiBreakpoint = cdiTarget.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, condition, null, true );
getBreakpointMap().put( breakpoint, cdiBreakpoint );
}
return cdiBreakpoint;
@ -508,8 +508,9 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
String address = breakpoint.getAddress();
if ( address.startsWith( "0x" ) ) { //$NON-NLS-1$
ICDILocation location = cdiTarget.createLocation( new BigInteger ( breakpoint.getAddress().substring( 2 ), 16 ) );
ICDICondition condition = cdiTarget.createCondition( breakpoint.getIgnoreCount(), breakpoint.getCondition() );
synchronized ( getBreakpointMap() ) {
cdiBreakpoint = cdiTarget.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, null, null, true );
cdiBreakpoint = cdiTarget.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, condition, null, true );
getBreakpointMap().put( breakpoint, cdiBreakpoint );
}
}
@ -519,9 +520,10 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
private ICDIBreakpoint setLineBreakpoint( ICLineBreakpoint breakpoint ) throws CDIException, CoreException {
ICDITarget cdiTarget = getCDITarget();
ICDILocation location = cdiTarget.createLocation( breakpoint.getMarker().getResource().getLocation().lastSegment(), null, breakpoint.getLineNumber() );
ICDICondition condition = cdiTarget.createCondition( breakpoint.getIgnoreCount(), breakpoint.getCondition() );
ICDIBreakpoint cdiBreakpoint = null;
synchronized ( getBreakpointMap() ) {
cdiBreakpoint = cdiTarget.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, null, null, true );
cdiBreakpoint = cdiTarget.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, condition, null, true );
getBreakpointMap().put( breakpoint, cdiBreakpoint );
}
return cdiBreakpoint;
@ -533,21 +535,15 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
accessType |= (watchpoint.isWriteType()) ? ICDIWatchpoint.WRITE : 0;
accessType |= (watchpoint.isReadType()) ? ICDIWatchpoint.READ : 0;
String expression = watchpoint.getExpression();
ICDICondition condition = cdiTarget.createCondition( watchpoint.getIgnoreCount(), watchpoint.getCondition() );
ICDIWatchpoint cdiWatchpoint = null;
synchronized ( getBreakpointMap() ) {
cdiWatchpoint = cdiTarget.setWatchpoint( ICDIBreakpoint.REGULAR, accessType, expression, null );
cdiWatchpoint = cdiTarget.setWatchpoint( ICDIBreakpoint.REGULAR, accessType, expression, condition );
getBreakpointMap().put( watchpoint, cdiWatchpoint );
}
return cdiWatchpoint;
}
private void setBreakpointCondition( ICBreakpoint breakpoint ) throws CoreException, CDIException {
ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint );
ICDITarget cdiTarget = getCDITarget();
ICDICondition condition = cdiTarget.createCondition( breakpoint.getIgnoreCount(), breakpoint.getCondition() );
cdiBreakpoint.setCondition( condition );
}
private BreakpointMap getBreakpointMap() {
return fMap;
}