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

Manjiri Namjoshi manjiri.namjoshi at googlemail.com
Sun Oct 5 18:57:33 EDT 2008


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20081005/b6818aa7/attachment.htm


More information about the Soot-list mailing list