[Soot-list] Help on classes hierarchy

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Tue Jun 1 10:01:19 EDT 2010


Hello François.

> First, I want to know whether a given SootMethod is final, or if its
> class is final. I can get the first information with
> SootMethod.getDeclaration(), but when the method is not final, I can't
> find a way to known whether its declaring class is final or not.

This should just work as follows:

boolean classIsFinal =
soot.Modifier.isFinal(method.getDeclaringClass().getModifiers());

> In whole program/full resolver mode, I am searching which methods
> implement abstract methods such as java.io.FileSystem
> normalize(String). I am therefore using
> Scene.v().getActiveHierarchy().resolveAbstractDispatch() with the
> SootClass corresponding to FileSystem and the SootMethod corresponding
> to normalize(String). My problem is that UnixFileSystem does not seem
> to be loaded into Soot Scene. Therefore, resolveAbstractDispatch()
> does not return any candidate. If I first load the UnixFileSystem,
> then there is no problem and its normalize(String) method is returned.
> Is there a way to automatically load all the classes in the Soot
> ClassPath or anything that could automatically search for subclasses  ?

Normally, the whole-program mode automatically does this for you.
However, since UnixFileSystem appears to be an OS-specific class, I
suspect that it is loaded through reflection. Without additional
information, Soot cannot know (or does not assume) that you are
running on Unix and are loading this particular file-system class. To
address this problem, we have recently released the TamiFlex tool.
TamiFlex records a set of concrete program runs and creates a log file
that holds information about all reflective calls on those runs. When
you then provide this log file to Soot, Soot can resolve these
reflective calls. This will then likely cause Soot to also load the
UnixFileSystem class.

See here for further documentation on using TamiFlex with Soot:
http://code.google.com/p/tamiflex/wiki/DaCapoAndSoot

Hope that helps,
Eric


More information about the Soot-list mailing list