[Soot-list] Extracting field usage information with Soot

Jaime Quinonez jaimeq at MIT.EDU
Thu Jan 31 16:11:59 EST 2008


Hello,

I am developing a reference immutability inference tool for Java built  
on top of Soot.  As part of my analysis, I need to determine which  
SootFields are read in a SootMethod and which fields are written to in  
a method.  I believe the correct approach is to create a SceneVisitor  
and override visitBody() to use a custom  
soot.jimple.AbstractStmtSwitch to check each soot.jimple.Stmt,  
deconstructing a Stmt based on it's type.  Is this the correct  
approach, or is there some existing feature of Soot that I am not  
aware of?  Using this approach, would checking the result of  
Stmt.getFieldRef() suffice for determining field reads, and would  
checking the result of AssignStmt.getLeftOp() suffice for field writes?

Additionally, is there any documentation for developers who wish to  
use and extend Soot programmatically?  The documentation at http://www.sable.mcgill.ca/soot/tutorial/ 
  seems to be primarily for people who only want to use Soot as a tool  
from the command line.

Thanks,

Jaime


More information about the Soot-list mailing list