[Soot-list] Howto generate a CallGraph?

li xin li-xin at jaist.ac.jp
Fri Apr 18 10:40:10 EDT 2008


Sorry for typos. It should be "SceneTransformer" in the code snippet.

LI
On Fri, Apr 18, 2008 at 11:36 PM, li xin <li-xin at jaist.ac.jp> wrote:

> Hi Marco,
>
> For using soot, I usually add a new transformer into the phase "wjtp"
> before invoking soot.Main.main(). Then you can fetch Call Graph  and other
> information inside the new phase.
>
> The following code snippet is only for your reference, please refer to
> soot tutorial for more details.
>
> Regards, LI
>
> --
>  public static void main(String[] args) {
>
> PackManager.v().getPack("wjtp").add(new Transform("wjtp.utrans",
> UserTransformer.v()));
> soot.Main.main(args);
>
> }
>
> public class UserTransformer extends SceneTransforer() {
> private static UserTransformer instance;
> private UserTransformer() {}
> public static UserTransformer v() {
> if(instance == null) instance = new UserTransformer ();
> return instance;
> }
>
> protected void internalTransform ( String phaseName, Map options) {
>         CallGraph cg =Scene.v().getCallGraph();
>         ......
> }
> --
>
>
>
>
> On Fri, Apr 18, 2008 at 7:15 PM, Marco Bakera <marco.bakera at tu-dortmund.de>
> wrote:
>
> > Thank you for that hint li xin. Now Soot seems to create the calling
> > graph.
> > However I am not able to fetch it from Scene afterwards since soot
> > terminates
> > after invocation of soot.Main.main() with a System.exit(). :(
> >
> > Any suggestions?
> >
> >
> >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20080418/1f2d49d5/attachment.htm


More information about the Soot-list mailing list