当前位置: 首页>>代码示例>>Java>>正文


Java EvaluationContext.getDebugProcess方法代码示例

本文整理汇总了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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:ClassLoadingUtils.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:17,代码来源:ImageObjectRenderer.java

示例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);
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:23,代码来源:NodeRendererSettings.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:LabelRenderer.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:ImageObjectRenderer.java

示例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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:30,代码来源:LabelRenderer.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:39,代码来源:LabelRenderer.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:16,代码来源:ClassLoadingUtils.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ToStringRenderer.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ToStringRenderer.java


注:本文中的com.intellij.debugger.engine.evaluation.EvaluationContext.getDebugProcess方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。