如何在烟灰中的值框中打印出变量的值?

时间:2014-01-02 03:31:20

标签: soot

这是相关的代码片段,我无法从valuebox打印出值。我可以知道这是什么问题吗?

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();
}

1 个答案:

答案 0 :(得分:0)

你能否改述一下你的问题?你是什​​么意思“不工作”?您是否忘记添加println语句?