[Soot-list] Creating and Modifiying Dominator Trees? (and Various Questions)

Ryan Rueth rrueth at gmail.com
Mon Mar 5 17:35:02 EST 2007


Hello everyone,

 

I'm brand new to Soot, and I've been looking into how to build and modifying
dominator trees given a java .class file.  I've been reading through a few
of the tutorials including "Using the Soot flow analysis framework," and "A
Survivor's Guide to Java Program Analysis with Soot," as well as the Soot
API and some of the source code.  

 

Anyhow, what I am attempting to do is to modify Soot such that I could input
a .class file, transform it into Jimple, and create the Dominator Tree of
the jimple code.  Then, I would like to have the ability to traverse the
Dominator Tree is both a forward and backward ordering of the nodes, while
having the ability to tag or directly add code to the jimple code.  Finally,
I would like to transform it back into a .class file containing any
modifications that I have added.

 

So far, I believe I would just have to create a Transformer, but I'm not
sure which I would extend.  I want to create a DominatorTree for the entire
.class file, so would I be extending SceneTransformer?  If I made this a
BodyTransformer, would that mean that I was only transforming each
individual body of code (for example method1() and method2() would each be
transformed separately and not integrated into a single DomintatorTree,
assuming that method1 and method2 could actually be in the same Tree)?
Also, is there any point in the transformation that the DominatorTree would
already be created and I could simply call something like .getGraph() to
access it?  Or would I have to create everything myself in order to do any
type of transformations to the graph?  Finally would I be adding the
transformation to the ".jtp" pack?

 

 

 

So far, I have found the DominatorTree class
(http://www.sable.mcgill.ca/soot/doc/soot/toolkits/graph/DominatorTree.html)
and I understand that I will need a DominatorsFinder class to pass the
DominatorTree constructor, thus I'd probably use the SimpleDominatorsFinder
(http://www.sable.mcgill.ca/soot/doc/soot/toolkits/graph/SimpleDominatorsFin
der.html).  In addition to that I'd need a DirectedGraph to pass that
constructor, so I was thinking about using something like the
ExceptionalUnitGraph
(http://www.sable.mcgill.ca/soot/doc/soot/toolkits/graph/ExceptionalUnitGrap
h.html), but would this actually give me the DominatorTree for the entire
.class file that I passed in?  It seems like it only creates a graph for a
single Body instance?

 

Thank you in advance,

Ryan Rueth

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20070305/8a737a7f/attachment.htm


More information about the Soot-list mailing list