diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/events/DebuggerContextCommandImpl.java b/java/debugger/impl/src/com/intellij/debugger/engine/events/DebuggerContextCommandImpl.java index 756936c9e5e9..1506eee63d86 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/events/DebuggerContextCommandImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/events/DebuggerContextCommandImpl.java @@ -8,6 +8,7 @@ import com.intellij.debugger.impl.DebuggerContextImpl; import com.intellij.debugger.jdi.ThreadReferenceProxyImpl; import com.intellij.openapi.diagnostic.Logger; import com.sun.jdi.ObjectCollectedException; +import com.sun.jdi.ThreadReference; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -53,9 +54,10 @@ public abstract class DebuggerContextCommandImpl extends SuspendContextCommandIm @Override public final void contextAction(@NotNull SuspendContextImpl suspendContext) { SuspendManager suspendManager = myDebuggerContext.getDebugProcess().getSuspendManager(); + ThreadReferenceProxyImpl thread = getThread(); boolean isSuspendedByContext; try { - isSuspendedByContext = suspendManager.isSuspended(getThread()); + isSuspendedByContext = suspendManager.isSuspended(thread); } catch (ObjectCollectedException ignored) { notifyCancelled(); @@ -64,15 +66,15 @@ public abstract class DebuggerContextCommandImpl extends SuspendContextCommandIm if (isSuspendedByContext) { if (LOG.isDebugEnabled()) { LOG.debug("Context thread " + suspendContext.getThread()); - LOG.debug("Debug thread" + getThread()); + LOG.debug("Debug thread" + thread); } threadAction(suspendContext); } else { // no suspend context currently available SuspendContextImpl suspendContextForThread = myCustomThread != null ? suspendContext : - SuspendManagerUtil.findContextByThread(suspendManager, getThread()); - if (suspendContextForThread != null) { + SuspendManagerUtil.findContextByThread(suspendManager, thread); + if (suspendContextForThread != null && thread.status() != ThreadReference.THREAD_STATUS_ZOMBIE) { suspendContextForThread.postponeCommand(this); } else { diff --git a/java/debugger/impl/src/com/intellij/debugger/jdi/ThreadReferenceProxyImpl.java b/java/debugger/impl/src/com/intellij/debugger/jdi/ThreadReferenceProxyImpl.java index 6a1971c02c35..9e216c2bb42a 100644 --- a/java/debugger/impl/src/com/intellij/debugger/jdi/ThreadReferenceProxyImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/jdi/ThreadReferenceProxyImpl.java @@ -1,6 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. /* * @author Eugene Zhuravlev @@ -18,6 +16,7 @@ import com.intellij.openapi.util.Comparing; import com.intellij.util.ThreeState; import com.intellij.util.containers.ContainerUtil; import com.sun.jdi.*; +import org.intellij.lang.annotations.MagicConstant; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; @@ -133,6 +132,7 @@ public final class ThreadReferenceProxyImpl extends ObjectReferenceProxyImpl imp super.clearCaches(); } + @MagicConstant(valuesFromClass = ThreadReference.class) public int status() { try { return getThreadReference().status(); diff --git a/java/jdkAnnotations/com/sun/jdi/annotations.xml b/java/jdkAnnotations/com/sun/jdi/annotations.xml index 1f5ce668732d..41df2aa2109e 100644 --- a/java/jdkAnnotations/com/sun/jdi/annotations.xml +++ b/java/jdkAnnotations/com/sun/jdi/annotations.xml @@ -18,4 +18,10 @@ name='com.sun.jdi.StackFrame java.util.Map<com.sun.jdi.LocalVariable,com.sun.jdi.Value> getValues(java.util.List<? extends com.sun.jdi.LocalVariable>)'> + + + + + + \ No newline at end of file