soot.jimple.spark.pag
Class PagToDotDumper

java.lang.Object
  extended by soot.jimple.spark.pag.PagToDotDumper

public class PagToDotDumper
extends Object

Utilities for dumping dot representations of parts of a PAG.

Author:
msridhar

Field Summary
static int TRACE_MAX_LVL
           
 
Constructor Summary
PagToDotDumper(PAG pag)
           
 
Method Summary
 void dumpP2SetsForLocals(String fName, String mName)
          dumps the points-to sets for all locals in a method in a dot representation.
 void dumpPAGForMethod(String fName, String cName, String mName)
          Dump the PAG for some method in the program in dot format
static String makeDotNodeLabel(Node n, Predicate<Node> p)
          Generate a node declaration for a dot file.
static String makeLabel(AllocNode n)
           
static String makeLabel(FieldRefNode node)
           
static String makeLabel(LocalVarNode n)
           
static String makeLabel(VarNode base)
           
static String makeNodeName(Node n)
           
 void traceLocalVarNode(String fName, String cName, String mName, String varName)
           
 void traceNode(int id)
           
 void traceNode(String cName, String mName, String varName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRACE_MAX_LVL

public static final int TRACE_MAX_LVL
See Also:
Constant Field Values
Constructor Detail

PagToDotDumper

public PagToDotDumper(PAG pag)
Method Detail

makeDotNodeLabel

public static String makeDotNodeLabel(Node n,
                                      Predicate<Node> p)
Generate a node declaration for a dot file.

Parameters:
node - the node
p - a predicate over nodes, which, if true, will cause the node to appear red
Returns:
the appropriate String for the dot file

dumpP2SetsForLocals

public void dumpP2SetsForLocals(String fName,
                                String mName)
                         throws FileNotFoundException
dumps the points-to sets for all locals in a method in a dot representation. The graph has edges from each local to all AllocNodes in its points-to set

Parameters:
fName - a name for the output file
mName - the name of the method whose locals should be dumped
Throws:
FileNotFoundException - if unable to output to specified file

dumpPAGForMethod

public void dumpPAGForMethod(String fName,
                             String cName,
                             String mName)
                      throws FileNotFoundException
Dump the PAG for some method in the program in dot format

Parameters:
fName - The filename for the output
cName - The name of the declaring class for the method
mName - The name of the method
Throws:
FileNotFoundException - if output file cannot be written

traceNode

public void traceNode(int id)

traceNode

public void traceNode(String cName,
                      String mName,
                      String varName)

traceLocalVarNode

public void traceLocalVarNode(String fName,
                              String cName,
                              String mName,
                              String varName)

makeNodeName

public static String makeNodeName(Node n)

makeLabel

public static String makeLabel(AllocNode n)

makeLabel

public static String makeLabel(LocalVarNode n)

makeLabel

public static String makeLabel(FieldRefNode node)
Parameters:
node -
Returns:

makeLabel

public static String makeLabel(VarNode base)
Parameters:
base -
Returns: