use of com.intellij.debugger.engine.DebugProcess in project smali by JesusFreke.
the class SmaliPositionManager method createPrepareRequest.
@Override
public ClassPrepareRequest createPrepareRequest(@NotNull final ClassPrepareRequestor requestor, @NotNull final SourcePosition position) throws NoDataException {
Computable<Boolean> isSmaliFile = new Computable<Boolean>() {
@Override
public Boolean compute() {
return position.getFile() instanceof SmaliFile;
}
};
ApplicationManager.getApplication().runReadAction(isSmaliFile);
if (!isSmaliFile.compute()) {
throw NoDataException.INSTANCE;
}
String className = getClassFromPosition(position);
return debugProcess.getRequestsManager().createClassPrepareRequest(new ClassPrepareRequestor() {
@Override
public void processClassPrepare(DebugProcess debuggerProcess, ReferenceType referenceType) {
requestor.processClassPrepare(debuggerProcess, referenceType);
}
}, className);
}
use of com.intellij.debugger.engine.DebugProcess in project intellij-community by JetBrains.
the class ClassLoadingUtils method createURLArray.
private static ArrayReference createURLArray(EvaluationContext context) throws EvaluateException, InvalidTypeException, ClassNotLoadedException {
DebugProcess process = context.getDebugProcess();
ArrayType arrayType = (ArrayType) process.findClass(context, "java.net.URL[]", context.getClassLoader());
ArrayReference arrayRef = arrayType.newInstance(1);
DebuggerUtilsEx.keep(arrayRef, context);
ClassType classType = (ClassType) process.findClass(context, "java.net.URL", context.getClassLoader());
VirtualMachineProxyImpl proxy = (VirtualMachineProxyImpl) process.getVirtualMachineProxy();
StringReference url = proxy.mirrorOf("file:a");
DebuggerUtilsEx.keep(url, context);
ObjectReference reference = process.newInstance(context, classType, classType.concreteMethodByName(JVMNameUtil.CONSTRUCTOR_NAME, "(Ljava/lang/String;)V"), Collections.singletonList(url));
DebuggerUtilsEx.keep(reference, context);
arrayRef.setValues(Collections.singletonList(reference));
return arrayRef;
}
use of com.intellij.debugger.engine.DebugProcess in project kotlin by JetBrains.
the class CompilingEvaluatorUtils method createURLArray.
private static ArrayReference createURLArray(EvaluationContext context) throws EvaluateException, InvocationException, InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException {
DebugProcess process = context.getDebugProcess();
ArrayType arrayType = (ArrayType) process.findClass(context, "java.net.URL[]", context.getClassLoader());
ArrayReference arrayRef = arrayType.newInstance(1);
keep(arrayRef, context);
ClassType classType = (ClassType) process.findClass(context, "java.net.URL", context.getClassLoader());
VirtualMachineProxyImpl proxy = (VirtualMachineProxyImpl) process.getVirtualMachineProxy();
StringReference url = proxy.mirrorOf("file:a");
keep(url, context);
ObjectReference reference = process.newInstance(context, classType, classType.concreteMethodByName("<init>", "(Ljava/lang/String;)V"), Collections.singletonList(url));
keep(reference, context);
arrayRef.setValues(Collections.singletonList(reference));
return arrayRef;
}
use of com.intellij.debugger.engine.DebugProcess in project intellij-community by JetBrains.
the class ImageObjectRenderer method getImageBytes.
private static Value getImageBytes(EvaluationContext evaluationContext, Value obj, String methodName) throws EvaluateException {
DebugProcess process = evaluationContext.getDebugProcess();
EvaluationContext copyContext = evaluationContext.createEvaluationContext(obj);
ClassType helperClass = ClassLoadingUtils.getHelperClass(ImageSerializer.class.getName(), copyContext, process);
if (helperClass != null) {
List<Method> methods = helperClass.methodsByName(methodName);
if (!methods.isEmpty()) {
return process.invokeMethod(copyContext, helperClass, methods.get(0), Collections.singletonList(obj));
}
}
return null;
}
use of com.intellij.debugger.engine.DebugProcess in project android by JetBrains.
the class ResolveTypedIntegerCommand method action.
@Override
public void action() {
// TODO: see if it is possible to cache this evaluation
// if (myIsEvaluated) return;
DebugProcess debugProcess = myEvaluationContext.getDebugProcess();
if (!(debugProcess instanceof DebugProcessImpl)) {
return;
}
final DebuggerContextImpl debuggerContext = ((DebugProcessImpl) debugProcess).getDebuggerContext();
PsiAnnotation annotation = ApplicationManager.getApplication().runReadAction(new Computable<PsiAnnotation>() {
@Override
public PsiAnnotation compute() {
try {
return getAnnotation(debuggerContext);
} catch (IndexNotReadyException e) {
return null;
}
}
});
if (annotation != null) {
ResourceIdResolver resolver = ServiceManager.getService(myEvaluationContext.getProject(), ResourceIdResolver.class);
DynamicResourceIdResolver resolver1 = new DynamicResourceIdResolver(myEvaluationContext, resolver);
myResult = AnnotationsRenderer.render(resolver1, annotation, ((IntegerValue) myValue).value());
}
evaluationResult("");
}
Aggregations