use of com.intellij.debugger.engine.SuspendManager in project intellij-community by JetBrains.
the class DebuggerContextCommandImpl method contextAction.
@Override
public final void contextAction(@NotNull SuspendContextImpl suspendContext) throws Exception {
SuspendManager suspendManager = myDebuggerContext.getDebugProcess().getSuspendManager();
boolean isSuspendedByContext;
try {
isSuspendedByContext = suspendManager.isSuspended(getThread());
} catch (ObjectCollectedException ignored) {
notifyCancelled();
return;
}
if (isSuspendedByContext) {
if (LOG.isDebugEnabled()) {
LOG.debug("Context thread " + suspendContext.getThread());
LOG.debug("Debug thread" + getThread());
}
threadAction(suspendContext);
} else {
// no suspend context currently available
SuspendContextImpl suspendContextForThread = myCustomThread != null ? suspendContext : SuspendManagerUtil.findContextByThread(suspendManager, getThread());
if (suspendContextForThread != null) {
suspendContextForThread.postponeCommand(this);
} else {
notifyCancelled();
}
}
}
use of com.intellij.debugger.engine.SuspendManager in project intellij-community by JetBrains.
the class ThreadDescriptorImpl method setContext.
public void setContext(EvaluationContextImpl context) {
final ThreadReferenceProxyImpl thread = getThreadReference();
final SuspendManager suspendManager = context != null ? context.getDebugProcess().getSuspendManager() : null;
final SuspendContextImpl suspendContext = context != null ? context.getSuspendContext() : null;
try {
myIsSuspended = suspendManager != null ? suspendManager.isSuspended(thread) : thread.isSuspended();
} catch (ObjectCollectedException e) {
myIsSuspended = false;
}
myIsExpandable = calcExpandable(myIsSuspended);
mySuspendContext = suspendManager != null ? SuspendManagerUtil.findContextByThread(suspendManager, thread) : suspendContext;
myIsAtBreakpoint = thread.isAtBreakpoint();
myIsCurrent = suspendContext != null ? suspendContext.getThread() == thread : false;
myIsFrozen = suspendManager != null ? suspendManager.isFrozen(thread) : myIsSuspended;
}
Aggregations