[Soot-list] Howto generate a CallGraph?

bq chan cbqios at gmail.com
Mon May 5 09:43:49 EDT 2008


I tried the code you provided, but  it seemed something wrong.

It ran heavily, slowly and giving message repeatly:

    GC Warning: Repeated allocation of very large block (appr. size *****):
        May lead to memory leak and poor performance.

Could u plz help me. Thanks!


As follows:

[cbq at localhost src]$ java CGMain -w CallGraphs
Soot started on Mon May 05 21:12:45 GMT+08:00 2008
GC Warning: Repeated allocation of very large block (appr. size 331776):
        May lead to memory leak and poor performance.
No main class given. Inferred 'CallGraphs' as main class.
[Call Graph] For information on where the call graph may be incomplete, use
the verbose option to the cg phase.
GC Warning: Repeated allocation of very large block (appr. size 540672):
        May lead to memory leak and poor performance.

Core code:

     public static void main(String[] args)
  {

        PackManager.v().getPack("wjtp").add(new
Transform("wjtp.mycgTransformer", CGTransformer.v()));
        soot.Main.main(args);
    }

     protected void internalTransform ( String phaseName, Map options)
            {
                    CallGraph cg =Scene.v().getCallGraph();
                    System.out.println("Size:"+cg.size());



            }




2008/4/18 li xin <li-xin at jaist.ac.jp>:

> 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?
> >
> >
> >
> _______________________________________________
> 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/20080505/16462517/attachment.htm


More information about the Soot-list mailing list