[Soot-list] Question about Value vs Stmt in Jimple

Jiaqi Tan jiaqit at andrew.cmu.edu
Thu Oct 18 13:54:54 EDT 2012


Yes that seems to be the case. So if I want to cycle through every
"statement" in a method body, the only way is to run whole-program
analysis and walk the CFG of the method?

Thanks,
Jiaqi

On Thu, Oct 18, 2012 at 1:43 PM, Eric Bodden <eric.bodden at ec-spride.de> wrote:
> Oh sorry, I think I made a mistake.
>
> Not every unit is inside a unit box. Only those units that are targets
> e.g. of a goto statement are. I think that explains your observation,
> doesn't it?
>
> Eric
>
> On 18 October 2012 19:41, Jiaqi Tan <jiaqit at andrew.cmu.edu> wrote:
>> Do the Stmts get populated only when I run the whole-program
>> transformation and the wjtp pack?
>>
>> Thanks,
>> Jiaqi
>>
>> On Thu, Oct 18, 2012 at 1:28 PM, Eric Bodden <eric.bodden at ec-spride.de> wrote:
>>>> If I'm getting UseBoxes that do not show up in any of the UnitBoxes
>>>> from getAllUnitBoxes(), does that mean that there are values that are
>>>> created but not used? Then what is the relationship between Stmt's and
>>>> the Boxes? Are all UseBoxes and DefBoxes contained within all Stmts
>>>> returned from getAllUnitBoxes()?
>>>
>>> What you describe actually cannot happen. Maybe you are
>>> misinterpreting something?
>>>
>>> Take a look at the definitions:
>>>
>>>  public List<UnitBox> getAllUnitBoxes()
>>>     {
>>>         ArrayList<UnitBox> unitBoxList = new ArrayList<UnitBox>();
>>>         {
>>>             Iterator<Unit> it = unitChain.iterator();
>>>             while(it.hasNext()) {
>>>                 Unit item = it.next();
>>>                 unitBoxList.addAll(item.getUnitBoxes());
>>>             }
>>>         }
>>>
>>>         {
>>>             Iterator<Trap> it = trapChain.iterator();
>>>             while(it.hasNext()) {
>>>                 Trap item = it.next();
>>>                 unitBoxList.addAll(item.getUnitBoxes());
>>>             }
>>>         }
>>>
>>>         {
>>>             Iterator<Tag> it = getTags().iterator();
>>>             while(it.hasNext()) {
>>>                 Tag t = it.next();
>>>                 if( t instanceof CodeAttribute)
>>>                     unitBoxList.addAll(((CodeAttribute) t).getUnitBoxes());
>>>             }
>>>         }
>>>
>>>         return unitBoxList;
>>>     }
>>>
>>>     public List<ValueBox> getUseBoxes()
>>>     {
>>>         ArrayList<ValueBox> useBoxList = new ArrayList<ValueBox>();
>>>
>>>         Iterator<Unit> it = unitChain.iterator();
>>>         while(it.hasNext()) {
>>>             Unit item = it.next();
>>>             useBoxList.addAll(item.getUseBoxes());
>>>         }
>>>         return useBoxList;
>>>     }
>>>
>>>
>>> Eric
>
>
>
> --
> 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