Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Schaefer2008-01-25 16:00:52 -0500
committerDoug Schaefer2008-01-25 16:00:52 -0500
commit7b157e9fb1bffa5461ffe83fe09a50cf38b00da0 (patch)
tree285edbe59edaa721e068026e24369434a5bf9250
parent97415bc7e15d76fa1fcf0b82d0ccbeba9b541eae (diff)
downloadorg.eclipse.cdt-7b157e9fb1bffa5461ffe83fe09a50cf38b00da0.tar.gz
org.eclipse.cdt-7b157e9fb1bffa5461ffe83fe09a50cf38b00da0.tar.xz
org.eclipse.cdt-7b157e9fb1bffa5461ffe83fe09a50cf38b00da0.zip
Patch for Elena - bug 166660. Fix potential threading issues with MI inferior handling.
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java43
1 files changed, 25 insertions, 18 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java
index e7bb474e22f..5ff58c50c4b 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java
+++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java
@@ -147,7 +147,7 @@ public class BreakpointManager extends Manager {
// Stop the program
if (allowInterrupt && target.isRunning()) {
// Disable events.
- ((EventManager)getSession().getEventManager()).allowProcessingEvents(false);
+ ((EventManager) getSession().getEventManager()).allowProcessingEvents(false);
target.suspend();
shouldRestart = true;
}
@@ -155,10 +155,9 @@ public class BreakpointManager extends Manager {
}
void resumeInferior(Target target, boolean shouldRestart) throws CDIException {
+ ((EventManager) getSession().getEventManager()).allowProcessingEvents(true);
if (shouldRestart) {
target.resume();
- // Enable events again.
- ((EventManager)getSession().getEventManager()).allowProcessingEvents(true);
}
}
@@ -239,18 +238,23 @@ public class BreakpointManager extends Manager {
if (info == null) {
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
+ for (int i = 0; i < miBreakpoints.length; i++) {
+ miBreakpoints[i].setEnabled(true);
+ }
+ breakpoint.setEnabled0(true);
} catch (MIException e) {
throw new MI2CDIException(e);
} finally {
- // Resume the program and enable events.
- resumeInferior(target, restart);
- }
- for (int i = 0; i < miBreakpoints.length; i++) {
- miBreakpoints[i].setEnabled(true);
+ try {
+ // Resume the program and enable events.
+ resumeInferior(target, restart);
+ } finally {
+ // Fire a changed Event.
+ miSession.fireEvent(new MIBreakpointChangedEvent(miSession, numbers[0]));
+ }
}
- breakpoint.setEnabled0(true);
- // Fire a changed Event.
- miSession.fireEvent(new MIBreakpointChangedEvent(miSession, numbers[0]));
+
+
}
/**
@@ -299,17 +303,20 @@ public class BreakpointManager extends Manager {
if (info == null) {
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
+ for (int i = 0; i < miBreakpoints.length; i++) {
+ miBreakpoints[i].setEnabled(false);
+ }
+ breakpoint.setEnabled0(false);
} catch (MIException e) {
throw new MI2CDIException(e);
} finally {
- resumeInferior(target, restart);
- }
- for (int i = 0; i < miBreakpoints.length; i++) {
- miBreakpoints[i].setEnabled(false);
+ try {
+ resumeInferior(target, restart);
+ } finally {
+ // Fire a changed Event.
+ miSession.fireEvent(new MIBreakpointChangedEvent(miSession, numbers[0]));
+ }
}
- breakpoint.setEnabled0(false);
- // Fire a changed Event.
- miSession.fireEvent(new MIBreakpointChangedEvent(miSession, numbers[0]));
}
/**

Back to the top