[Soot-list] Transforming java library classes

Khilan Gudka khilan.gudka at imperial.ac.uk
Mon Feb 25 16:51:01 EST 2008


Dear Chris,

Unfortunately that didn't work. This is really weird, as soot is
clearly adding the methods. Debug output I am generating:

Adding cos96 to java.lang.Math
Successfully added? true.

The true value is obtained by doing a contains check on the list
returned by SootClass.getMethods().

Khilan



On 25/02/2008, Chris Pickett <chris.pickett at mail.mcgill.ca> wrote:
> Try adding --app.  Does it work?
>
>
>  Khilan Gudka wrote:
>  > Hi Chris,
>  >
>  > Sorry about that. Here is the command line I am using:
>  >
>  > -p cg.spark enabled:true -w -f c -include-all MyClass java.lang.Math
>  >
>  > and the relevant source code for adding the new method to java.lang.Math is:
>  >
>  >         SootMethod mPrime = new SootMethod(mPrimeName,
>  > m.getParameterTypes(), m.getReturnType(), m.getModifiers(),
>  > m.getExceptions());
>  >         SootClass c = m.getDeclaringClass();
>  >         c.addMethod(mPrime);
>  >
>  > Thanks,
>  > Khilan
>  >
>  > On 25/02/2008, Chris Pickett <chris.pickett at mail.mcgill.ca> wrote:
>  >> Hi Khilan,
>  >>
>  >>  It's hard for people to help you if you don't provide enough
>  >>  information.  (In general, err on the side of providing too much.)
>  >>
>  >>  Please post your exact command-line and source code.
>  >>
>  >>
>  >>  Chris
>  >>
>  >>
>  >>  Khilan Gudka wrote:
>  >>  > Dear Eric,
>  >>  >
>  >>  > I tried as per your suggestion but still no luck.
>  >>  >
>  >>  > Khilan
>  >>  >
>  >>  > On 25/02/2008, Eric Bodden <eric.bodden at mail.mcgill.ca> wrote:
>  >>  >> Hi, Khilan.
>  >>  >>
>  >>  >>  Did you use the -include-all option?
>  >>  >>
>  >>  >>  See http://www.sable.mcgill.ca/soot/tutorial/usage/index.html
>  >>  >>
>  >>  >>  Eric
>  >>  >>
>  >>  >>
>  >>  >>  On 25/02/2008, Khilan Gudka <khilan.gudka at imperial.ac.uk> wrote:
>  >>  >>  > Dear All,
>  >>  >>  >
>  >>  >>  >  I would like to be able to modify the java sdk library classes by
>  >>  >>  >  adding methods to them. At present, I pass the java library class to
>  >>  >>  >  be modified as one of the application classes. Soot generates the
>  >>  >>  >  class files for these classes but they don't include the methods that
>  >>  >>  >  I added to them using SootClass.addMethod.
>  >>  >>  >
>  >>  >>  >  Is this the right way to go about modifying java sdk classes?
>  >>  >>  >
>  >>  >>  >  Thanks,
>  >>  >>  >  Khilan
>  >>  >>
>  >>  >>>  _______________________________________________
>  >>  >>  >  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
>  >>  >>
>  >>  > _______________________________________________
>  >>  > 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