[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
Mon Jun 25 01:50:22 EDT 2012


Hi,

I think similar questions were posted here quite a few times. I went 
through mail list archives for almost one year, and I found several 
discussions about it. After reading all of them, I still couldn't get 
this right (sorry, I am new to soot)

I want to process source code directory (say, aJavaLib/). It is a 
library so there is no main class. I am not really interested in any 
single 'entrypoint', I am interested in all methods in this library. For 
example, there is a class 'aClass' with a method 'aMethod' in it. I want 
to get the call graph of 'aMethod', in-edges and out-edges. They point 
to other methods, and I will further want in-edges and out-edges for 
these methods recursively.

I am wondering if anyone could give me a code snippet to get the call 
graph of 'aMethod' so that I can go straight using it to progress my 
work. This seems a lazy way for me but otherwise I will have to ask a 
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


More information about the Soot-list mailing list