[Soot-list] How to get a call graph about my program except the thousands of library methods' edges?

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Thu Jun 17 03:43:17 EDT 2010


Hello.

There is now experimental support for this (i.e. for not analyzing the
JDK) in the current SVN version of Soot. See here:
http://www.bodden.de/2010/06/04/soot-no-jdk/

You can get nightly builds of Soot here: http://plg.uwaterloo.ca/~olhotak/build/

Eric

--
Dr. Eric Bodden
Software Technology Group, Technische Universität Darmstadt, Germany
Tel: +49 6151 16-5478    Fax: +49 6151 16-5410
Mailing Address: S2|02 A209, Hochschulstraße 10, 64289 Darmstadt



2010/6/17 wang_qingtan <wqt4585 at 163.com>:
>  Hi all!
> When I use call graph in Soot:
> CallGraph cg = Scene.v().getCallGraph();
> the cg contains thousands of edges between library methods. For example,
> when I use the code in
> http://www.sable.mcgill.ca/pipermail/soot-list/2004-October/000047.html to
> analysis the CallGraphs.java file which is the example of
> soot-survivors-guide .The call graph contains 168254 edges.
> After learning the soot-survivors-guide, I know how to get a specified
> method's edges outof or into it( cg.edgesOutOf(src) or cg.edgesInto(src)).
> But, now I want to know can I get a call grph which only contains edges
> between my program methods or between my method and library methods.
> Thank you !
>
> Souce code in
> http://www.sable.mcgill.ca/pipermail/soot-list/2004-October/000047.html:
> package olhotak;
> import soot.*;
> import java.util.*;
> import java.io.*;
> import soot.jimple.*;
> import soot.util.queue.*;
> import soot.jimple.toolkits.callgraph.*;
>
> public class CallGraphDumper extends SceneTransformer {
>     public static void main(String[] args)
>     {
> PackManager.v().getPack("wjtp").add(
>     new Transform("wjtp.dumpcg", new CallGraphDumper()));
>
> soot.Main.main(args);
>     }
>
>     protected void internalTransform(String phaseName, Map options)
>     {
>         CallGraph cg = Scene.v().getCallGraph();
>
>         Iterator it = cg.listener();
>         while( it.hasNext() ) {
>             soot.jimple.toolkits.callgraph.Edge e =
>    &nbsp ;            (soot.jimple.toolkits.callgraph.Edge) it.next();
>             System.out.println(""+e.src()+e.srcStmt()+" ="+e.kind()+"=>
> "+e.tgt());
>         }
>     }
> }
>
>
>
>
> _______________________________________________
> 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