本文整理汇总了Java中com.intellij.debugger.engine.evaluation.EvaluationContext.getDebugProcess方法的典型用法代码示例。如果您正苦于以下问题:Java EvaluationContext.getDebugProcess方法的具体用法?Java EvaluationContext.getDebugProcess怎么用?Java EvaluationContext.getDebugProcess使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.debugger.engine.evaluation.EvaluationContext
的用法示例。
在下文中一共展示了EvaluationContext.getDebugProcess方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createURLArray
import com.intellij.debugger.engine.evaluation.EvaluationContext; //导入方法依赖的package包/类
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);
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;
}
示例2: getImageBytes
import com.intellij.debugger.engine.evaluation.EvaluationContext; //导入方法依赖的package包/类
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;
}
示例3: doEval
import com.intellij.debugger.engine.evaluation.EvaluationContext; //导入方法依赖的package包/类
private Value doEval(EvaluationContext evaluationContext, Value originalValue, MyCachedEvaluator cachedEvaluator) throws EvaluateException
{
final DebugProcess debugProcess = evaluationContext.getDebugProcess();
if(originalValue == null)
{
return null;
}
try
{
final ExpressionEvaluator evaluator = cachedEvaluator.getEvaluator(debugProcess.getProject());
if(!debugProcess.isAttached())
{
throw EvaluateExceptionUtil.PROCESS_EXITED;
}
final EvaluationContext thisEvaluationContext = evaluationContext.createEvaluationContext(originalValue);
return evaluator.evaluate(thisEvaluationContext);
}
catch(final EvaluateException ex)
{
throw new EvaluateException(DebuggerBundle.message("error.unable.to.evaluate.expression") + " " + ex.getMessage(), ex);
}
}
示例4: calcLabel
import com.intellij.debugger.engine.evaluation.EvaluationContext; //导入方法依赖的package包/类
public String calcLabel(ValueDescriptor descriptor, EvaluationContext evaluationContext, DescriptorLabelListener labelListener)
throws EvaluateException {
final Value value = descriptor.getValue();
LOG.assertTrue(!(value instanceof PrimitiveValue));
String result;
final DebugProcess debugProcess = evaluationContext.getDebugProcess();
if (value != null) {
try {
final ExpressionEvaluator evaluator = myLabelExpression.getEvaluator(debugProcess.getProject());
if(!debugProcess.isAttached()) {
throw EvaluateExceptionUtil.PROCESS_EXITED;
}
EvaluationContext thisEvaluationContext = evaluationContext.createEvaluationContext(value);
Value labelValue = evaluator.evaluate(thisEvaluationContext);
result = DebuggerUtils.getValueAsString(thisEvaluationContext, labelValue);
}
catch (final EvaluateException ex) {
throw new EvaluateException(DebuggerBundle.message("error.unable.to.evaluate.expression") + " " + ex.getMessage(), ex);
}
}
else {
//noinspection HardCodedStringLiteral
result = "null";
}
return result;
}
示例5: getImageBytes
import com.intellij.debugger.engine.evaluation.EvaluationContext; //导入方法依赖的package包/类
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;
}
示例6: calcLabel
import com.intellij.debugger.engine.evaluation.EvaluationContext; //导入方法依赖的package包/类
public String calcLabel(ValueDescriptor descriptor, EvaluationContext evaluationContext, DescriptorLabelListener labelListener)
throws EvaluateException {
final Value value = descriptor.getValue();
LOG.assertTrue(!(value instanceof PrimitiveValue));
String result;
final DebugProcess debugProcess = evaluationContext.getDebugProcess();
if (value != null) {
try {
final ExpressionEvaluator evaluator = myLabelExpression.getEvaluator(debugProcess.getProject());
if(!debugProcess.isAttached()) {
throw EvaluateExceptionUtil.PROCESS_EXITED;
}
EvaluationContext thisEvaluationContext = evaluationContext.createEvaluationContext(value);
Value labelValue = evaluator.evaluate(thisEvaluationContext);
result = DebuggerUtils.convertToPresentationString(DebuggerUtils.getValueAsString(thisEvaluationContext, labelValue));
}
catch (final EvaluateException ex) {
throw new EvaluateException(DebuggerBundle.message("error.unable.to.evaluate.expression") + " " + ex.getMessage(), ex);
}
}
else {
//noinspection HardCodedStringLiteral
result = "null";
}
return result;
}
示例7: calcLabel
import com.intellij.debugger.engine.evaluation.EvaluationContext; //导入方法依赖的package包/类
public String calcLabel(ValueDescriptor descriptor, EvaluationContext evaluationContext, DescriptorLabelListener labelListener) throws EvaluateException
{
if(!isShowValue(descriptor, evaluationContext))
{
return "";
}
final Value value = descriptor.getValue();
String result;
final DebugProcess debugProcess = evaluationContext.getDebugProcess();
if(value != null)
{
try
{
final ExpressionEvaluator evaluator = myLabelExpression.getEvaluator(debugProcess.getProject());
if(!debugProcess.isAttached())
{
throw EvaluateExceptionUtil.PROCESS_EXITED;
}
EvaluationContext thisEvaluationContext = evaluationContext.createEvaluationContext(value);
Value labelValue = evaluator.evaluate(thisEvaluationContext);
result = DebuggerUtils.getValueAsString(thisEvaluationContext, labelValue);
}
catch(final EvaluateException ex)
{
throw new EvaluateException(DebuggerBundle.message("error.unable.to.evaluate.expression") + " " + ex.getMessage(), ex);
}
}
else
{
//noinspection HardCodedStringLiteral
result = "null";
}
return result;
}
示例8: createURLArray
import com.intellij.debugger.engine.evaluation.EvaluationContext; //导入方法依赖的package包/类
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;
}
示例9: buildChildren
import com.intellij.debugger.engine.evaluation.EvaluationContext; //导入方法依赖的package包/类
public void buildChildren(Value value, ChildrenBuilder builder, EvaluationContext evaluationContext) {
final DebugProcessImpl debugProcess = (DebugProcessImpl)evaluationContext.getDebugProcess();
debugProcess.getDefaultRenderer(value).buildChildren(value, builder, evaluationContext);
}
示例10: isExpandable
import com.intellij.debugger.engine.evaluation.EvaluationContext; //导入方法依赖的package包/类
public boolean isExpandable(Value value, EvaluationContext evaluationContext, NodeDescriptor parentDescriptor) {
final DebugProcessImpl debugProcess = (DebugProcessImpl)evaluationContext.getDebugProcess();
return debugProcess.getDefaultRenderer(value).isExpandable(value, evaluationContext, parentDescriptor);
}