[Soot-list] Can I ask for a code snippet of creating call graph for a library (no main class)?

Yi Lin qinsoon at gmail.com
Tue Jun 26 03:20:52 EDT 2012


Hi,

Thank you. I had read the survivor's guide before I posted the question 
here. The only code example the survivor's guide gives about creating 
call graph is:

    CHATransformer.v().transform();
    SootClass a = Scene.v().getSootClass("testers.A");
    SootMethod src = Scene.v().getMainClass().getMethodByName("doStuff");
    CallGraph cg = Scene.v().getCallGraph();

I don't think this works for a library with no main class. So I tried 
with different ways of setting entrypoints, using a dummy main class, 
etc. I got different exceptions with different attempts. Some exceptions 
came with advices, I tried the advices but just got different 
exceptions. I also tried suggestions from threads on similar topics in 
mail list archive, I still couldn't get this right.

If anyone could give a code snippet, that would be most helpful for me.

Regards,
Yi

On 26/06/12 14:17 , Z wrote:
> It  might be more efficient that you learn them like -w, entrypoints
> etc... one by one. Most of them can be found in the survivor's guide.
>
> If you don't know whether to use such such options, try them!
>
> Cheers,
> Zell.
>
>> long list of questions, like whether to use whole program mode '-w',
>> what should be set as 'entrypoints', whether to use
>> CHATransformer.v().transform() or
>> PhaseOptions.v().setPhaseOption("cg.cha", "enabled:true") then
>> runPacks(), what is the timing to do that, etc. A code snippet would
>> answer all those annoying questions for me...
>>
>> Thank you very much.
>>
>> Regards,
>> Yi
>> _______________________________________________
>> Soot-list mailing list
>> Soot-list at sable.mcgill.ca
>> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20120626/9fb7d4ca/attachment.html 


More information about the Soot-list mailing list