1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-30 21:55:31 +02:00

new method allowProgramInterruption.

This commit is contained in:
Alain Magloire 2002-10-26 20:22:04 +00:00
parent 49d3b50f8e
commit 634918abbd

View file

@ -39,10 +39,12 @@ import org.eclipse.cdt.debug.mi.core.output.MIInfo;
public class BreakpointManager extends SessionObject implements ICDIBreakpointManager {
List breakList;
boolean allowInterrupt;
public BreakpointManager(CSession session) {
super(session);
breakList = new ArrayList(1);
allowInterrupt = true;
}
boolean containsBreakpoint(int number) {
@ -77,10 +79,12 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
CSession s = getCSession();
CTarget target = s.getCTarget();
// Stop the program and disable events.
if (target.isRunning()) {
if (target.isRunning() && allowInterrupt) {
int lastToken = target.getLastExecutionToken();
shouldRestart = true;
((EventManager)s.getEventManager()).disableEvents();
((EventManager)s.getEventManager()).disableEventToken(lastToken);
target.suspend();
((EventManager)s.getEventManager()).enableEventToken(lastToken);
}
return shouldRestart;
}
@ -90,11 +94,17 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
CSession s = getCSession();
CTarget target = s.getCTarget();
target.resume();
((EventManager)s.getEventManager()).enableEvents();
}
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#allowProgramInterruption()
*/
public void allowProgramInterruption(boolean e) {
allowInterrupt = e;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#deleteAllBreakpoints()
*/