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