简体   繁体   English

烟尘的蚀类路径

[英]eclipse class path for soot

im writing a program to get and print the call graph of a program. 我正在编写程序以获取并打印程序的调用图。 im using soot to try and get the call graph and i pass as an argument the java class i want to print out but when i run the program i get a message that soot cant find the class. 即时通讯使用煤烟尝试获取调用图,我将要打印的java类作为参数传递给我,但是当我运行程序时,我收到一条消息,煤烟无法找到该类。 how do i configure the eclipse class path to find the calss i want to print? 如何配置eclipse类路径以查找要打印的calss?

my code: 我的代码:

public class CFG extends SceneTransformer
{    
    public static void main(String[] args) 
    {
        if(args.length == 0)
        {
            System.out.println("Syntax: java CFG [soot options]");
            System.exit(0);
        }            

        PackManager.v().getPack("wjtp").add(new Transform("wjtp.cfg", CFG.v()));

    // Just in case, resolve the PrintStream and System SootClasses.
    Scene.v().addBasicClass("java.io.PrintStream",SootClass.SIGNATURES);
        Scene.v().addBasicClass("java.lang.System",SootClass.SIGNATURES);
        soot.Main.main(args);
    }

    private static CFG instance = new CFG();

    public static CFG v() { return instance; }

    protected void internalTransform(String phaseName, Map options)
    { 
    System.out.println("Entering CFG transformer");
    System.out.println("phaseName = " + phaseName);
    System.out.println("options = " + options);
    CallGraph cg = Scene.v().getCallGraph();
    SootMethod m = Scene.v().getMainMethod();
    Iterator targets = new Targets(cg.edgesOutOf(m));
    while (targets.hasNext()) {
        SootMethod trgt = (SootMethod)targets.next();
    System.out.println(m.getName() + " -> " + trgt.getName() + ";");
    }
    System.out.println("Exiting CFG transformer");
     }
}

You need to enable whole-program mode by using the -w flag. 您需要使用-w标志启用整个程序模式。 Otherwise w* packs do not get executed. 否则,w *包将不会执行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM