[Soot-list] getting DU chains

Eric Bodden eric.bodden at mail.mcgill.ca
Fri Aug 1 13:57:28 EDT 2008


Hi Gerald.

Dava is meant for decompiling to Java source code. I don't think this
is what you want.

Try this class instead:
http://www.sable.mcgill.ca/soot/doc/soot/toolkits/scalar/LocalUses.html

Eric

2008/8/1 Gerald Sit <Gerald.Sit at student.cityu.edu.hk>:
> Hi all,
>
> I'm trying to get DU chains from a program. It seems to me that there're some revelant APIs provided from ASTUsesAndDefs class of soot.dava.toolkits.base.AST.traversals package. However, when I try to get the DavaBody reference the ClassCastException is thrown like this.
>
> Exception in thread "main" java.lang.ClassCastException: soot.jimple.JimpleBody
>        at DavaTest.getDUChainInfo(DavaTest.java:439)
>        at DavaTest.main(DavaTest.java:355)
>
>
>
> Below is the snippet of my program.
>
> private static void getDUChainInfo(SootMethod src) {
>        Body b = (Body)src.getActiveBody();
>        DavaBody d = (DavaBody)b;
>        ASTNode AST = (ASTNode)d.getUnits().getFirst();
>        ASTUsesAndDefs du = new ASTUsesAndDefs(AST);
>        List c = du.getDUChain(AST);
> }
>
>
> I've tried to use Dava as output format without any luck. Is there any arguments I've to set before using Dava codes from soot? And are there any alternatives to get the DU chains using soot? Thanks.
>
> Gerald
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>



-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


More information about the Soot-list mailing list