[Soot-list] Create CFG problem

Gias Uddin gias98 at gmail.com
Mon Aug 26 23:15:17 EDT 2013


Christoph, thanks for the reply.
I tried to build the developer version of soot from git using the
instructions in this link: https://github.com/Sable/soot/issues/71
It failed:

....
    [javac]     E extends Object declared in class ArrayList
    [javac] /home/gias/dev/soot/soot/src/soot/util/JasminOutputStream.java:35:
error: package jasmin does not exist
    [javac]         jasmin.Main.assemble(bais, out, false);
    [javac]               ^
    [javac] Note: Some input files additionally use or override a
deprecated API.
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 2 errors
    [javac] 100 warnings

BUILD FAILED
/home/gias/dev/soot/soot/build.xml:24: Compile failed; see the
compiler error output for details.

Total time: 22 seconds

Any idea?

Thanks again,
- Gias

On Mon, Aug 26, 2013 at 7:29 PM, Christoph Dörr <Chris.Doerr at gmx.de> wrote:
> To have a guess:
>
> I got (not the same but) similar error shortly and was able to fix it with
> updating from Soot 2.5.0 to 2.5.2 (from github).
>
> Am 27.08.2013 00:09, schrieb Gias Uddin:
>>
>> I am trying to create Call Graph of a given method (code below).
>>
>> I get error:
>> -------------------------
>> [Call Graph] For information on where the call graph may be
>> incomplete, use the verbose option to the cg phase.
>> Exception in thread "main" java.lang.RuntimeException: This operation
>> requires resolving level BODIES but java.lang.Object is at resolving
>> level SIGNATURES
>> If you are extending Soot, try to add the following call before
>> calling soot.Main.main(..):
>> Scene.v().addBasicClass(java.lang.Object,BODIES);
>> Otherwise, try whole-program mode (-w).
>> ...
>>
>> My code:
>> ---------------------------
>> public void createCallGraph(String className, String methodName)
>> {
>> Scene scene = Scene.v();
>> String classPaths = "/usr/lib/jvm/java-7-oracle/jre/lib/rt.jar:"
>> +"/usr/lib/jvm/java-7-oracle/jre/lib/jce.jar:"
>> + "/usr/lib/jvm/java-7-oracle/jre/lib/jsse.jar:"
>> + "/temp/jars/joda-time-2.3.jar";
>> scene.setSootClassPath(classPaths);
>> SootClass sootClass = scene.loadClassAndSupport(className);
>> //sootClass.setLibraryClass();
>> scene.loadBasicClasses();
>> scene.loadNecessaryClasses();
>> soot.options.Options.v().set_whole_program(true);
>>
>> Scene.v().setEntryPoints(sootClass.getMethods());
>> HashMap<String,String> sparkOptions = new HashMap<String,String>();
>> sparkOptions.put("enabled", "true");
>> sparkOptions.put("on-fly-cg", "true");
>> sparkOptions.put("set-impl", "hybrid");
>> sparkOptions.put("propagator", "worklist");
>> sparkOptions.put("verbose", "true");
>> SparkTransformer.v().transform("cg", sparkOptions);
>>
>> SootMethod sMethod = sootClass.getMethod(methodName);
>> CallGraph callGraph = scene.getCallGraph();
>> Iterator iter = callGraph.edgesOutOf((MethodOrMethodContext)sMethod);
>>
>> while (iter.hasNext()) {
>> System.out.println(iter.next());
>> }
>> }
>>
>> public static void main(String[] args)
>> {
>> String className = "org.joda.time.chrono.CopticChronology";
>> String methodName = "public int getMinimumDaysInFirstWeek()";
>> MethodCallGraph methodCallGraph = new MethodCallGraph();
>> methodCallGraph.createCallGraph(className, methodName);
>> }
>>
>> Am I doing anything wrong?
>>
>> -Gias
>> _______________________________________________
>> Soot-list mailing list
>> Soot-list at sable.mcgill.ca
>> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>


More information about the Soot-list mailing list