mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-31 12:55:40 +02:00
new method allowProgramInterruption.
This commit is contained in:
parent
49d3b50f8e
commit
634918abbd
1 changed files with 13 additions and 3 deletions
|
@ -39,10 +39,12 @@ import org.eclipse.cdt.debug.mi.core.output.MIInfo;
|
||||||
public class BreakpointManager extends SessionObject implements ICDIBreakpointManager {
|
public class BreakpointManager extends SessionObject implements ICDIBreakpointManager {
|
||||||
|
|
||||||
List breakList;
|
List breakList;
|
||||||
|
boolean allowInterrupt;
|
||||||
|
|
||||||
public BreakpointManager(CSession session) {
|
public BreakpointManager(CSession session) {
|
||||||
super(session);
|
super(session);
|
||||||
breakList = new ArrayList(1);
|
breakList = new ArrayList(1);
|
||||||
|
allowInterrupt = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean containsBreakpoint(int number) {
|
boolean containsBreakpoint(int number) {
|
||||||
|
@ -77,10 +79,12 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
|
||||||
CSession s = getCSession();
|
CSession s = getCSession();
|
||||||
CTarget target = s.getCTarget();
|
CTarget target = s.getCTarget();
|
||||||
// Stop the program and disable events.
|
// Stop the program and disable events.
|
||||||
if (target.isRunning()) {
|
if (target.isRunning() && allowInterrupt) {
|
||||||
|
int lastToken = target.getLastExecutionToken();
|
||||||
shouldRestart = true;
|
shouldRestart = true;
|
||||||
((EventManager)s.getEventManager()).disableEvents();
|
((EventManager)s.getEventManager()).disableEventToken(lastToken);
|
||||||
target.suspend();
|
target.suspend();
|
||||||
|
((EventManager)s.getEventManager()).enableEventToken(lastToken);
|
||||||
}
|
}
|
||||||
return shouldRestart;
|
return shouldRestart;
|
||||||
}
|
}
|
||||||
|
@ -90,11 +94,17 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
|
||||||
CSession s = getCSession();
|
CSession s = getCSession();
|
||||||
CTarget target = s.getCTarget();
|
CTarget target = s.getCTarget();
|
||||||
target.resume();
|
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()
|
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#deleteAllBreakpoints()
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue