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:
parent
bf3cd59be6
commit
3770b8065d
1 changed files with 25 additions and 26 deletions
|
@ -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) {
|
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.
|
// 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.
|
// Only then expand the stack frames and select the top one.
|
||||||
if (executionCtx.equals(triggeringCtx)) {
|
if (executionCtx.equals(triggeringCtx)) {
|
||||||
|
@ -649,28 +641,35 @@ 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) {
|
private void buildDeltaForFullStackRefreshEvent(final IExecutionDMContext executionCtx, final IExecutionDMContext triggeringCtx, final VMDelta parentDelta, final int nodeOffset, final RequestMonitor rm) {
|
||||||
IRunControl runControlService = getServicesTracker().getService(IRunControl.class);
|
try {
|
||||||
IStack stackService = getServicesTracker().getService(IStack.class);
|
getSession().getExecutor().execute(new DsfRunnable() {
|
||||||
if (stackService == null || runControlService == null) {
|
public void run() {
|
||||||
// Required services have not initialized yet. Ignore the event.
|
IRunControl runControlService = getServicesTracker().getService(IRunControl.class);
|
||||||
rm.done();
|
IStack stackService = getServicesTracker().getService(IStack.class);
|
||||||
return;
|
if (stackService == null || runControlService == null) {
|
||||||
}
|
// Required services have not initialized yet. Ignore the event.
|
||||||
|
rm.done();
|
||||||
// Refresh the whole list of stack frames unless the target is already stepping the next command. In
|
return;
|
||||||
// which case, the refresh will occur when the stepping sequence slows down or stops. Trying to
|
}
|
||||||
// refresh the whole stack trace with every step would slow down stepping too much.
|
|
||||||
if (triggeringCtx == null || !runControlService.isStepping(triggeringCtx)) {
|
// Refresh the whole list of stack frames unless the target is already stepping the next command. In
|
||||||
parentDelta.setFlags(parentDelta.getFlags() | IModelDelta.CONTENT);
|
// which case, the refresh will occur when the stepping sequence slows down or stops. Trying to
|
||||||
}
|
// refresh the whole stack trace with every step would slow down stepping too much.
|
||||||
|
if (triggeringCtx == null || !runControlService.isStepping(triggeringCtx)) {
|
||||||
rm.done();
|
parentDelta.setFlags(parentDelta.getFlags() | IModelDelta.CONTENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
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) {
|
private void buildDeltaForSteppingTimedOutEvent(final SteppingTimedOutEvent e, final VMDelta parentDelta, final int nodeOffset, final RequestMonitor rm) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue