From 634918abbddf979e46369fab3f9061bbb47b88bc Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Sat, 26 Oct 2002 20:22:04 +0000 Subject: [PATCH] new method allowProgramInterruption. --- .../cdt/debug/mi/core/cdi/BreakpointManager.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java index 1734ed3dee1..867662d4c14 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java @@ -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() */