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

[268617] - [view model] StackFrameVMNode accesses DSF services in the wrong thread.

This commit is contained in:
Pawel Piech 2009-03-13 22:22:25 +00:00
parent bf3cd59be6
commit 3770b8065d

View file

@ -618,14 +618,6 @@ public class StackFramesVMNode extends AbstractDMVMNode
}
private void buildDeltaForSuspendedEvent(final IExecutionDMContext executionCtx, final IExecutionDMContext triggeringCtx, final VMDelta parentDelta, final int nodeOffset, final RequestMonitor rm) {
IRunControl runControlService = getServicesTracker().getService(IRunControl.class);
IStack stackService = getServicesTracker().getService(IStack.class);
if (stackService == null || runControlService == null) {
// Required services have not initialized yet. Ignore the event.
rm.done();
return;
}
// Check if we are building a delta for the thread that triggered the event.
// Only then expand the stack frames and select the top one.
if (executionCtx.equals(triggeringCtx)) {
@ -649,12 +641,13 @@ public class StackFramesVMNode extends AbstractDMVMNode
}
})
);
} else {
rm.done();
}
}
private void buildDeltaForFullStackRefreshEvent(final IExecutionDMContext executionCtx, final IExecutionDMContext triggeringCtx, final VMDelta parentDelta, final int nodeOffset, final RequestMonitor rm) {
try {
getSession().getExecutor().execute(new DsfRunnable() {
public void run() {
IRunControl runControlService = getServicesTracker().getService(IRunControl.class);
IStack stackService = getServicesTracker().getService(IStack.class);
if (stackService == null || runControlService == null) {
@ -672,6 +665,12 @@ public class StackFramesVMNode extends AbstractDMVMNode
rm.done();
}
});
} catch (RejectedExecutionException e) {
// Session shut down, no delta to build.
rm.done();
}
}
private void buildDeltaForSteppingTimedOutEvent(final SteppingTimedOutEvent e, final VMDelta parentDelta, final int nodeOffset, final RequestMonitor rm) {
// Repaint the stack frame images to have the running symbol.