[Soot-list] How to print out the values of variables in a valuebox in soot?

Jingyi Wang wangjyee at gmail.com
Wed Jan 1 22:36:41 EST 2014


This is the related code fragment where I can't print out the values from
valuebox. May I know what's the problem?

public GuaranteedDefsAnalysis(UnitGraph graph)
{
    super(graph);
    DominatorsFinder df = new MHGDominatorsFinder(graph);
    unitToGenerateSet = new HashMap<Unit, FlowSet>(graph.size() * 2 + 1, 0.7f);

    // pre-compute generate sets
    for(Iterator unitIt = graph.iterator(); unitIt.hasNext();){
        Unit s = (Unit) unitIt.next();
        FlowSet genSet = emptySet.clone();

        for(Iterator domsIt = df.getDominators(s).iterator();
domsIt.hasNext();){
            Unit dom = (Unit) domsIt.next();
            for(Iterator boxIt = dom.getDefBoxes().iterator();
boxIt.hasNext();){
                ValueBox box = (ValueBox) boxIt.next();
                box.getValue().toString(); // simply using toString
does not work
                if(box.getValue() instanceof Local)
                    genSet.add(box.getValue(), genSet);
            }
        }

        unitToGenerateSet.put(s, genSet);
    }

    doAnalysis();
}


-- 
Wang Jingyi, PhD Student
Information Systems Technology and Design
Singapore University of Technology and Design
Tel: 65-84187716
Email: jingyi_wang at mymail.sutd.edu.sg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20140102/ff03467b/attachment.html 


More information about the Soot-list mailing list