com.ibm.wala.examples.drivers
Class GVSlice

java.lang.Object
  extended by com.ibm.wala.examples.drivers.GVSlice

public class GVSlice
extends java.lang.Object

This simple example WALA application computes a slice (@see com.ibm.wala.ipa.slicer.Slicer) and fires off ghostview to view a dot-ted representation of the slice. This is an example program on how to use the slicer. See the 'GVSlice' launcher included in the 'launchers' directory.


Constructor Summary
GVSlice()
           
 
Method Summary
static Statement getReturnStatementForCall(Statement s)
          If s is a call statement, return the statement representing the normal return from s
static void main(java.lang.String[] args)
          Usage: GVSlice -appJar [jar file name] -mainClass [main class] -srcCaller [method name] -srcCallee [method name] -dd [data dependence options] -cd [control dependence options] -dir [forward|backward] "jar file name" should be something like "c:/temp/testdata/java_cup.jar" "main class" should beshould be something like "c:/temp/testdata/java_cup.jar" "method name" should be the name of a method.
static NodeDecorator makeNodeDecorator()
           
static Graph<Statement> pruneSDG(SDG sdg, java.util.Collection<Statement> slice)
          return a view of the sdg restricted to the statements in the slice
static java.lang.Process run(java.lang.String[] args)
          see main(), above, for command-line arguments
static java.lang.Process run(java.lang.String appJar, java.lang.String mainClass, java.lang.String srcCaller, java.lang.String srcCallee, boolean goBackward, Slicer.DataDependenceOptions dOptions, Slicer.ControlDependenceOptions cOptions)
          Compute a slice from a call statements, dot it, and fire off ghostview to visualize the result
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GVSlice

public GVSlice()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws WalaException
Usage: GVSlice -appJar [jar file name] -mainClass [main class] -srcCaller [method name] -srcCallee [method name] -dd [data dependence options] -cd [control dependence options] -dir [forward|backward]

run

public static java.lang.Process run(java.lang.String[] args)
                             throws WalaException
see main(), above, for command-line arguments

Throws:
WalaException

run

public static java.lang.Process run(java.lang.String appJar,
                                    java.lang.String mainClass,
                                    java.lang.String srcCaller,
                                    java.lang.String srcCallee,
                                    boolean goBackward,
                                    Slicer.DataDependenceOptions dOptions,
                                    Slicer.ControlDependenceOptions cOptions)
Compute a slice from a call statements, dot it, and fire off ghostview to visualize the result

Parameters:
appJar - should be something like "c:/temp/testdata/java_cup.jar"
mainClass - should be something like "c:/temp/testdata/java_cup.jar"
srcCaller - name of the method containing the statement of interest
srcCallee - name of the method called by the statement of interest
goBackward - do a backward slice?
dOptions - options controlling data dependence
cOptions - options controlling control dependence
Returns:
a Process running ghostview to visualize the dot'ted representation of the slice

getReturnStatementForCall

public static Statement getReturnStatementForCall(Statement s)
If s is a call statement, return the statement representing the normal return from s


pruneSDG

public static Graph<Statement> pruneSDG(SDG sdg,
                                        java.util.Collection<Statement> slice)
return a view of the sdg restricted to the statements in the slice


makeNodeDecorator

public static NodeDecorator makeNodeDecorator()
Returns:
a NodeDecorator that decorates statements in a slice for a dot-ted representation