[Soot-list] Excluded & included not handled correctly?

Eric Bodden eric.bodden at ec-spride.de
Thu Jan 24 10:07:27 EST 2013


Hi Michael.

That may well be the case.

Yes, the nightly builds are usually the most stable ones.

Eric

On 24 January 2013 14:44, Michael Faes <rolve at trick17.ch> wrote:
> Hi Eric,
>
> Oh, in this case this has already been fixed since I downloaded Soot. I have
> soot-2.5.0.jar and I was just about to change that method. It is a good idea
> to use the nightly builds?
>
> Thanks,
> Michael
>
> -------- Original-Nachricht --------
> Betreff: Re: [Soot-list] Excluded & included not handled correctly?
> Von: Eric Bodden <eric.bodden at ec-spride.de>
> An: Michael Faes <rolve at trick17.ch>
> Datum: 24.01.2013 13:55
>
>
>> Hi Michael.
>>
>> No I think this is correct.
>>
>> isExcluded is implemented like this:
>>
>>         public boolean isExcluded(SootClass sc) {
>>                 String name = sc.getName();
>>                 for (String pkg : excludedPackages) {
>>                         if (name.startsWith(pkg)) {
>>                                 for (String inc : (List<String>)
>> Options.v().include()) {
>>                                         if (name.startsWith(inc)) {
>>                                                 return false;
>>                                         }
>>                                 }
>>                                 return true;
>>                         }
>>                 }
>>                 return false;
>>         }
>>
>> Note that it checks the include list.
>>
>> Eric
>>
>> On 24 January 2013 13:31, Michael Faes <rolve at trick17.ch> wrote:
>>>
>>> Hi everyone,
>>>
>>> I'm having issues using the -no-bodies-for-excluded options together
>>> with -include and -exclude.
>>>
>>> I excluded java. classes but included java.util. classes. What happens
>>> is that they all end up being phantom. After investigating a bit, I
>>> found this method in SootResolver:
>>>
>>> private void processResolveWorklist() {
>>>     for( int i = SootClass.BODIES; i >= SootClass.HIERARCHY; i-- ) {
>>>       while( !worklist[i].isEmpty() ) {
>>>         SootClass sc = (SootClass) worklist[i].removeFirst();
>>>         if( resolveEverything() ) {
>>>           boolean onlySignatures = sc.isPhantom() || (
>>>               Options.v().no_bodies_for_excluded() &&
>>>               Scene.v().isExcluded(sc) &&
>>>               // ^^^^^^^^^^^^^^^^^^^^^^^^
>>>               !Scene.v().getBasicClasses().contains(sc.getName())
>>>             );
>>>           if( onlySignatures ) {
>>>             bringToSignatures(sc);
>>>             sc.setPhantomClass();
>>>             if(sc.isPhantom()) {
>>>               for( SootMethod m: sc.getMethods() ) {
>>>                 m.setPhantom(true);
>>>               }
>>>               for( SootField f: sc.getFields() ) {
>>>                 f.setPhantom(true);
>>>               }
>>>             }
>>>           } else bringToBodies(sc);
>>>         } else {
>>>           switch(i) {
>>>             case SootClass.BODIES: bringToBodies(sc); break;
>>>             case SootClass.SIGNATURES: bringToSignatures(sc); break;
>>>             case SootClass.HIERARCHY: bringToHierarchy(sc); break;
>>>           }
>>>         }
>>>       }
>>>     }
>>> }
>>>
>>> Notice that on lien 8 it only checks if the class is excluded, not if
>>> it's also included. But the description of the -exclude option clearly
>>> states:
>>>
>>>   > If you specify both include and exclude options, first the classes
>>>   > from all excluded packages are marked as library classes, then the
>>>   > classes from all included packages are marked as application classes.
>>>
>>> Am I correct that this is a bug or am I doing something wrong again?
>>>
>>> Thanks for you help.
>>> Michael
>>> _______________________________________________
>>> Soot-list mailing list
>>> Soot-list at sable.mcgill.ca
>>> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>>
>>
>>
>>
>



-- 
Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/
Head of Secure Software Engineering Group at EC SPRIDE
Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt


More information about the Soot-list mailing list