• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JimpleBasedInterproceduralCFG类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: main

import soot.jimple.toolkits.ide.icfg.JimpleBasedInterproceduralCFG; //导入依赖的package包/类
/**
 * @param args
 */
public static void main(String[] args) {
	
	
	PackManager.v().getPack("wjtp").add(new Transform("wjtp.ifds", new SceneTransformer() {
		protected void internalTransform(String phaseName, @SuppressWarnings("rawtypes") Map options) {

			IFDSTabulationProblem<Unit,?,SootMethod,InterproceduralCFG<Unit,SootMethod>> problem = new IFDSPossibleTypes(new JimpleBasedInterproceduralCFG());
			
			@SuppressWarnings({ "rawtypes", "unchecked" })
			JimpleIFDSSolver<?,InterproceduralCFG<Unit,SootMethod>> solver = new JimpleIFDSSolver(problem);
			solver.solve();
		}
	}));
	
	soot.Main.main(args);
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:20,代码来源:Main.java


示例2: makeICFG

import soot.jimple.toolkits.ide.icfg.JimpleBasedInterproceduralCFG; //导入依赖的package包/类
private static BiDiInterproceduralCFG<Unit, SootMethod> makeICFG(AnalysisDirection direction) {
	JimpleBasedInterproceduralCFG fwdIcfg = new JimpleBasedInterproceduralCFG();
	if (direction == AnalysisDirection.FORWARDS)
		return fwdIcfg;
	else
		return new BackwardsInterproceduralCFG(fwdIcfg);
}
 
开发者ID:johanneslerch,项目名称:FlowTwist,代码行数:8,代码来源:TabulationProblem.java


示例3: InfoflowCFG

import soot.jimple.toolkits.ide.icfg.JimpleBasedInterproceduralCFG; //导入依赖的package包/类
public InfoflowCFG() {
	this(new JimpleBasedInterproceduralCFG());
}
 
开发者ID:themaplelab,项目名称:boomerang,代码行数:4,代码来源:InfoflowCFG.java


示例4: notifyMethodChanged

import soot.jimple.toolkits.ide.icfg.JimpleBasedInterproceduralCFG; //导入依赖的package包/类
@Override
public void notifyMethodChanged(SootMethod m) {
	if (delegate instanceof JimpleBasedInterproceduralCFG)
		((JimpleBasedInterproceduralCFG) delegate).initializeUnitToOwner(m);
}
 
开发者ID:themaplelab,项目名称:boomerang,代码行数:6,代码来源:InfoflowCFG.java


示例5: PropagationProblem

import soot.jimple.toolkits.ide.icfg.JimpleBasedInterproceduralCFG; //导入依赖的package包/类
public PropagationProblem(JimpleBasedInterproceduralCFG icfg) {
  super(icfg);
  this.icfg = icfg;
}
 
开发者ID:serval-snt-uni-lu,项目名称:DroidRA,代码行数:5,代码来源:PropagationProblem.java


示例6: internalTransform

import soot.jimple.toolkits.ide.icfg.JimpleBasedInterproceduralCFG; //导入依赖的package包/类
@Override
protected void internalTransform(String phaseName, @SuppressWarnings("rawtypes") Map options) {
  PropagationTimers.v().totalTimer.start();
  PropagationTimers.v().misc.start();
  StringValueAnalysis.initialize();

  JimpleBasedInterproceduralCFG iCfg = new PropagationIcfg();
  AnalysisParameters.v().setIcfg(iCfg);
  PropagationProblem problem = new PropagationProblem(iCfg);
  for (SootMethod ep : Scene.v().getEntryPoints()) {
    if (ep.isConcrete()) {
      problem.getInitialSeeds().add(ep.getActiveBody().getUnits().getFirst());
    }
  }

  int iterationCounter = 0;
  PropagationSolver solver = null;

  while (iterationCounter < MAX_ITERATIONS) {
    IterationSolver.v().initialize(solver);
    PropagationTimers.v().misc.end();

    PropagationTimers.v().problemGeneration.start();
    solver = new PropagationSolver(problem);
    PropagationTimers.v().problemGeneration.end();

    PropagationTimers.v().ideSolution.start();
    logger.info("Solving propagation problem (iteration " + iterationCounter + ")");
    solver.solve();
    PropagationTimers.v().ideSolution.end();

    PropagationTimers.v().misc.start();
    if (!AnalysisParameters.v().isIterative() || IterationSolver.v().hasFoundFixedPoint()) {
      iterationCounter = MAX_ITERATIONS;
    } else {
      ++iterationCounter;
    }
  }
  PropagationTimers.v().misc.end();

  logger.info("Reached a fixed point");

  Results.addResult(resultBuilder.buildResult(solver));

  PropagationTimers.v().totalTimer.end();

  if (logger.isDebugEnabled()) {
    CallGraph cg = Scene.v().getCallGraph();

    Iterator<Edge> it = cg.listener();
    while (it.hasNext()) {
      soot.jimple.toolkits.callgraph.Edge e = (soot.jimple.toolkits.callgraph.Edge) it.next();
      logger.debug("" + e.src() + e.srcStmt() + " =" + e.kind() + "=> " + e.tgt());
    }

    if (printer != null) {
      printer.print(solver);
    }
  }
}
 
开发者ID:serval-snt-uni-lu,项目名称:DroidRA,代码行数:61,代码来源:PropagationSceneTransformer.java


示例7: computeResults

import soot.jimple.toolkits.ide.icfg.JimpleBasedInterproceduralCFG; //导入依赖的package包/类
private Set<Pair<Value, Set<DefinitionStmt>>> computeResults(final String codeDir) {
//		extractVersion(codeDir);
		
		soot.G.reset();
 		final Set<Pair<Value, Set<DefinitionStmt>>> results = new HashSet<Pair<Value, Set<DefinitionStmt>>>();
 
		PackManager.v().getPack("wjtp").add(new Transform("wjtp.ifds", new SceneTransformer() {
			protected void internalTransform(String phaseName, @SuppressWarnings("rawtypes") Map options) {
//				Scene.v().getSootClass(className).setApplicationClass();
				System.out.println("Running IFDS on initial CFG...");
				
				long nanoBeforeCFG = System.nanoTime();
				InterproceduralCFG<Unit, SootMethod> icfg = new JimpleBasedInterproceduralCFG();
				System.out.println("ICFG created in " + (System.nanoTime() - nanoBeforeCFG) / 1E9 + " seconds.");

				IFDSTabulationProblem<Unit, Pair<Value, Set<DefinitionStmt>>, SootMethod,
							InterproceduralCFG<Unit, SootMethod>> problem =
					new IFDSReachingDefinitions(icfg);
				IFDSSolver<Unit,Pair<Value, Set<DefinitionStmt>>,SootMethod,
							InterproceduralCFG<Unit,SootMethod>> solver =
					new IFDSSolver<Unit,Pair<Value, Set<DefinitionStmt>>,SootMethod,
							InterproceduralCFG<Unit,SootMethod>>(problem);	

				long beforeSolver = System.nanoTime();
				System.out.println("Running solver...");
				solver.solve();
				System.out.println("Solver done in " + ((System.nanoTime() - beforeSolver) / 1E9) + " seconds.");
				
				SootMethod meth = Scene.v().getMainClass().getMethodByName("runMainAndExit"); 
				Unit ret = meth.getActiveBody().getUnits().getPredOf(meth.getActiveBody().getUnits().getLast());
				results.addAll(solver.ifdsResultsAt(ret));
			}
		}));

		final String sootcp = codeDir + File.separator + "bin" + File.pathSeparator
				+ JUNIT_DIR + "/lib/hamcrest-core-1.3.jar" + File.pathSeparator
				+ "/usr/lib/jvm/java-6-sun/jre/lib/rt.jar" + File.pathSeparator
				+ "/usr/lib/jvm/java-6-sun/jre/lib/jce.jar" + File.pathSeparator
				+ "C:\\Program Files\\Java\\jre7\\lib\\rt.jar" + File.pathSeparator
				+ "C:\\Program Files\\Java\\jre7\\lib\\jce.jar";
		System.out.println("Soot classpath: " + sootcp);
		
		soot.Main.v().run(new String[] {
				"-W",
				"-main-class", CLASS_NAME,
				"-process-path", codeDir + File.separator + "bin",
				"-src-prec", "java",
//				"-pp",
				"-cp", sootcp,
//				"-no-bodies-for-excluded",
//				"-exclude", "java",
//				"-exclude", "javax",
				"-output-format", "none",
				"-p", "jb", "use-original-names:true",
				"-p", "cg.spark", "on",
//				"-p", "cg.spark", "verbose:true",
				CLASS_NAME } );
		return results;
	}
 
开发者ID:StevenArzt,项目名称:reviser,代码行数:60,代码来源:IFDSReachingDefinitionsJUnitCommits.java


示例8: computeResults

import soot.jimple.toolkits.ide.icfg.JimpleBasedInterproceduralCFG; //导入依赖的package包/类
private Set<Pair<Value, Set<DefinitionStmt>>> computeResults(final String codeDir) {
//		extractVersion(codeDir);
		
		soot.G.reset();
 		final Set<Pair<Value, Set<DefinitionStmt>>> results = new HashSet<Pair<Value, Set<DefinitionStmt>>>();
 
		PackManager.v().getPack("wjtp").add(new Transform("wjtp.ifds", new SceneTransformer() {
			protected void internalTransform(String phaseName, @SuppressWarnings("rawtypes") Map options) {
//				Scene.v().getSootClass(className).setApplicationClass();
				System.out.println("Running IFDS on initial CFG...");
				
				long nanoBeforeCFG = System.nanoTime();
				InterproceduralCFG<Unit, SootMethod> icfg = new JimpleBasedInterproceduralCFG();
				System.out.println("ICFG created in " + (System.nanoTime() - nanoBeforeCFG) / 1E9 + " seconds.");

				IFDSTabulationProblem<Unit, Pair<Value, Set<DefinitionStmt>>, SootMethod,
							InterproceduralCFG<Unit, SootMethod>> problem =
					new IFDSReachingDefinitions(icfg);
				IFDSSolver<Unit,Pair<Value, Set<DefinitionStmt>>,SootMethod,
							InterproceduralCFG<Unit,SootMethod>> solver =
					new IFDSSolver<Unit,Pair<Value, Set<DefinitionStmt>>,SootMethod,
							InterproceduralCFG<Unit,SootMethod>>(problem);	

				long beforeSolver = System.nanoTime();
				System.out.println("Running solver...");
				solver.solve();
				System.out.println("Solver done in " + ((System.nanoTime() - beforeSolver) / 1E9) + " seconds.");
				
				SootMethod meth = Scene.v().getMainClass().getMethodByName("main"); 
				Unit ret = meth.getActiveBody().getUnits().getPredOf(meth.getActiveBody().getUnits().getLast());
				results.addAll(solver.ifdsResultsAt(ret));
			}
		}));

		final String sootcp = codeDir + File.separator + "bin" + File.pathSeparator
				+ JUNIT_DIR + "/lib/hamcrest-core-1.3.jar" + File.pathSeparator
				+ "/usr/lib/jvm/java-6-sun/jre/lib/rt.jar" + File.pathSeparator
				+ "/usr/lib/jvm/java-6-sun/jre/lib/jce.jar" + File.pathSeparator
				+ "C:\\Program Files\\Java\\jre7\\lib\\rt.jar" + File.pathSeparator
				+ "C:\\Program Files\\Java\\jre7\\lib\\jce.jar";
		System.out.println("Soot classpath: " + sootcp);
		
		soot.Main.v().run(new String[] {
				"-W",
				"-main-class", CLASS_NAME,
				"-process-path", codeDir + File.separator + "classes",
				"-src-prec", "java",
//				"-pp",
				"-cp", sootcp,
				"-no-bodies-for-excluded",
				"-exclude", "java",
				"-exclude", "javax",
				"-output-format", "none",
				"-p", "jb", "use-original-names:true",
				"-p", "cg.spark", "on",
//				"-p", "cg.spark", "verbose:true",
				CLASS_NAME } );
		return results;
	}
 
开发者ID:StevenArzt,项目名称:reviser,代码行数:60,代码来源:IFDSReachingDefinitionsAbcCommits.java


示例9: computeResults

import soot.jimple.toolkits.ide.icfg.JimpleBasedInterproceduralCFG; //导入依赖的package包/类
private Set<Local> computeResults(final String codeDir) {
//		extractVersion(codeDir);
		
		soot.G.reset();
 		final Set<Local> results = new HashSet<Local>();
 
		PackManager.v().getPack("wjtp").add(new Transform("wjtp.ifds", new SceneTransformer() {
			protected void internalTransform(String phaseName, @SuppressWarnings("rawtypes") Map options) {
//				Scene.v().getSootClass(className).setApplicationClass();
				System.out.println("Running IFDS on initial CFG...");
				
				long nanoBeforeCFG = System.nanoTime();
				InterproceduralCFG<Unit, SootMethod> icfg = new JimpleBasedInterproceduralCFG();
				System.out.println("ICFG created in " + (System.nanoTime() - nanoBeforeCFG) / 1E9 + " seconds.");

				IFDSTabulationProblem<Unit, Local, SootMethod, InterproceduralCFG<Unit, SootMethod>> problem =
					new IFDSUninitializedVariables(icfg);
				IFDSSolver<Unit,Local,SootMethod,InterproceduralCFG<Unit,SootMethod>> solver =
					new IFDSSolver<Unit,Local,SootMethod,InterproceduralCFG<Unit,SootMethod>>(problem);	

				long beforeSolver = System.nanoTime();
				System.out.println("Running solver...");
				solver.solve();
				System.out.println("Solver done in " + ((System.nanoTime() - beforeSolver) / 1E9) + " seconds.");
				
				SootMethod meth = Scene.v().getMainClass().getMethodByName("runMainAndExit"); 
				Unit ret = meth.getActiveBody().getUnits().getPredOf(meth.getActiveBody().getUnits().getLast());
				results.addAll(solver.ifdsResultsAt(ret));
			}
		}));

		final String sootcp = codeDir + File.pathSeparator
				+ JUNIT_DIR + "/hamcrest-core-1.3.jar" + File.pathSeparator
				+ "/usr/lib/jvm/java-6-sun/jre/lib/rt.jar" + File.pathSeparator
				+ "/usr/lib/jvm/java-6-sun/jre/lib/jce.jar" + File.pathSeparator
				+ "C:\\Program Files\\Java\\jre7\\lib\\rt.jar" + File.pathSeparator
				+ "C:\\Program Files\\Java\\jre7\\lib\\jce.jar";
		System.out.println("Soot classpath: " + sootcp);
		
		soot.Main.v().run(new String[] {
				"-W",
				"-main-class", CLASS_NAME,
				"-process-path", codeDir,
				"-src-prec", "java",
//				"-pp",
				"-cp", sootcp,
//				"-no-bodies-for-excluded",
//				"-exclude", "java",
//				"-exclude", "javax",
				"-output-format", "none",
				"-p", "jb", "use-original-names:true",
				"-p", "cg.spark", "on",
//				"-p", "cg.spark", "verbose:true",
				CLASS_NAME } );
		return results;
	}
 
开发者ID:StevenArzt,项目名称:reviser,代码行数:57,代码来源:IFDSUninitializedVariablesJUnit.java


示例10: setIcfg

import soot.jimple.toolkits.ide.icfg.JimpleBasedInterproceduralCFG; //导入依赖的package包/类
/**
 * Sets the interprocedural control flow graph for the analysis.
 * 
 * @param icfg The interprocedural CFG.
 */
public void setIcfg(JimpleBasedInterproceduralCFG icfg) {
  this.icfg = icfg;
}
 
开发者ID:serval-snt-uni-lu,项目名称:DroidRA,代码行数:9,代码来源:AnalysisParameters.java


示例11: getIcfg

import soot.jimple.toolkits.ide.icfg.JimpleBasedInterproceduralCFG; //导入依赖的package包/类
/**
 * Gets the interprocedural control flow graph for the analysis.
 * 
 * @return The interprocedural control flow graph.
 */
public JimpleBasedInterproceduralCFG getIcfg() {
  return icfg;
}
 
开发者ID:serval-snt-uni-lu,项目名称:DroidRA,代码行数:9,代码来源:AnalysisParameters.java



注:本文中的soot.jimple.toolkits.ide.icfg.JimpleBasedInterproceduralCFG类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ArrayUtil类代码示例发布时间:2022-05-23
下一篇:
Java TableMapEventData类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap