use of com.intellij.debugger.engine.jdi.ThreadReferenceProxy in project intellij-community by JetBrains.
the class BatchEvaluator method hasBatchEvaluator.
@SuppressWarnings({ "HardCodedStringLiteral" })
public boolean hasBatchEvaluator(EvaluationContext evaluationContext) {
if (!myBatchEvaluatorChecked) {
myBatchEvaluatorChecked = true;
if (DebuggerUtilsImpl.isRemote(myDebugProcess)) {
// optimization: for remote sessions the BatchEvaluator is not there for sure
return false;
}
ThreadReferenceProxy thread = evaluationContext.getSuspendContext().getThread();
if (thread == null) {
return false;
}
ThreadReference threadReference = thread.getThreadReference();
if (threadReference == null) {
return false;
}
ClassType batchEvaluatorClass = null;
try {
batchEvaluatorClass = (ClassType) myDebugProcess.findClass(evaluationContext, BatchEvaluatorServer.class.getName(), evaluationContext.getClassLoader());
} catch (EvaluateException e) {
}
if (batchEvaluatorClass != null) {
Method constructor = batchEvaluatorClass.concreteMethodByName(JVMNameUtil.CONSTRUCTOR_NAME, "()V");
if (constructor != null) {
ObjectReference evaluator = null;
try {
evaluator = myDebugProcess.newInstance(evaluationContext, batchEvaluatorClass, constructor, Collections.emptyList());
} catch (Exception e) {
LOG.debug(e);
}
myBatchEvaluatorObject = evaluator;
if (myBatchEvaluatorObject != null) {
myBatchEvaluatorMethod = batchEvaluatorClass.concreteMethodByName("evaluate", "([Ljava/lang/Object;)[Ljava/lang/Object;");
}
}
}
}
return myBatchEvaluatorMethod != null;
}
use of com.intellij.debugger.engine.jdi.ThreadReferenceProxy in project intellij-community by JetBrains.
the class NodeDescriptorFactoryImpl method createDescriptorTree.
private static DescriptorTree createDescriptorTree(final StackFrameProxy frameProxy, final DescriptorTree fromTree) {
int frameCount = -1;
int frameIndex = -1;
if (frameProxy != null) {
try {
final ThreadReferenceProxy threadReferenceProxy = frameProxy.threadProxy();
frameCount = threadReferenceProxy.frameCount();
frameIndex = frameProxy.getFrameIndex();
} catch (EvaluateException e) {
// ignored
}
}
final boolean isInitial = !fromTree.frameIdEquals(frameCount, frameIndex);
DescriptorTree descriptorTree = new DescriptorTree(isInitial);
descriptorTree.setFrameId(frameCount, frameIndex);
return descriptorTree;
}
Aggregations