[Soot-list] How to add a Transform to the jb phase?

Eric Bodden eric.bodden at mail.mcgill.ca
Sat Dec 8 16:07:07 EST 2007


Hmm, ok I just found out that the phases in "jb" are hardcoded. I have
no idea why that is. (Anybody?)

However, from the code of PackManager it seems that you should be able
to make modifications in any of the following packs:

cg, wjtp, wjop, wjap

Those packs should run after "jb" but before Shimple creation. The
only problem with that is that all those four packs are ScenePacks.
Hence, you need a SceneTransformer, not a BodyTransformer. That's not
really problematic, though. It only means that you need to call your
BodyTransformer from the SceneTransformer manually, for the body of
each concrete method of each application class.

Hope that helps,
Eric


On 08/12/2007, Mario Mendez <mario at cs.unm.edu> wrote:
> No, that's the puzzling thing to me. If you add a Transform to the jb in
> that way, it will not be called. Just in case, I explicitly invoked:
>         Options.v().setPhaseOption("jb.emg", "on");
> but it didn't really change anything.
>
> Eric Bodden wrote:
> > Hi, Mario.
> >
> > If I remember correctly, there is no difference to other packs. Does
> > this here not work?
> >
> > public class MySootMainExtension
> > {
> >     public static void main(String[] args) {
> >         // Inject the analysis tagger into Soot
> >         PackManager.v().getPack("jb").add(
> >         new Transform("jb.mytransform",
> >                                MyTransform.instance()));
> >         // Invoke soot.Main with arguments given
> >         Main.main(args);
> >     }
> > }
> >
> > (adapted from the Soot Survivor's guide http://www.brics.dk/SootGuide/)
> >
> > Eric
> >
> > On 08/12/2007, Mario Mendez <mario at cs.unm.edu> wrote:
> >> Hi all,
> >>
> >> I need to add a Transform at the end of the jb phase in order to be able
> >> to manipulate the IR before it is transformed to SSA in the shimple
> >> phase. I couldn't find any way of doing it that does not imply modifying
> >> the Soot source, which is undesirable. Can you suggest any solution?
> >> Normally we add the transformations to jtp or stp, but what if, like in
> >> this case, you want them to be in jb?
> >>
> >> Thanks!
> >> _______________________________________________
> >> Soot-list mailing list
> >> Soot-list at sable.mcgill.ca
> >> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
> >>
> >
> >
>


-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


More information about the Soot-list mailing list