mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-15 12:15:47 +02:00
Bug 108424: Debugger stops on removed breakpoints.
This commit is contained in:
parent
b2960a2e43
commit
fe2b61a78e
4 changed files with 48 additions and 21 deletions
|
@ -1,3 +1,7 @@
|
|||
2005-09-01 Mikhail Khodjaiants
|
||||
Bug 108424: Debugger stops on removed breakpoints.
|
||||
* CBreakpointManager.java
|
||||
|
||||
2005-08-25 Mikhail Khodjaiants
|
||||
Bug 106241: Argument stopInMain has no impact in method org.eclipse.cdt.debug.core.CDIDebugModel#newDebugTarget.
|
||||
* CDIDebugModel.java
|
||||
|
|
|
@ -75,19 +75,17 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
|||
|
||||
static private class BreakpointInProgess {
|
||||
|
||||
private boolean fDeleted = false;
|
||||
|
||||
boolean isDeleted() {
|
||||
return fDeleted;
|
||||
private ICDIBreakpoint fCDIBreakpoint;
|
||||
|
||||
void setCDIBreakpoint( ICDIBreakpoint b ) {
|
||||
fCDIBreakpoint = b;
|
||||
}
|
||||
|
||||
void delete() {
|
||||
fDeleted = true;
|
||||
|
||||
ICDIBreakpoint getCDIBreakpoint() {
|
||||
return fCDIBreakpoint;
|
||||
}
|
||||
}
|
||||
|
||||
static final protected BreakpointInProgess BREAKPOINT_IN_PROGRESS = new BreakpointInProgess();
|
||||
|
||||
private class BreakpointMap {
|
||||
|
||||
/**
|
||||
|
@ -106,7 +104,7 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
|||
}
|
||||
|
||||
void register( ICBreakpoint breakpoint ) {
|
||||
fCBreakpoints.put( breakpoint, BREAKPOINT_IN_PROGRESS );
|
||||
fCBreakpoints.put( breakpoint, new BreakpointInProgess() );
|
||||
}
|
||||
|
||||
void put( ICBreakpoint breakpoint, ICDIBreakpoint cdiBreakpoint ) {
|
||||
|
@ -114,6 +112,10 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
|||
fCDIBreakpoints.put( cdiBreakpoint, breakpoint );
|
||||
}
|
||||
|
||||
Object get( ICBreakpoint breakpoint ) {
|
||||
return fCBreakpoints.get( breakpoint );
|
||||
}
|
||||
|
||||
ICDIBreakpoint getCDIBreakpoint( ICBreakpoint breakpoint ) {
|
||||
Object b = fCBreakpoints.get( breakpoint );
|
||||
return ( b instanceof ICDIBreakpoint ) ? (ICDIBreakpoint)b : null;
|
||||
|
@ -146,7 +148,7 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
|||
}
|
||||
|
||||
boolean isInProgress( ICBreakpoint breakpoint ) {
|
||||
return ( fCBreakpoints.get( breakpoint ) == BREAKPOINT_IN_PROGRESS );
|
||||
return ( fCBreakpoints.get( breakpoint ) instanceof BreakpointInProgess );
|
||||
}
|
||||
|
||||
ICBreakpoint[] getAllCBreakpoints() {
|
||||
|
@ -165,7 +167,7 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
|||
Iterator it = set.iterator();
|
||||
while ( it.hasNext() ) {
|
||||
Map.Entry entry = (Map.Entry)it.next();
|
||||
if ( entry.getValue() == BREAKPOINT_IN_PROGRESS ) {
|
||||
if ( entry.getValue() instanceof BreakpointInProgess ) {
|
||||
list.add( entry.getKey() );
|
||||
}
|
||||
}
|
||||
|
@ -239,10 +241,18 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
|||
ArrayList list = new ArrayList( breakpoints.length );
|
||||
synchronized( getBreakpointMap() ) {
|
||||
for ( int i = 0; i < breakpoints.length; ++i ) {
|
||||
if ( breakpoints[i] instanceof ICBreakpoint && !getBreakpointMap().isInProgress( (ICBreakpoint)breakpoints[i] ) ) {
|
||||
ICDIBreakpoint b = getBreakpointMap().getCDIBreakpoint( (ICBreakpoint)breakpoints[i] );
|
||||
if ( b != null )
|
||||
if ( breakpoints[i] instanceof ICBreakpoint ) {
|
||||
Object obj = getBreakpointMap().get( (ICBreakpoint)breakpoints[i] );
|
||||
ICDIBreakpoint b = null;
|
||||
if ( obj instanceof ICDIBreakpoint ) {
|
||||
b = (ICDIBreakpoint)obj;
|
||||
}
|
||||
else if ( obj instanceof BreakpointInProgess ) {
|
||||
b = ((BreakpointInProgess)obj).getCDIBreakpoint();
|
||||
}
|
||||
if ( b != null ) {
|
||||
list.add( b );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -593,7 +603,13 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
|||
ICDICondition condition = createCondition( watchpoint );
|
||||
b = cdiTarget.setWatchpoint( ICDIBreakpoint.REGULAR, accessType, expression, condition );
|
||||
}
|
||||
// Hack: see bug 105196: [CDI]: Add "enabled" flag to the "set...Breakpoint" methods
|
||||
if ( b != null ) {
|
||||
Object obj = getBreakpointMap().get( breakpoints[i] );
|
||||
if ( obj instanceof BreakpointInProgess ) {
|
||||
((BreakpointInProgess)obj).setCDIBreakpoint( b );
|
||||
}
|
||||
}
|
||||
// Hack: see bug 105196: [CDI]: Add "enabled" flag to the "set...Breakpoint" methods
|
||||
if ( b != null && b.isEnabled() != breakpoints[i].isEnabled() ) {
|
||||
b.setEnabled( breakpoints[i].isEnabled() );
|
||||
}
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2005-09-01 Mikhail Khodjaiants
|
||||
Bug 108424: Debugger stops on removed breakpoints.
|
||||
* cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java
|
||||
|
||||
2005-08-31 Alain Magloire
|
||||
Improve performance by caching the type result on the frame
|
||||
and on the RegisterManager. The patch is originally from Chris Wiebe
|
||||
|
|
|
@ -523,13 +523,14 @@ public class BreakpointManager extends Manager {
|
|||
|
||||
public void deleteBreakpoints(Target target, ICDIBreakpoint[] breakpoints) throws CDIException {
|
||||
List bList = (List)breakMap.get(target);
|
||||
List dList = (List)deferredMap.get(target);
|
||||
|
||||
// Do the sanity check first, we will accept all or none
|
||||
if (bList == null) {
|
||||
throw new CDIException(CdiResources.getString("cdi.BreakpointManager.Not_a_CDT_breakpoint")); //$NON-NLS-1$
|
||||
}
|
||||
for (int i = 0; i < breakpoints.length; i++) {
|
||||
if (!(breakpoints[i] instanceof Breakpoint && bList.contains(breakpoints[i]))) {
|
||||
if (!(breakpoints[i] instanceof Breakpoint && (bList.contains(breakpoints[i]) || (dList != null && dList.contains(breakpoints[i]))))) {
|
||||
throw new CDIException(CdiResources.getString("cdi.BreakpointManager.Not_a_CDT_breakpoint")); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
@ -537,10 +538,12 @@ public class BreakpointManager extends Manager {
|
|||
MISession miSession = target.getMISession();
|
||||
List eventList = new ArrayList(breakpoints.length);
|
||||
for (int i = 0; i < breakpoints.length; i++) {
|
||||
MIBreakpoint[] miBreakpoints = ((Breakpoint)breakpoints[i]).getMIBreakpoints();
|
||||
if (miBreakpoints.length > 0) {
|
||||
deleteMIBreakpoints(target, miBreakpoints);
|
||||
eventList.add(new MIBreakpointDeletedEvent(miSession, miBreakpoints[0].getNumber()));
|
||||
if (!(dList != null && dList.remove(breakpoints[i]))) {
|
||||
MIBreakpoint[] miBreakpoints = ((Breakpoint)breakpoints[i]).getMIBreakpoints();
|
||||
if (miBreakpoints.length > 0) {
|
||||
deleteMIBreakpoints(target, miBreakpoints);
|
||||
eventList.add(new MIBreakpointDeletedEvent(miSession, miBreakpoints[0].getNumber()));
|
||||
}
|
||||
}
|
||||
}
|
||||
MIEvent[] events = (MIEvent[])eventList.toArray(new MIEvent[0]);
|
||||
|
|
Loading…
Add table
Reference in a new issue