[prev in list] [next in list] [prev in thread] [next in thread] 

List:       soot-list
Subject:    Re: [Soot-list] Instrumenting OSGi bundles
From:       Nuno Machado <nmachado () gsd ! inesc-id ! pt>
Date:       2012-02-06 17:10:39
Message-ID: A4ACBFF4-C918-4F3D-815D-A638751B2A0B () gsd ! inesc-id ! pt
[Download RAW message or body]

Yes, it works fine now. 
I just didn't know that SIGNATURES value has to be called as SootClass.SIGNATURES, so \
I was wondering if it was referring to something else, as I was having an error for \
just having Scene.v().addBasicClass("java.lang.Thread",SIGNATURES)...

Thank you for your help!

Regards,
Nuno


On Feb 6, 2012, at 4:47 PM, Eric Bodden wrote:

> Hi.
> 
> The exception explicitly asks you to try this:
> Scene.v().addBasicClass("java.lang.Thread",SIGNATURES);
> 
> ... before calling soot.Main.main(..).
> 
> Did you try adding this call?
> 
> Eric
> 
> On 6 February 2012 17:30, Nuno Machado <nmachado@gsd.inesc-id.pt> wrote:
> > Hi Eric,
> > 
> > I now dropped these lines:
> > Options.v().set_whole_program(true);
> > Options.v().set_app(true);
> > Scene.v().setMainClass(appclass);
> > 
> > 
> > And the number of analyzed packages indeed decreased. But then I get the
> > following error:
> > 
> > Exception in thread "main" java.lang.RuntimeException: This operation
> > requires resolving level SIGNATURES but java.lang.Thread is at resolving
> > level HIERARCHY
> > If you are extending Soot, try to add the following call before calling
> > soot.Main.main(..):
> > Scene.v().addBasicClass(java.lang.Thread,SIGNATURES);
> > Otherwise, try whole-program mode (-w).
> > at soot.SootClass.checkLevel(SootClass.java:121)
> > at soot.SootClass.declaresMethod(SootClass.java:326)
> > at soot.Scene.grabMethod(Scene.java:348)
> > at soot.Scene.getMethod(Scene.java:368)
> > at
> > soottest.CalculatorTransformer$MyInstrumenter.addMethodAccept(CalculatorTransformer.java:229)
> >  at
> > soottest.CalculatorTransformer$MyInstrumenter.internalTransform(CalculatorTransformer.java:137)
> >  at soot.BodyTransformer.transform(BodyTransformer.java:51)
> > at soot.Transform.apply(Transform.java:104)
> > at soot.BodyPack.internalApply(BodyPack.java:49)
> > at soot.Pack.apply(Pack.java:124)
> > at soot.PackManager.runBodyPacks(PackManager.java:774)
> > at soot.PackManager.runBodyPacks(PackManager.java:454)
> > at soot.PackManager.runBodyPacks(PackManager.java:373)
> > at soot.PackManager.runPacks(PackManager.java:350)
> > at soot.Main.run(Main.java:198)
> > at soot.Main.main(Main.java:141)
> > at soottest.CalculatorTransformer.main(CalculatorTransformer.java:118)
> > 
> > 
> > The error is because I am creating a static reference as follows:
> > String methodSig1 ="<" + "java.lang.Thread" +": java.lang.Thread
> > currentThread()>";
> > SootMethodRef mr1 = Scene.v().getMethod(methodSig1).makeRef();
> > Value invokeCurrentThread = Jimple.v().newStaticInvokeExpr(mr1);
> > 
> > So, this means that I should still use whole-program mode?
> > Otherwise, how can I add those SIGNATURES?
> > 
> > Thank you,
> > Nuno
> > 
> > On Feb 6, 2012, at 3:45 PM, Eric Bodden wrote:
> > 
> > Hi.
> > 
> > You don't really want to enable whole-program mode, so get rid of this
> > line here:
> > 
> > Options.v().set_whole_program(true);
> > 
> > That means you can also drop this line:
> > 
> > Scene.v().setMainClass(appclass);
> > 
> > 
> > Just another question: in order to instrument the osgi classes that I need,
> > 
> > I have to add a lot of .jar files to the class path, which I don't want to
> > 
> > instrument. For that reason, I defined a list of packages to be excluded (as
> > 
> > shown in the code above). However, it seems not to be working, as soot still
> > 
> > analyzes them and put some instrumented classes in the sootoutput folder. Am
> > 
> > I missing something or doing anything wrong?
> > 
> > 
> > That may also have to do with the fact that you currently have the
> > whole-program mode enabled. But I am not 100% sure on this one.
> > 
> > Eric
> > 
> > 
> 
> 
> 
> -- 
> Eric Bodden, Ph.D., http://bodden.de/
> Head of Secure Software Engineering Group at EC SPRIDE
> Principal Investigator in Secure Services at CASED
> Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
> Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt

_______________________________________________
Soot-list mailing list
Soot-list@sable.mcgill.ca
http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic