mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-13 11:15:38 +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:
parent
8d2f716193
commit
a17fa3fe67
2 changed files with 13 additions and 12 deletions
|
@ -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
|
2004-10-08 Mikhail Khodjaiants
|
||||||
Added the launch configuration preference for the register bookkeeping.
|
Added the launch configuration preference for the register bookkeeping.
|
||||||
* ICDTLaunchConfigurationConstants.java
|
* ICDTLaunchConfigurationConstants.java
|
||||||
|
|
|
@ -298,7 +298,6 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
||||||
if ( cdiBreakpoint == null )
|
if ( cdiBreakpoint == null )
|
||||||
return;
|
return;
|
||||||
boolean enabled = breakpoint.isEnabled();
|
boolean enabled = breakpoint.isEnabled();
|
||||||
setBreakpointCondition( breakpoint );
|
|
||||||
if ( !enabled )
|
if ( !enabled )
|
||||||
cdiBreakpoint.setEnabled( false );
|
cdiBreakpoint.setEnabled( false );
|
||||||
}
|
}
|
||||||
|
@ -494,9 +493,10 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
||||||
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 );
|
ICDILocation location = cdiTarget.createLocation( fileName, function, -1 );
|
||||||
|
ICDICondition condition = cdiTarget.createCondition( breakpoint.getIgnoreCount(), breakpoint.getCondition() );
|
||||||
ICDIBreakpoint cdiBreakpoint = null;
|
ICDIBreakpoint cdiBreakpoint = null;
|
||||||
synchronized ( getBreakpointMap() ) {
|
synchronized ( getBreakpointMap() ) {
|
||||||
cdiBreakpoint = cdiTarget.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, null, null, true );
|
cdiBreakpoint = cdiTarget.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, condition, null, true );
|
||||||
getBreakpointMap().put( breakpoint, cdiBreakpoint );
|
getBreakpointMap().put( breakpoint, cdiBreakpoint );
|
||||||
}
|
}
|
||||||
return cdiBreakpoint;
|
return cdiBreakpoint;
|
||||||
|
@ -508,8 +508,9 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
||||||
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 ) );
|
ICDILocation location = cdiTarget.createLocation( new BigInteger ( breakpoint.getAddress().substring( 2 ), 16 ) );
|
||||||
|
ICDICondition condition = cdiTarget.createCondition( breakpoint.getIgnoreCount(), breakpoint.getCondition() );
|
||||||
synchronized ( getBreakpointMap() ) {
|
synchronized ( getBreakpointMap() ) {
|
||||||
cdiBreakpoint = cdiTarget.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, null, null, true );
|
cdiBreakpoint = cdiTarget.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, condition, null, true );
|
||||||
getBreakpointMap().put( breakpoint, cdiBreakpoint );
|
getBreakpointMap().put( breakpoint, cdiBreakpoint );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -519,9 +520,10 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
||||||
private ICDIBreakpoint setLineBreakpoint( ICLineBreakpoint breakpoint ) throws CDIException, CoreException {
|
private ICDIBreakpoint setLineBreakpoint( ICLineBreakpoint breakpoint ) throws CDIException, CoreException {
|
||||||
ICDITarget cdiTarget = getCDITarget();
|
ICDITarget cdiTarget = getCDITarget();
|
||||||
ICDILocation location = cdiTarget.createLocation( breakpoint.getMarker().getResource().getLocation().lastSegment(), null, breakpoint.getLineNumber() );
|
ICDILocation location = cdiTarget.createLocation( breakpoint.getMarker().getResource().getLocation().lastSegment(), null, breakpoint.getLineNumber() );
|
||||||
|
ICDICondition condition = cdiTarget.createCondition( breakpoint.getIgnoreCount(), breakpoint.getCondition() );
|
||||||
ICDIBreakpoint cdiBreakpoint = null;
|
ICDIBreakpoint cdiBreakpoint = null;
|
||||||
synchronized ( getBreakpointMap() ) {
|
synchronized ( getBreakpointMap() ) {
|
||||||
cdiBreakpoint = cdiTarget.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, null, null, true );
|
cdiBreakpoint = cdiTarget.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, condition, null, true );
|
||||||
getBreakpointMap().put( breakpoint, cdiBreakpoint );
|
getBreakpointMap().put( breakpoint, cdiBreakpoint );
|
||||||
}
|
}
|
||||||
return cdiBreakpoint;
|
return cdiBreakpoint;
|
||||||
|
@ -533,21 +535,15 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
||||||
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();
|
String expression = watchpoint.getExpression();
|
||||||
|
ICDICondition condition = cdiTarget.createCondition( watchpoint.getIgnoreCount(), watchpoint.getCondition() );
|
||||||
ICDIWatchpoint cdiWatchpoint = null;
|
ICDIWatchpoint cdiWatchpoint = null;
|
||||||
synchronized ( getBreakpointMap() ) {
|
synchronized ( getBreakpointMap() ) {
|
||||||
cdiWatchpoint = cdiTarget.setWatchpoint( ICDIBreakpoint.REGULAR, accessType, expression, null );
|
cdiWatchpoint = cdiTarget.setWatchpoint( ICDIBreakpoint.REGULAR, accessType, expression, condition );
|
||||||
getBreakpointMap().put( watchpoint, cdiWatchpoint );
|
getBreakpointMap().put( watchpoint, cdiWatchpoint );
|
||||||
}
|
}
|
||||||
return 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() {
|
private BreakpointMap getBreakpointMap() {
|
||||||
return fMap;
|
return fMap;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue