• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java IJavaThread类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.eclipse.jdt.debug.core.IJavaThread的典型用法代码示例。如果您正苦于以下问题:Java IJavaThread类的具体用法?Java IJavaThread怎么用?Java IJavaThread使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

IJavaThread类属于org.eclipse.jdt.debug.core包,在下文中一共展示了IJavaThread类的40个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: breakpointHit

点赞 3

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public int breakpointHit(IJavaThread thread, IJavaBreakpoint breakpoint) {
	PandionJView pjView = PandionJView.getInstance();
	if(pjView == null)
		return IJavaBreakpointListener.DONT_SUSPEND;

	if(breakpoint instanceof IJavaLineBreakpoint) {
		if(!thread.isPerformingEvaluation()) {
			pjView.handleLinebreakPoint(thread);
			return IJavaBreakpointListener.SUSPEND;
		}
	}
	else if (breakpoint instanceof IJavaExceptionBreakpoint) {
		pjView.handleExceptionBreakpoint(thread, ((IJavaExceptionBreakpoint) breakpoint).getExceptionTypeName());
		return IJavaBreakpointListener.SUSPEND;
	}
	return IJavaBreakpointListener.DONT_SUSPEND;
}
 

开发者ID:andre-santos-pt,
项目名称:pandionj,
代码行数:18,
代码来源:PandionJBreakpointListener.java

示例2: EvaluationManager

点赞 3

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public EvaluationManager(boolean isFreeSearch, boolean disableBreakpoints, IJavaStackFrame stack, ExpressionEvaluator expressionEvaluator, SubtypeChecker subtypeChecker, TypeCache typeCache, ValueCache valueCache, TimeoutChecker timeoutChecker, SideEffectHandler sideEffectHandler) {
	this.isFreeSearch = isFreeSearch;
	this.disableBreakpoints = disableBreakpoints;
	this.stack = stack;
	this.engine = EclipseUtils.getASTEvaluationEngine(stack);
	this.valueCache = valueCache;
	this.timeoutChecker = timeoutChecker;
	this.sideEffectHandler = sideEffectHandler;
	this.target = (IJavaDebugTarget)stack.getDebugTarget();
	this.thread = (IJavaThread)stack.getThread();
	this.expressionEvaluator = expressionEvaluator;
	this.subtypeChecker = subtypeChecker;
	this.implType = EclipseUtils.loadLibrary(IMPL_NAME, stack, target, typeCache);
	try {
		this.validField = implType.getField("valid");
		this.toStringsField = implType.getField("toStrings");
		this.valueCountField = implType.getField("valueCount");
		this.fullCountField = implType.getField("fullCount");
		this.methodResultsField = implType.getField("methodResults");
		this.canUseJar = !engine.getCompiledExpression(IMPL_QUALIFIER + "valid", stack).hasErrors();  // If the jar is not on the classpath, strings using its type will not compile, so we must do something different.
	} catch (DebugException e) {
		throw new RuntimeException(e);
	}
	this.crashingStatements = new HashSet<String>();
	this.skipped = 0;
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:27,
代码来源:EvaluationManager.java

示例3: SkeletonFiller

点赞 3

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
/**
 * Creates a new SkeletonFiller.  Many common values are
 * stored as ivars for convenience.
 * @param extraDepth Extra depth to search.
 * @param searchConstructors Whether or not to search constructors.
 * @param searchOperators Whether or not to search operator expressions.
 * @param searchStatements Whether or not to search statements.
 * @param holeInfos The information about the holes in the skeleton.
 * @param stack The current stack frame.
 * @param target The debug target.
 * @param expressionMaker The expression maker.
 * @param expressionEvaluator The expression evaluator;
 * @param evalManager The evaluation manager.
 * @param staticEvaluator Evaluator of String method calls.
 * @param expressionGenerator The expression generator.
 * @param sideEffectHandler The side effect handler.
 * @param subtypeChecker The subtype checker.
 * @param typeCache The type cache.
 * @param valueCache The value cache.
 * @param monitor The progress monitor.
 */
private SkeletonFiller(int extraDepth, boolean searchConstructors, boolean searchOperators, boolean searchStatements, Map<String, HoleInfo> holeInfos, IJavaStackFrame stack, IJavaDebugTarget target, ExpressionMaker expressionMaker, ExpressionEvaluator expressionEvaluator, EvaluationManager evalManager, StaticEvaluator staticEvaluator, ExpressionGenerator expressionGenerator, SideEffectHandler sideEffectHandler, SubtypeChecker subtypeChecker, TypeCache typeCache, ValueCache valueCache, IProgressMonitor monitor) {
	this.extraDepth = extraDepth;
	this.searchConstructors = searchConstructors;
	this.searchOperators = searchOperators;
	this.searchStatements = searchStatements;
	this.holeFields = new HashMap<String, Map<String, ArrayList<Field>>>();
	this.holeMethods = new HashMap<String, Map<String, ArrayList<Method>>>();
	this.holeInfos = holeInfos;
	this.expressionMaker = expressionMaker;
	this.expressionEvaluator = expressionEvaluator;
	this.evalManager = evalManager;
	this.staticEvaluator = staticEvaluator;
	this.expressionGenerator = expressionGenerator;
	this.sideEffectHandler = sideEffectHandler;
	this.subtypeChecker = subtypeChecker;
	this.typeCache = typeCache;
	this.valueCache = valueCache;
	this.stack = stack;
	this.target = target;
	this.thread = (IJavaThread)stack.getThread();
	this.monitor = monitor;
	intType = EclipseUtils.getFullyQualifiedType("int", stack, target, typeCache);
	booleanType = EclipseUtils.getFullyQualifiedType("boolean", stack, target, typeCache);
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:46,
代码来源:ExpressionSkeleton.java

示例4: ExpressionEvaluator

点赞 3

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
private ExpressionEvaluator(IJavaStackFrame stack, ValueCache valueCache, TypeCache typeCache, SubtypeChecker subtypeChecker, TimeoutChecker timeoutChecker, NativeHandler nativeHandler, SideEffectHandler sideEffectHandler, Map<Integer, Method> methods, Map<Integer, Field> fields) {
	this.stack = stack;
	this.target = (IJavaDebugTarget)stack.getDebugTarget();
	this.thread = (IJavaThread)stack.getThread();
	results = new HashMap<Set<Effect>, Map<Integer, Result>>();
	this.resultStrings = new HashMap<Integer, String>();
	this.methods = new HashMap<Integer, Method>(methods);  // Make copies so that changes we make here don't affect the metadata's maps.
	this.fields = new HashMap<Integer, Field>(fields);
	statics = new HashMap<Integer, IJavaReferenceType>();
	depths = new HashMap<Integer, Integer>();
	this.valueCache = valueCache;
	this.typeCache = typeCache;
	this.subtypeChecker = subtypeChecker;
	numCrashes = 0;
	this.timeoutChecker = timeoutChecker;
	this.nativeHandler = nativeHandler;
	this.sideEffectHandler = sideEffectHandler;
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:19,
代码来源:ExpressionEvaluator.java

示例5: makeArrayAccess

点赞 3

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public ArrayAccess makeArrayAccess(Expression array, Expression index, IJavaThread thread) throws NumberFormatException, DebugException {
	Result operandResults = expressionEvaluator.computeResultForBinaryOp(array, index);
	if (operandResults == null)
		return null;
	IJavaValue value = null;
	IJavaValue arrayValue = expressionEvaluator.getValue(array, Collections.<Effect>emptySet());
	if (arrayValue != null && operandResults.getValue().getValue() != null) {
		value = ExpressionEvaluator.computeArrayAccess(arrayValue, operandResults.getValue().getValue());
		if (value == null)
			return null;
	}
	IJavaType type = getArrayElementType(array);
	ArrayAccess e = makeArrayAccess(type, array, index);
	Result result = new Result(value, operandResults.getEffects(), valueCache, thread);
	expressionEvaluator.setResult(e, result, Collections.<Effect>emptySet());
	return e;
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:18,
代码来源:ExpressionMaker.java

示例6: ExpressionGenerator

点赞 3

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public ExpressionGenerator(IJavaDebugTarget target, IJavaStackFrame stack, SideEffectHandler sideEffectHandler, ExpressionMaker expressionMaker, ExpressionEvaluator expressionEvaluator, SubtypeChecker subtypeChecker, TypeCache typeCache, EvaluationManager evalManager, StaticEvaluator staticEvaluator, Weights weights) {
	this.target = target;
	this.stack = stack;
	this.thread = (IJavaThread)stack.getThread();
	this.sideEffectHandler = sideEffectHandler;
	this.expressionMaker = expressionMaker;
	this.expressionEvaluator = expressionEvaluator;
	this.subtypeChecker = subtypeChecker;
	this.typeCache = typeCache;
	this.evalManager = evalManager;
	this.staticEvaluator = staticEvaluator;
	this.weights = weights;
	try {
		this.thisType = stack.getReferenceType();
	} catch (DebugException e) {
		throw new RuntimeException(e);
	}
	this.project = EclipseUtils.getProject(stack);
	this.intType = EclipseUtils.getFullyQualifiedType("int", stack, target, typeCache);
	this.booleanType = EclipseUtils.getFullyQualifiedType("boolean", stack, target, typeCache);
	this.oneValue = target.newValue(1);
	this.one = expressionMaker.makeInt(1, oneValue, intType, thread);
	this.imethodCache = new HashMap<Method, IMethod>();
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:25,
代码来源:ExpressionGenerator.java

示例7: getUnitFromStack

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public static VFUnit getUnitFromStack(IJavaThread thread) throws CoreException {
	String fqn = getUnitFromTopStackFrame(thread);
	if(fqn == null) {
		throw new RuntimeException("No unit found on top stackframe");
	} else {
		DataModel model = ServiceUtil.getService(DataModel.class);
		VFUnit unit = model.getVFUnit(fqn);
		if(unit == null) {
			throw new RuntimeException("Unit not found in jimple model ["+fqn+"]");
		}
		return unit;
	}
}
 

开发者ID:VisuFlow,
项目名称:visuflow-plugin,
代码行数:14,
代码来源:StackExaminer.java

示例8: getUnitFromTopStackFrame

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
private static String getUnitFromTopStackFrame(IJavaThread thread) throws CoreException {
	if (!thread.hasStackFrames()) {
		return null;
	}

	IStackFrame top = thread.getTopStackFrame();
	if (top.getVariables().length > 0) {
		for (IVariable var : top.getVariables()) {
			try {
				IValue value = var.getValue();
				if (value instanceof IJavaValue) {
					IJavaObject javaValue = (IJavaObject) value;
					IJavaDebugTarget debugTarget = thread.getDebugTarget().getAdapter(IJavaDebugTarget.class);
					IJavaValue arg = debugTarget.newValue("Fully Qualified Name");
					// the signature (2nd argument) can be retrieved with javap. Unit extends soot.tagkit.Host for the tag support
					// -> javap -cp soot-trunk.jar -s soot.tagkit.Host
					// the signature is in the output under "descriptor"
					IJavaType type = javaValue.getJavaType();
					if (isTagHost(type)) { // check, if this is a unit, which contains Tags
						IJavaValue fqnTag = javaValue.sendMessage("getTag", "(Ljava/lang/String;)Lsoot/tagkit/Tag;", new IJavaValue[] { arg }, thread,
								false);
						IJavaValue tagValue = ((IJavaObject) fqnTag).sendMessage("getValue", "()[B", new IJavaValue[0], thread, false);
						IJavaArray byteArray = (IJavaArray) tagValue;
						byte[] b = new byte[byteArray.getLength()];
						for (int i = 0; i < b.length; i++) {
							IJavaPrimitiveValue byteValue = (IJavaPrimitiveValue) byteArray.getValue(i);
							b[i] = byteValue.getByteValue();
						}
						String currentUnitFqn = new String(b);
						return currentUnitFqn;
					}
				}
			} catch (Exception e) {
				logger.error("Couldn't retrieve variable " + var.getName() + " from top stack frame", e);
			}
		}
	}
	return null;
}
 

开发者ID:VisuFlow,
项目名称:visuflow-plugin,
代码行数:40,
代码来源:StackExaminer.java

示例9: handleLinebreakPoint

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
void handleLinebreakPoint(IJavaThread thread) {
	PandionJUI.executeUpdate(() -> {
		exception = null;
		exceptionFrame = null;
		handleFrames(thread);
	});
}
 

开发者ID:andre-santos-pt,
项目名称:pandionj,
代码行数:8,
代码来源:PandionJView.java

示例10: handleExceptionBreakpoint

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public void handleExceptionBreakpoint(IJavaThread thread, String exceptionName) {
	PandionJUI.executeUpdate(() -> {
		thread.terminateEvaluation();
		exception = exceptionName;
		exceptionFrame = thread.getTopStackFrame();
		handleFrames(thread);
		if(!runtime.isEmpty()) {
			StackFrameModel frame = runtime.getFrame(exceptionFrame);
			int line = exceptionFrame.getLineNumber();
			frame.processException(exception, line);
		}
	}); 
}
 

开发者ID:andre-santos-pt,
项目名称:pandionj,
代码行数:14,
代码来源:PandionJView.java

示例11: handleFrames

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
private void handleFrames(IJavaThread thread) throws DebugException {
	assert thread != null;

	if(introScreen != null) {
		introScreen.dispose();
		introScreen = null;
	}

	if(thread.getLaunch() != launch) {
		launch = thread.getLaunch();
		runtime = new RuntimeModel();
		if(runtimeView != null)
			runtimeView.dispose();
		runtimeView = new RuntimeViewer(parent);
		runtimeView.setInput(runtime);
		runtimeView.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
		runtimeView.requestLayout();
	}

	contextService.activateContext(PandionJConstants.CONTEXT_ID);

	runtime.update(thread);

	if(!runtime.isEmpty() && !runtime.isTerminated()) {
		StackFrameModel frame = runtime.getTopFrame();
		IFile sourceFile = frame.getSourceFile();
		int lineNumber = frame.getLineNumber();
		if(sourceFile != null && lineNumber != -1)
			;//PandionJUI.navigateToLine(sourceFile, lineNumber);
	}
}
 

开发者ID:andre-santos-pt,
项目名称:pandionj,
代码行数:32,
代码来源:PandionJView.java

示例12: NativeHandler

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public NativeHandler(IJavaThread thread, IJavaStackFrame stack, IJavaDebugTarget target, TypeCache typeCache) {
	try {
		this.enabled = true;
		IJavaClassType exceptionType = EclipseUtils.loadLibrary("codehint.NativeCall", stack, target, typeCache);
		exceptionObj = exceptionType.newInstance("()V", new IJavaValue[0], thread);
	} catch (DebugException e) {
		throw new RuntimeException(e);
	}
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:10,
代码来源:NativeHandler.java

示例13: StaticEvaluator

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public StaticEvaluator(IJavaStackFrame stack, ExpressionEvaluator expressionEvaluator, TypeCache typeCache, ValueCache valueCache) {
	this.stack = stack;
	this.thread = (IJavaThread)stack.getThread();
	this.expressionEvaluator = expressionEvaluator;
	this.typeCache = typeCache;
	this.valueCache = valueCache;
	numCrashes = 0;
	unsupportedEncodings = new HashSet<String>();
	illegalPatterns = new HashSet<String>();
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:11,
代码来源:StaticEvaluator.java

示例14: loadClass

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
/**
  * Loads the given type.
  * TODO: There must be a better way to do this.
  * @param typeName The name of the type to load.
  * @param stack The current stack frame.
  * @param target The debug target.
  * @param typeCache The type cache.
  * @return Whether the type was loaded.
  */
 private static boolean loadClass(String typeName, IJavaStackFrame stack, IJavaDebugTarget target, TypeCache typeCache) {
 	try {
 		//long startTime = System.currentTimeMillis();
 		//System.out.println("Loading class " + typeName);
 		// Class.forName needs array types to be in signature form.
 		String sigTypeName = typeName;
 		int arrIndex = typeName.indexOf("[]");
 		if (arrIndex != -1)
 			sigTypeName = getSignatureTypeName(typeName);
 		// Load the actual type.
 		IJavaValue result = ((IJavaClassType)EclipseUtils.getFullyQualifiedType("java.lang.Class", stack, target, typeCache)).sendMessage("forName", "(Ljava/lang/String;)Ljava/lang/Class;", new IJavaValue[] { target.newValue(sigTypeName) }, (IJavaThread)stack.getThread());
 		IJavaType type = ((IJavaClassObject)result).getInstanceType();
 		typeCache.add(typeName, type);
 		//System.out.println("Loaded class " + typeName + " in " + (System.currentTimeMillis() - startTime) + "ms.");
 	} catch (DebugException e) {
 		//System.out.println("Fast load of " + typeName + " failed.");
 		try {
	if (getASTEvaluationEngine(stack).getCompiledExpression(typeName + ".class", stack).hasErrors())
		return false;  // We might be trying to load something illegal, in which case loadClassSlow would crash.
} catch (DebugException ex) {
	throw new RuntimeException(ex);
}
 		loadClassSlow(typeName, stack);  // For some things (e.g., CodeHint's own libraries?) slow works but fast does not.
 	}
 	return true;
 }
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:36,
代码来源:EclipseUtils.java

示例15: ValueCache

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public ValueCache(IJavaDebugTarget target, IJavaThread thread) {
	this.target = target;
	this.thread = thread;
	valueCache = new HashMap<IJavaValue, Value>();
	intVals = new HashMap<Integer, Value>();
	t = Value.makeValue(target.newValue(true), this, thread);
	f = Value.makeValue(target.newValue(false), this, thread);
	stringVals = new HashMap<String, Value>();
	collectionDisableds = new ArrayList<IJavaObject>();
	objectEquals = new HashMap<UnorderedPair<IJavaObject, IJavaObject>, Boolean>();
	this.voidValue = Value.makeValue(target.voidValue(), this, thread);
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:13,
代码来源:ValueCache.java

示例16: checkObjectEquality

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public boolean checkObjectEquality(IJavaObject x, IJavaObject y, IJavaThread thread) throws DebugException {
	UnorderedPair<IJavaObject, IJavaObject> pair = new UnorderedPair<IJavaObject, IJavaObject>(x, y);
	Boolean resultObj = objectEquals.get(pair);
	if (resultObj != null)
		return resultObj;
	boolean result = Value.objectEquals(x, y, thread);
	objectEquals.put(pair, result);
	return result;
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:10,
代码来源:ValueCache.java

示例17: makeNumber

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public NumberLiteral makeNumber(String val, IJavaValue value, IJavaType type, IJavaThread thread) {
	int lastChar = val.charAt(val.length() - 1);
	// Rules taken from: http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html.
	if (lastChar == 'l' || lastChar == 'L')
		return makeLong(Long.parseLong(val), value, type, thread);
	else if (lastChar == 'f' || lastChar == 'F')
		return makeFloat(Float.parseFloat(val), value, type, thread);
	else if (lastChar == 'd' || lastChar == 'D')
		return makeDouble(Double.parseDouble(val), value, type, thread);
	else
		return makeInt(Integer.parseInt(val), value, type, thread);
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:13,
代码来源:ExpressionMaker.java

示例18: makeStaticName

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public Name makeStaticName(String name, IJavaReferenceType type, IJavaThread thread) {
	try {
		IJavaValue value = type.getClassObject();
		Result result = new Result(value, valueCache, thread);
		Name expr = newStaticName(name, value, type, thread);
		expressionEvaluator.setResult(expr, result, Collections.<Effect>emptySet());
		return expr;
	} catch (DebugException e) {
		throw new RuntimeException(e);
	}
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:12,
代码来源:ExpressionMaker.java

示例19: makeInfix

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public InfixExpression makeInfix(Expression left, InfixExpression.Operator op, Expression right, IJavaType type, IJavaThread thread) throws NumberFormatException, DebugException {
	InfixExpression e = makeInfix(left, op, right, type);
	Result operandResults = expressionEvaluator.computeResultForBinaryOp(left, right);
	if (operandResults == null)
		return null;
	Value value = expressionEvaluator.computeInfixOp(expressionEvaluator.getValue(left, Collections.<Effect>emptySet()), op, operandResults.getValue().getValue(), left.getStaticType() != null ? left.getStaticType() : right.getStaticType());
	if (value == null)
		return null;
	Result result = new Result(value, operandResults.getEffects());
	expressionEvaluator.setResult(e, result, Collections.<Effect>emptySet());
	return e;
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:13,
代码来源:ExpressionMaker.java

示例20: makeFieldAccess

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public FieldAccess makeFieldAccess(Expression obj, String name, IJavaType fieldType, Field field, IJavaThread thread) {
	try {
		FieldAccess e = makeFieldAccess(obj, name, fieldType, field);
		Result objResult = expressionEvaluator.getResult(obj, Collections.<Effect>emptySet());
		IJavaValue value = expressionEvaluator.computeFieldAccess(objResult.getValue().getValue(), obj.getStaticType(), field);
		Result result = new Result(value, objResult.getEffects(), valueCache, thread);
		expressionEvaluator.setResult(e, result, Collections.<Effect>emptySet());
		return e;
	} catch (DebugException ex) {
		throw new RuntimeException(ex);
	}
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:13,
代码来源:ExpressionMaker.java

示例21: makePrefix

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public PrefixExpression makePrefix(Expression operand, PrefixExpression.Operator op, IJavaThread thread) {
	try {
		PrefixExpression e = makePrefix(operand, op);
		Result operandResult = expressionEvaluator.getResult(operand, Collections.<Effect>emptySet());
		Value value = expressionEvaluator.computePrefixOp(operandResult.getValue().getValue(), op);
		Result result = new Result(value, operandResult.getEffects());
		expressionEvaluator.setResult(e, result, Collections.<Effect>emptySet());
		return e;
	} catch (DebugException ex) {
		throw new RuntimeException(ex);
	}
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:13,
代码来源:ExpressionMaker.java

示例22: makePostfix

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public PostfixExpression makePostfix(Expression operand, PostfixExpression.Operator op, IJavaThread thread) {
	PostfixExpression e = new PostfixExpression(operand, op);
	Result operandResult = expressionEvaluator.getResult(operand, Collections.<Effect>emptySet());
	IJavaValue value = ExpressionEvaluator.computePostfixOp(operandResult.getValue().getValue(), op);
	Result result = new Result(value, operandResult.getEffects(), valueCache, thread);
	expressionEvaluator.setResult(e, result, Collections.<Effect>emptySet());
	return e;
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:9,
代码来源:ExpressionMaker.java

示例23: makeSuperFieldAccess

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public SuperFieldAccess makeSuperFieldAccess(Name qualifier, Expression receiverExpr, String name, IJavaType fieldType, Field field, IJavaThread thread) {
	try {
		SuperFieldAccess e = new SuperFieldAccess(fieldType, qualifier, makeSimpleName(null, name));
		IJavaValue value = expressionEvaluator.computeFieldAccess(expressionEvaluator.getValue(receiverExpr, Collections.<Effect>emptySet()), receiverExpr.getStaticType(), field);
		if (value != null)
			expressionEvaluator.setResult(e, new Result(value, valueCache, thread), Collections.<Effect>emptySet());
		expressionEvaluator.setField(e, field);
		return e;
	} catch (DebugException ex) {
		throw new RuntimeException(ex);
	}
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:13,
代码来源:ExpressionMaker.java

示例24: makeValue

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public static Value makeValue(IJavaValue value, ValueCache valueCache, IJavaThread thread) {
	try {
		Value wrapper = valueCache.getValue(value);
		if (wrapper != null)
			return wrapper;
		if (value != null && "Ljava/lang/String;".equals(value.getSignature()))
			return valueCache.getStringJavaValue(value.getValueString());
		else
			wrapper = new Value(value, thread, valueCache);
		valueCache.addValue(wrapper);
		return wrapper;
	} catch (DebugException e) {
		throw new RuntimeException(e);
	}
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:16,
代码来源:Value.java

示例25: equals

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
private static boolean equals(IJavaValue x, IJavaValue y, IJavaThread thread, ValueCache valueCache) {
	try {
		if (x == y || (x.isNull() && y.isNull()))
			return true;
		if (x.isNull() || y.isNull())
			return false;
		if (x instanceof IJavaArray && y instanceof IJavaArray) {
			if (!x.getSignature().equals(y.getSignature()))
				return false;  // Even though arrays are covariant, using the subtype could crash when the supertype does not (e.g., normal Java array covariange bug).
			IJavaArray a = (IJavaArray)x;
			IJavaArray b = (IJavaArray)y;
			if (a.getLength() != b.getLength())
				return false;
			for (int i = 0; i < a.getLength(); i++)  // TODO-opt: Should I finitize this so it doesn't take too long?
				if (!equals(a.getValue(i), b.getValue(i), thread, valueCache))  // Recurse on the actual values.
					return false;
			return true;
		}
		String signature = x.getSignature();
		if (!signature.equals(y.getSignature()))  // Short circuit if the two values are not the same type.
			return false;
		if ("V".equals(signature))
			return true;
		if (x instanceof IJavaPrimitiveValue || "Ljava/lang/String;".equals(signature))
			return x.toString().equals(y.toString());
		else
			return valueCache.checkObjectEquality((IJavaObject)x, (IJavaObject)y, thread);
	} catch (DebugException e) {
		throw new RuntimeException(e);
	}
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:32,
代码来源:Value.java

示例26: breakpointHit

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
void breakpointHit(IJavaThread thread, IJavaBreakpoint breakpoint) {
	suspendedThread = thread;
	suspendedAtBreakpoint = breakpoint;
}
 

开发者ID:VisuFlow,
项目名称:visuflow-plugin,
代码行数:5,
代码来源:JimpleBreakpointManager.java

示例27: update

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public void update(IJavaThread thread) throws DebugException {
	if(launch != thread.getLaunch()) {	
		launch = thread.getLaunch();
		callStack.clear();
		objects.clear();
		looseObjects.clear();
		step = 0;
		terminated = false;
		countActive = 0;
		setChanged();
		notifyObservers(new Event<IStackFrameModel>(Event.Type.NEW_STACK, null));
	}

	//		for(EntityModel<?> o : objects.values().toArray(new EntityModel[objects.size()])) {
	//			if(o instanceof ArrayModel && o.update(step))
	//				setChanged();
	//			else if(o instanceof ObjectModel) {
	//				((ObjectModel) o).traverseSiblings(new SiblingVisitor() {
	//					public void visit(IEntityModel object, ObjectModel parent, int index, int depth, String field) {
	//						try {
	//							if(object != null && ((EntityModel<?>) object).update(step))
	//								setChanged();
	//						}
	//						catch(DebugException e) {
	//							//							throw e;
	//						}
	//					}
	//				});
	//			}
	//		}

	PandionJView.getInstance().executeInternal(() -> {
		handle(thread.getStackFrames());
		staticRefs.update(step);
	});

	updateActiveStack();

	step++;
	setChanged();
	notifyObservers(new Event<IStackFrameModel>(Event.Type.STEP, getTopFrame()));

}
 

开发者ID:andre-santos-pt,
项目名称:pandionj,
代码行数:44,
代码来源:RuntimeModel.java

示例28: handleDebugEvents

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public void handleDebugEvents(DebugEvent[] events) {
	if(events.length > 0 && runtime != null && !runtime.isTerminated()) {
		DebugEvent e = events[0];
		PandionJUI.executeUpdate(() -> {
			if(e.getKind() == DebugEvent.SUSPEND && e.getDetail() == DebugEvent.STEP_END && exception == null) {
				IJavaThread thread = (IJavaThread) e.getSource();		
				IStackFrame f = thread.getTopStackFrame();
				if(f == null)
					return;
				ISourceLocator sourceLocator = f.getLaunch().getSourceLocator();
				Object sourceElement = sourceLocator == null ? null : sourceLocator.getSourceElement(f);

				if(sourceElement != null) {
					if(sourceElement instanceof IFile)
						handleFrames(thread);
					else
						thread.stepReturn();
					if(f != null && f.getLineNumber() == -1)
						thread.resume(); // to jump over injected code
				}
				else {
					thread.stepReturn();
				}

				//						Job job = Job.create("Update table", (ICoreRunnable) monitor -> {
				//							System.out.println("STEP");
				//							thread.stepInto();
				//						});
				//						job.schedule(3000);

			}
			else if(e.getKind() == DebugEvent.CHANGE && e.getDetail() == DebugEvent.CONTENT) {
				runtime = new RuntimeModel();
				runtimeView.setInput(runtime);
			}
			else if(e.getKind() == DebugEvent.TERMINATE && e.getSource() instanceof RuntimeProcess) {
				runtime.setTerminated();
			}
		});
	}
}
 

开发者ID:andre-santos-pt,
项目名称:pandionj,
代码行数:42,
代码来源:PandionJView.java

示例29: javaStringOfValue

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
/**
   * Returns a string representing the given value this is
   * a legal Java expression, except in the case of arrays,
   * where we show a debug-like view of them.
   * @param value The value whose string representation is desired.
   * @param stack The current stack frame.
   * @param callToString Whether we should call toString on
   * objects or simply use their default strings in Eclipse.
   * @return A string that is the legal Java expression of
   * the given value, except for arrays, which show their values.
   * @throws DebugException if we cannot get the value.
   */
  public static String javaStringOfValue(IJavaValue value, IJavaStackFrame stack, boolean callToString) throws DebugException {
  	String sig = value.getSignature();
if (value.isNull())
  		return "null";
  	else if (value instanceof IJavaArray) {
  		StringBuilder sb = new StringBuilder();
  		sb.append("[");
  		for (IJavaValue arrValue: ((IJavaArray)value).getValues()) {
  			if (sb.length() > 1)
  				sb.append(",");
  			sb.append(javaStringOfValue(arrValue, stack, callToString));
  		}
  		sb.append("]");
  		return sb.toString();
  	} else if ("C".equals(sig))
  		return "'" + value.getValueString() + "'";
  	else if ("Ljava/lang/String;".equals(sig))
  		return "\"" + value.getValueString() + "\"";
  	else if (callToString && value instanceof IJavaObject) {
  		try {
  			return ((IJavaObject)value).sendMessage("toString", "()Ljava/lang/String;", new IJavaValue[] { }, (IJavaThread)stack.getThread(), null).getValueString();
  		} catch (DebugException e) {
  			return value.toString();
  		}
  	}
  	String str = value.toString();  // For Objects, getValueString() returns just the id and not the type.
  	if ("NaN".equals(str) && "F".equals(sig))
  		return "Float.NaN";
  	else if ("Infinity".equals(str) && "F".equals(sig))
  		return "Float.POSITIVE_INFINITY";
  	else if ("-Infinity".equals(str) && "F".equals(sig))
  		return "Float.NEGATIVE_INFINITY";
  	else if ("NaN".equals(str) && "D".equals(sig))
  		return "Double.NaN";
  	else if ("Infinity".equals(str) && "D".equals(sig))
  		return "Double.POSITIVE_INFINITY";
  	else if ("-Infinity".equals(str) && "D".equals(sig))
  		return "Double.NEGATIVE_INFINITY";
  	else if ("F".equals(sig))
  		return str + "f";
  	else if ("D".equals(sig))
  		return str + "d";
  	else if ("J".equals(sig))
  		return str + "L";
  	return str;
  }
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:59,
代码来源:EclipseUtils.java

示例30: SynthesisDialog

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public SynthesisDialog(Shell parentShell, String varTypeName, IJavaType varType, IJavaStackFrame stack, PropertyDialog propertyDialog, SynthesisWorker synthesisWorker) {
	super(parentShell);
	setShellStyle(getShellStyle() | SWT.RESIZE);
	this.varTypeName = varTypeName;
	this.varType = varType;
	this.comboIndex = -1;
	this.propertyDialog = propertyDialog;
	this.pdspecIsValid = false;
	this.fService = (IHandlerService)PlatformUI.getWorkbench().getAdapter(IHandlerService.class);
	this.okButton = null;
	this.stack = stack;
	this.results = null;
	this.property = null;
	IAstEvaluationEngine engine = EclipseUtils.getASTEvaluationEngine(stack);
	this.initialSkeletonText = ExpressionSkeleton.HOLE_SYNTAX;
	this.skeletonIsValid = false;
	this.skeletonValidator = new ExpressionSkeletonValidator(stack, varTypeName, engine);
	this.skeletonResult = null;
	this.blockedNativeCalls = false;
	this.handledSideEffects = false;
	this.searchCancelButton = null;
	this.amSearching = false;
	this.numSearches = 0;
	this.shouldContinue = true;
	this.searchButtonId = -1;
	this.monitor = null;
	this.table = null;
	this.maxExprLen = 0;
	this.maxResultLen = 0;
	this.maxToStringLen = 0;
	this.maxEffectsLen = 0;
	this.needsToStringColumn = false;
	this.statements = null;
	this.lastStatements = null;
	this.filteredStatements = null;
	this.amFiltering = false;
	this.synthesisWorker = synthesisWorker;
	this.project = EclipseUtils.getProject(stack);
	this.target = (IJavaDebugTarget)stack.getDebugTarget();
	this.thread = (IJavaThread)stack.getThread();
	this.evaluationEngine = engine;
	this.typeCache = new TypeCache();
	this.valueCache = new ValueCache(target, thread);
	this.subtypeChecker = new SubtypeChecker(stack, target, typeCache);
	this.timeoutChecker = new TimeoutChecker(thread, stack, target, typeCache);
	this.nativeHandler = new NativeHandler(thread, stack, target, typeCache);
	this.sideEffectHandler = new SideEffectHandler(stack, project);
	expressionEvaluator = new ExpressionEvaluator(stack, valueCache, typeCache, subtypeChecker, timeoutChecker, nativeHandler, sideEffectHandler, Synthesizer.getMetadata());
	this.expressionMaker = new ExpressionMaker(stack, expressionEvaluator, valueCache, typeCache);
	this.evalManager = new EvaluationManager(varType == null, true, stack, expressionEvaluator, subtypeChecker, typeCache, valueCache, timeoutChecker, sideEffectHandler);
	this.staticEvaluator = new StaticEvaluator(stack, expressionEvaluator, typeCache, valueCache);
	Weights weights = new Weights();
	this.expressionGenerator = new DeterministicExpressionGenerator(target, stack, sideEffectHandler, expressionMaker, expressionEvaluator, subtypeChecker, typeCache, evalManager, staticEvaluator, weights);
	//this.expressionGenerator = new codehint.exprgen.StochasticExpressionGenerator(target, stack, sideEffectHandler, expressionMaker, expressionEvaluator, subtypeChecker, typeCache, evalManager, staticEvaluator, weights);
	this.skeleton = null;
	this.expressionSorter = new ExpressionSorter(expressionEvaluator, weights);
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:58,
代码来源:SynthesisDialog.java

示例31: StringValue

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public StringValue(IJavaValue value, IJavaThread thread, ValueCache valueCache) {
	super(value, thread, valueCache);
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:4,
代码来源:StringValue.java

示例32: setValue

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
void setValue(Expression e, IJavaValue v, Set<Effect> effects, IJavaThread thread) {
	Utils.addToMapMap(results, effects, e.getID(), new Result(v, valueCache, thread));
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:4,
代码来源:ExpressionEvaluator.java

示例33: initSimple

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
private <T extends Expression> T initSimple(T e, IJavaValue value, IJavaThread thread) {
	//e.setProperty("isConstant", true);
	Result result = new Result(value, valueCache, thread);
	expressionEvaluator.setResult(e, result, Collections.<Effect>emptySet());
	return e;
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:7,
代码来源:ExpressionMaker.java

示例34: makeInt

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public IntLiteral makeInt(int num, IJavaValue value, IJavaType type, IJavaThread thread) {
	return initSimple(new IntLiteral(type, num), value, thread);
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:4,
代码来源:ExpressionMaker.java

示例35: makeLong

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public LongLiteral makeLong(long num, IJavaValue value, IJavaType type, IJavaThread thread) {
	return initSimple(new LongLiteral(type, num), value, thread);
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:4,
代码来源:ExpressionMaker.java

示例36: makeFloat

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public FloatLiteral makeFloat(float num, IJavaValue value, IJavaType type, IJavaThread thread) {
	return initSimple(new FloatLiteral(type, num), value, thread);
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:4,
代码来源:ExpressionMaker.java

示例37: makeDouble

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public DoubleLiteral makeDouble(double num, IJavaValue value, IJavaType type, IJavaThread thread) {
	return initSimple(new DoubleLiteral(type, num), value, thread);
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:4,
代码来源:ExpressionMaker.java

示例38: makeBoolean

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public BooleanLiteral makeBoolean(boolean val, IJavaValue value, IJavaType type, IJavaThread thread) {
	return initSimple(new BooleanLiteral(type, val), value, thread);
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:4,
代码来源:ExpressionMaker.java

示例39: makeChar

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public CharacterLiteral makeChar(char val, IJavaValue value, IJavaType type, IJavaThread thread) {
	return initSimple(new CharacterLiteral(type, val), value, thread);
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:4,
代码来源:ExpressionMaker.java

示例40: makeString

点赞 2

import org.eclipse.jdt.debug.core.IJavaThread; //导入依赖的package包/类
public StringLiteral makeString(String val, IJavaValue value, IJavaType type, IJavaThread thread) {
	return initSimple(new StringLiteral(type, val), value, thread);
}
 

开发者ID:jgalenson,
项目名称:codehint,
代码行数:4,
代码来源:ExpressionMaker.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)