本文整理汇总了Java中soot.jimple.toolkits.callgraph.Edge.tgt方法的典型用法代码示例。如果您正苦于以下问题:Java Edge.tgt方法的具体用法?Java Edge.tgt怎么用?Java Edge.tgt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类soot.jimple.toolkits.callgraph.Edge
的用法示例。
在下文中一共展示了Edge.tgt方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import soot.jimple.toolkits.callgraph.Edge; //导入方法依赖的package包/类
private void visit(Set<SootMethod> alreadyVisited, SootMethod current, int depth) {
if (depth >= ConfigCHA.v().getGraphOutMaxDepth())
return;
Iterator<Edge> it = cg.edgesOutOf(current);
while (it.hasNext()) {
Edge e = it.next();
SootMethod tgt = e.tgt();
for (int i=0; i < ConfigCHA.v().getGraphOutMaxDepth(); i++) {
if (depth <= i)
out.get(i).println(current+";"+tgt);
}
if (alreadyVisited.contains(tgt))
continue;
alreadyVisited.add(tgt);
visit(alreadyVisited, tgt, depth+1);
}
}
示例2: findTargetMethods
import soot.jimple.toolkits.callgraph.Edge; //导入方法依赖的package包/类
private List<SootMethod> findTargetMethods(Unit unit, CallGraph cg, boolean canBeNullList, boolean canBeNative){
List<SootMethod> target = new ArrayList<SootMethod>();
Iterator<Edge> it = cg.edgesOutOf(unit);
while (it.hasNext()){
Edge edge = it.next();
SootMethod targetMethod = edge.tgt();
if (targetMethod.isNative() && !canBeNative )
continue;
if (edge.kind() == Kind.CLINIT )
continue;
target.add(targetMethod);
}
if (target.size() < 1 && !canBeNullList){
throw new RuntimeException("No target method for: "+unit);
}
return target;
}
示例3: analyzeEdge
import soot.jimple.toolkits.callgraph.Edge; //导入方法依赖的package包/类
private void analyzeEdge(Edge edge)
{
SootMethod m=edge.tgt();
if (edge.isThreadRunCall())
{
threadsEntryMethod.add(m);
dprintln("Found thread entry method: "+m.getSignature());
}
}
示例4: countCallChains
import soot.jimple.toolkits.callgraph.Edge; //导入方法依赖的package包/类
private static long countCallChains(SootMethod method, int k) {
if (k == 0)
return 1;
long count = 1;
Iterator<Edge> edges = Scene.v().getCallGraph().edgesOutOf(method);
while(edges.hasNext()) {
Edge edge = edges.next();
if (edge.isExplicit()) {
SootMethod target = edge.tgt();
count = count + countCallChains(target, k-1);
}
}
return count;
}
示例5: search
import soot.jimple.toolkits.callgraph.Edge; //导入方法依赖的package包/类
private static void search(CallGraph cg, SootMethod l, Stack<SootMethod> stack, int depth) {
logger.debug(" <"+ depth +"> propagate from "+ l);
if (depth == 1)
currentWrapper = l;
if (depth == 2) {
currentEntryPoint = l;
if (currentEntryPoint.toString().contains("GenerationGG") ||
//currentEntryPoint.toString().contains("init>") ||
currentEntryPoint.toString().contains("ServicesInit:")) {
} else {
if (!currentEntryPoint.toString().contains("DumbClass:")) {
EntryPointKey epk = new EntryPointKey(currentWrapper, currentEntryPoint);
entryPointsToPermissionSet.put(epk, null);
}
}
}
if (alreadyComputed.contains(l)) {
addPermissionsToStack(stack, l);
return;
}
Iterator<Edge> it = cg.edgesOutOf(l);
while (it.hasNext()) {
Edge e = it.next();
SootMethod outMethod = e.tgt();
if (outMethod.toString().equals(l.toString())){
logger.warn("outMethod same as l: "+ l);
continue;
}
if (stack.contains(outMethod))
throw new RuntimeException("cycle in stack!\n" + outMethod +"\n"+ Util.printStack(stack));
addPermissionsToStack(stack, outMethod);
stack.push(outMethod);
search(cg, outMethod, stack, depth+1);
stack.pop();
}
alreadyComputed.add(l);
if (!methodToPermissionSet.containsKey(l))
methodToPermissionSet.put(l, new HashSet<String>());
}