1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Patch for Elena bug 166660. Cover up some wholes in the MI inferior handling that could cause multi-threading issues.

This commit is contained in:
Doug Schaefer 2008-01-25 21:04:27 +00:00
parent c0b97bbe1c
commit 10534b5968

View file

@ -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,19 +238,24 @@ public class BreakpointManager extends Manager {
if (info == null) {
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
} 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);
}
breakpoint.setEnabled0(true);
} catch (MIException e) {
throw new MI2CDIException(e);
} finally {
try {
// Resume the program and enable events.
resumeInferior(target, restart);
} finally {
// Fire a changed Event.
miSession.fireEvent(new MIBreakpointChangedEvent(miSession, numbers[0]));
}
}
}
/**
* Call through the Breakpoint class. Breakpoint.disable
@ -299,18 +303,21 @@ public class BreakpointManager extends Manager {
if (info == null) {
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
} catch (MIException e) {
throw new MI2CDIException(e);
} finally {
resumeInferior(target, restart);
}
for (int i = 0; i < miBreakpoints.length; i++) {
miBreakpoints[i].setEnabled(false);
}
breakpoint.setEnabled0(false);
} catch (MIException e) {
throw new MI2CDIException(e);
} finally {
try {
resumeInferior(target, restart);
} finally {
// Fire a changed Event.
miSession.fireEvent(new MIBreakpointChangedEvent(miSession, numbers[0]));
}
}
}
/**
* Use by the Breakpoint class, Breakpoint.setCondition(Condition cond)