[Soot-list] How to have whole-program analysis run from non-main() methods

Jiaqi Tan tanjiaqi at gmail.com
Thu Dec 15 17:34:20 EST 2011


Hi Eric,

Does the wjpp pack run before the call-graph construction starts? Do all
packs happen before call-graph construction?

Thanks,
Jiaqi

On Fri, Dec 16, 2011 at 12:45 AM, Eric Bodden <eric.bodden at ec-spride.de>wrote:

> Hi Jiaqi.
>
> On 15 December 2011 17:31, Jiaqi Tan <tanjiaqi at gmail.com> wrote:
> > I'm also doing something that I'm not sure is entirely correct: I
> > first ran Soot with whole-program mode disabled, and resolved the
> > class whose methods I want to use as EntryPoints up to BODIES. This
> > allowed me to get a SootClass with the fully populated SootMethod's
> > which I then used to populate the List<Method> to set EntryPoints.
> > Then, before I performed the whole-program analysis, I ran G.reset()
> > before running the regular Soot setup and running the
>
> I don't think this is unsound, but using the wjpp pack is a simpler
> way to do this. This pack runs after class resolution but before the
> cg pack:
>
>                PackManager.v().getPack("wjpp").add(new
> Transform("wjpp.foo",new
> SceneTransformer() {
>
>                        @SuppressWarnings("rawtypes")
>                        protected void internalTransform(String phaseName,
> Map options) {
>                                G.v().out.println("Using all concrete
> methods of all application
> classes as entry points.");
>                                List<SootMethod> entryPoints = new
> LinkedList<SootMethod>();
>                                for(SootClass c:
> Scene.v().getApplicationClasses()) {
>                                        for(SootMethod m: c.getMethods()) {
>                                                if(m.isConcrete()) {
>                                                        entryPoints.add(m);
>                                                }
>                                        }
>                                }
>
>                                G.v().out.println(entryPoints.size() + "
> entry points.");
>
>                                Scene.v().setEntryPoints(entryPoints);
>                        }
>                }));
>
> Eric
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20111216/4a87e4bb/attachment.html 


More information about the Soot-list mailing list