mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix 44026
This commit is contained in:
@@ -180,23 +180,25 @@ public class DebuggerSession {
|
||||
}
|
||||
}
|
||||
|
||||
while (!currentThread.isSuspended()) {
|
||||
// wait until thread is considered suspended. Querying data from a thread immediately after VM.suspend()
|
||||
// may result in IncompatibleThreadStateException, most likely some time after suspend() VM erroneously thinks that thread is still running
|
||||
try {
|
||||
Thread.sleep(10);
|
||||
StackFrameProxyImpl proxy = null;
|
||||
if (currentThread != null) {
|
||||
while (!currentThread.isSuspended()) {
|
||||
// wait until thread is considered suspended. Querying data from a thread immediately after VM.suspend()
|
||||
// may result in IncompatibleThreadStateException, most likely some time after suspend() VM erroneously thinks that thread is still running
|
||||
try {
|
||||
Thread.sleep(10);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
}
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
}
|
||||
}
|
||||
|
||||
StackFrameProxyImpl proxy;
|
||||
try {
|
||||
proxy = (currentThread.frameCount() > 0) ? currentThread.frame(0) : null;
|
||||
}
|
||||
catch (EvaluateException e) {
|
||||
proxy = null;
|
||||
LOG.error(e);
|
||||
try {
|
||||
proxy = (currentThread.frameCount() > 0) ? currentThread.frame(0) : null;
|
||||
}
|
||||
catch (EvaluateException e) {
|
||||
proxy = null;
|
||||
LOG.error(e);
|
||||
}
|
||||
}
|
||||
positionContext = new SimpleStackFrameContext(proxy, debugProcess);
|
||||
}
|
||||
|
||||
@@ -113,11 +113,20 @@ public final class ThreadReferenceProxyImpl extends ObjectReferenceProxyImpl imp
|
||||
DebuggerManagerThreadImpl.assertIsManagerThread();
|
||||
checkValid();
|
||||
if (myFrameCount == -1) {
|
||||
try {
|
||||
myFrameCount = getThreadReference().frameCount();
|
||||
}
|
||||
catch (IncompatibleThreadStateException e) {
|
||||
throw EvaluateExceptionUtil.createEvaluateException(e);
|
||||
while (true) {
|
||||
// JDI bug: although isSuspended() == true, frameCount() may throw IncompatibleTharedStateException
|
||||
// so keep trying to get frame count if the thread reports itself as "suspended"
|
||||
try {
|
||||
final ThreadReference threadReference = getThreadReference();
|
||||
myFrameCount = threadReference.frameCount();
|
||||
break;
|
||||
}
|
||||
catch (IncompatibleThreadStateException e) {
|
||||
if (!isSuspended()) {
|
||||
// give up because it seems to be really resumed
|
||||
throw EvaluateExceptionUtil.createEvaluateException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return myFrameCount;
|
||||
|
||||
Reference in New Issue
Block a user