[Soot-list] getting DU chains
Gerald Sit
Gerald.Sit at student.cityu.edu.hk
Fri Aug 1 00:51:48 EDT 2008
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
More information about the Soot-list
mailing list