[Soot-list] want to maintain bytecode offsets for classfiles

Eric Bodden eric.bodden at mail.mcgill.ca
Mon Oct 6 16:29:14 EDT 2008


As I said earlier:

> You can try to disable
> some of the phases in the "jb" pack (see here
> http://www.sable.mcgill.ca/soot/tutorial/phase/index.html) but I don't
> think that this is going to preserve all the offsets either.

The "jb" pack is the only pack that's enabled by default. In
particular "jop" (the Jimple optimization pack) is already disabled by
default. Yet, there are some few optimizations in "jp" that you can
try to disable. However, having said that, these optimizations are
usually necessary to generate valid bytecode and hence disabling them
may not bring you anywhere in the end.

Eric

2008/10/6 Manjiri Namjoshi <manjiri.namjoshi at googlemail.com>:
> Hi,
>
> Thank You !
> Sorry to bother again but does SOOT provide any flag to turn off the
> optimizations on the classfiles and only allow annotations?
>
> Sincerely,
> Manjiri
>
> 2008/10/6 Eric Bodden <eric.bodden at mail.mcgill.ca>
>>
>> Looking at the source code it seems that it returns the offset from
>> the original classfile.
>>
>> Eric
>>
>> 2008/10/5 Manjiri Namjoshi <manjiri.namjoshi at googlemail.com>:
>> > Hi,
>> >
>> > Thanks for your reply !
>> > Actually i would like to know which bytecode offset does the
>> > getBytecodeOffset() return ?
>> > The offset from the original classfile or the transformed classfile?
>> >
>> > I am caring about the offset because i want to add method annotations
>> > with a
>> > value as offsets corresponding to only if_cmp instructions !
>> >
>> > Thank You.
>> >
>> >
>> > Sincerely,
>> > Manjiri
>> >
>> > 2008/10/4 Eric Bodden <eric.bodden at mail.mcgill.ca>
>> >>
>> >> Hi Manjiri.
>> >>
>> >> I don't think that what you are looking for is possible. Soot converts
>> >> bytecode to an intermediate representation called Jimple and then back
>> >> to bytecode. This is not a 1:1 transformation. You can try to disable
>> >> some of the phases in the "jb" pack (see here
>> >> http://www.sable.mcgill.ca/soot/tutorial/phase/index.html) but I don't
>> >> think that this is going to preserve all the offsets either.
>> >>
>> >> Just out of curiosity: Why would you care about the offsets?
>> >>
>> >> Eric
>> >>
>> >> 2008/10/4 Manjiri Namjoshi <manjiri.namjoshi at googlemail.com>:
>> >> > Hello,
>> >> >
>> >> > I am trying to run a soot transformation and annotate the classfiles.
>> >> > I observed that the classfiles which the soot produces have different
>> >> > bytecode offsets than the original bytecode offsets.
>> >> >
>> >> > I think soot optimizations is causing this to happen.
>> >> >
>> >> > This is the transformation:
>> >> >        /* adds the transformer. */
>> >> >         PackManager.v().getPack("jtp").add(new
>> >> >                         Transform("jtp.annotexample",
>> >> >                   CreateAnnotationFile.v()));
>> >> >
>> >> >         /* invokes Soot */
>> >> >         soot.Main.main(args);
>> >> >
>> >> > I want to somehow suppress these optimizations and maintain the
>> >> > bytecode
>> >> > offsets.
>> >> >
>> >> > Thanks in advance!
>> >> >
>> >> > Sincerely,
>> >> > Manjiri
>> >> >
>> >> > _______________________________________________
>> >> > 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
>> >
>> >
>>
>>
>>
>> --
>> Eric Bodden
>> Sable Research Group
>> McGill University, Montréal, Canada
>
>



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


More information about the Soot-list mailing list