rename a bunch of things from GV to PDF. Fix up example launchers to take input from workspace_loc instead of c:\temp.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3412 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
002e29dcb0
commit
98c651fee4
@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.wala.examples.drivers.GVSDG"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-appJar "c:/temp/walaWorkspace/com.ibm.wala.core.testdata/bin/com.ibm.wala.core.testdata_1.0.0.jar" -mainClass "Lslice/Slice4" -srcCaller "main" -srcCallee "foo" -dd "no_base_no_heap" -cd "none" -dir "forward""/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="4"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.wala.core.tests"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx500M"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/com.ibm.wala.core.tests"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
|
||||
</launchConfiguration>
|
||||
@ -1,14 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/com.ibm.wala.core.tests/src/com/ibm/wala/examples/drivers/GVCallGraph.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.wala.examples.drivers.GVCallGraph"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-appJar c:/temp/testdata/JLex.jar"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.wala.core.tests"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx500M"/>
|
||||
</launchConfiguration>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/com.ibm.wala.core.tests/src/com/ibm/wala/examples/drivers/PDFCallGraph.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.wala.examples.drivers.PDFCallGraph"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-appJar ${workspace_loc}/JLex.jar"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.wala.core.tests"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx500M"/>
|
||||
</launchConfiguration>
|
||||
@ -1,14 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/com.ibm.wala.core.tests/src/com/ibm/wala/examples/drivers/GVControlDependenceGraph.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.wala.examples.drivers.GVControlDependenceGraph"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-appJar c:/temp/walaWorkspace/com.ibm.wala.core.testdata/bin/com.ibm.wala.core.testdata_1.0.0.jar -sig slice.TestCD3.main([Ljava/lang/String;)V"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.wala.core.tests"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx200M -verbose:gc"/>
|
||||
</launchConfiguration>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/com.ibm.wala.core.tests/src/com/ibm/wala/examples/drivers/PDFControlDependenceGraph.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.wala.examples.drivers.PDFControlDependenceGraph"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-appJar ${workspace_loc}/JLex.jar -sig java.lang.StringBuffer.append(Ljava/lang/String;)Ljava/lang/StringBuffer;"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.wala.core.tests"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx200M -verbose:gc"/>
|
||||
</launchConfiguration>
|
||||
@ -1,14 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/com.ibm.wala.core.tests/src/com/ibm/wala/examples/drivers/GVSlice.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.wala.examples.drivers.GVSlice"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-appJar "c:/temp/walaWorkspace/com.ibm.wala.core.testdata/bin/com.ibm.wala.core.testdata_1.0.0.jar" -mainClass "Lslice/Slice4" -srcCaller "main" -srcCallee "foo" -dd "no_base_no_heap" -cd "none" -dir "forward""/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.wala.core.tests"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx500M -Dcom.ibm.wala.tracefile=c:/temp/domotrace.txt -ea"/>
|
||||
</launchConfiguration>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/com.ibm.wala.core.tests/src/com/ibm/wala/examples/drivers/PDFSDG.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.wala.examples.drivers.PDFSDG"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-appJar ${workspace_loc}/com.ibm.wala.core.testdata/bin/com.ibm.wala.core.testdata_1.0.0.jar -mainClass "Lslice/Slice4" -srcCaller "main" -srcCallee "foo" -dd "no_base_no_heap" -cd "none" -dir "forward""/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.wala.core.tests"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx500M"/>
|
||||
</launchConfiguration>
|
||||
14
com.ibm.wala.core.tests/launchers/PDFSlice.launch
Normal file
14
com.ibm.wala.core.tests/launchers/PDFSlice.launch
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/com.ibm.wala.core.tests/src/com/ibm/wala/examples/drivers/PDFSlice.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.wala.examples.drivers.PDFSlice"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-appJar ${workspace_loc}/com.ibm.wala.core.testdata/bin/com.ibm.wala.core.testdata_1.0.0.jar -mainClass "Lslice/Slice4" -srcCaller "main" -srcCallee "foo" -dd "no_base_no_heap" -cd "none" -dir "forward""/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.wala.core.tests"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx500M -ea"/>
|
||||
</launchConfiguration>
|
||||
@ -8,7 +8,7 @@
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.wala.examples.drivers.PDFTypeHierarchy"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-classpath c:/temp/testdata/JLex.jar"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-classpath ${workspace_loc}/JLex.jar"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.wala.core.tests"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx800M"/>
|
||||
</launchConfiguration>
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/com.ibm.wala.core.tests/src/com/ibm/wala/examples/drivers/GVWalaIR.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.wala.examples.drivers.GVWalaIR"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-appJar c:/temp/testdata/JLex.jar -sig java.lang.StringBuffer.append(Ljava/lang/String;)Ljava/lang/StringBuffer;"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.wala.core.tests"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx200M -verbose:gc"/>
|
||||
</launchConfiguration>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/com.ibm.wala.core.tests/src/com/ibm/wala/examples/drivers/PDFWalaIR.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.wala.examples.drivers.PDFWalaIR"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-appJar ${workspace_loc}/JLex.jar -sig java.lang.StringBuffer.append(Ljava/lang/String;)Ljava/lang/StringBuffer;"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.wala.core.tests"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx200M -verbose:gc"/>
|
||||
</launchConfiguration>
|
||||
@ -8,7 +8,7 @@
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.wala.examples.drivers.SWTTypeHierarchy"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-classpath c:/temp/testdata/JLex.jar"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-classpath ${workspace_loc}/JLex.jar"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.wala.core.tests"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx800M"/>
|
||||
</launchConfiguration>
|
||||
|
||||
@ -24,7 +24,7 @@ import junit.framework.TestCase;
|
||||
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
|
||||
import com.ibm.wala.core.tests.util.TestConstants;
|
||||
import com.ibm.wala.eclipse.util.CancelException;
|
||||
import com.ibm.wala.examples.drivers.GVSlice;
|
||||
import com.ibm.wala.examples.drivers.PDFSlice;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisCache;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisOptions;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisScope;
|
||||
@ -147,7 +147,7 @@ public class SlicerTest extends TestCase {
|
||||
|
||||
CGNode main = findMainMethod(cg);
|
||||
Statement s = findCallTo(main, "foo");
|
||||
s = GVSlice.getReturnStatementForCall(s);
|
||||
s = PDFSlice.getReturnStatementForCall(s);
|
||||
System.err.println("Statement: " + s);
|
||||
// compute a data slice
|
||||
Collection<Statement> slice = Slicer.computeForwardSlice(s, cg, builder.getPointerAnalysis(), DataDependenceOptions.FULL,
|
||||
@ -169,7 +169,7 @@ public class SlicerTest extends TestCase {
|
||||
|
||||
CGNode n = findMethod(cg, "baz");
|
||||
Statement s = findCallTo(n, "foo");
|
||||
s = GVSlice.getReturnStatementForCall(s);
|
||||
s = PDFSlice.getReturnStatementForCall(s);
|
||||
System.err.println("Statement: " + s);
|
||||
// compute a data slice
|
||||
Collection<Statement> slice = Slicer.computeForwardSlice(s, cg, builder.getPointerAnalysis(), DataDependenceOptions.FULL,
|
||||
|
||||
@ -37,16 +37,16 @@ import com.ibm.wala.util.io.CommandLine;
|
||||
import com.ibm.wala.util.io.FileProvider;
|
||||
import com.ibm.wala.util.warnings.WalaException;
|
||||
import com.ibm.wala.viz.DotUtil;
|
||||
import com.ibm.wala.viz.GVUtil;
|
||||
import com.ibm.wala.viz.PDFViewUtil;
|
||||
|
||||
/**
|
||||
* This simple example WALA application builds a call graph and fires off ghostview to visualize a DOT representation.
|
||||
*
|
||||
* @author sfink
|
||||
*/
|
||||
public class GVCallGraph {
|
||||
public class PDFCallGraph {
|
||||
|
||||
private final static String PS_FILE = "cg.ps";
|
||||
private final static String PDF_FILE = "cg.pdf";
|
||||
|
||||
/**
|
||||
* Usage: args = "-appJar [jar file name] {-exclusionFile [exclusionFileName]}" The "jar file name" should be something like
|
||||
@ -89,13 +89,13 @@ public class GVCallGraph {
|
||||
e.printStackTrace();
|
||||
Assertions.UNREACHABLE();
|
||||
}
|
||||
String psFile = p.getProperty(WalaProperties.OUTPUT_DIR) + File.separatorChar + PS_FILE;
|
||||
String pdfFile = p.getProperty(WalaProperties.OUTPUT_DIR) + File.separatorChar + PDF_FILE;
|
||||
|
||||
String dotExe = p.getProperty(WalaExamplesProperties.DOT_EXE);
|
||||
DotUtil.dotify(g, null, PDFTypeHierarchy.DOT_FILE, psFile, dotExe);
|
||||
DotUtil.dotify(g, null, PDFTypeHierarchy.DOT_FILE, pdfFile, dotExe);
|
||||
|
||||
String gvExe = p.getProperty(WalaExamplesProperties.PDFVIEW_EXE);
|
||||
return GVUtil.launchGV(psFile, gvExe);
|
||||
return PDFViewUtil.launchPDFView(pdfFile, gvExe);
|
||||
|
||||
} catch (WalaException e) {
|
||||
e.printStackTrace();
|
||||
@ -35,8 +35,7 @@ import com.ibm.wala.util.io.FileProvider;
|
||||
import com.ibm.wala.util.strings.StringStuff;
|
||||
import com.ibm.wala.util.warnings.WalaException;
|
||||
import com.ibm.wala.viz.DotUtil;
|
||||
import com.ibm.wala.viz.GVUtil;
|
||||
import com.ibm.wala.viz.GhostviewUtil;
|
||||
import com.ibm.wala.viz.PDFViewUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -45,11 +44,11 @@ import com.ibm.wala.viz.GhostviewUtil;
|
||||
*
|
||||
* @author sfink
|
||||
*/
|
||||
public class GVControlDependenceGraph {
|
||||
public class PDFControlDependenceGraph {
|
||||
|
||||
final public static boolean SANITIZE_CFG = false;
|
||||
|
||||
final public static String PS_FILE = "cdg.ps";
|
||||
final public static String PDF_FILE = "cdg.pdf";
|
||||
|
||||
/**
|
||||
* Usage: GVControlDependenceGraph -appJar [jar file name] -sig [method signature] The "jar
|
||||
@ -96,7 +95,8 @@ public class GVControlDependenceGraph {
|
||||
|
||||
IMethod m = cha.resolveMethod(mr);
|
||||
if (m == null) {
|
||||
Assertions.UNREACHABLE("could not resolve " + mr);
|
||||
System.err.println("could not resolve " + mr);
|
||||
throw new RuntimeException();
|
||||
}
|
||||
AnalysisOptions options = new AnalysisOptions();
|
||||
options.getSSAOptions().setPiNodePolicy(SSAOptions.getAllBuiltInPiNodes());
|
||||
@ -118,15 +118,15 @@ public class GVControlDependenceGraph {
|
||||
e.printStackTrace();
|
||||
Assertions.UNREACHABLE();
|
||||
}
|
||||
String psFile = wp.getProperty(WalaProperties.OUTPUT_DIR) + File.separatorChar + GVControlDependenceGraph.PS_FILE;
|
||||
String psFile = wp.getProperty(WalaProperties.OUTPUT_DIR) + File.separatorChar + PDFControlDependenceGraph.PDF_FILE;
|
||||
String dotFile = wp.getProperty(WalaProperties.OUTPUT_DIR) + File.separatorChar
|
||||
+ PDFTypeHierarchy.DOT_FILE;
|
||||
String dotExe = wp.getProperty(WalaExamplesProperties.DOT_EXE);
|
||||
String gvExe = wp.getProperty(WalaExamplesProperties.PDFVIEW_EXE);
|
||||
|
||||
DotUtil.dotify(cdg, GhostviewUtil.makeIRDecorator(ir), dotFile, psFile, dotExe);
|
||||
DotUtil.dotify(cdg, PDFViewUtil.makeIRDecorator(ir), dotFile, psFile, dotExe);
|
||||
|
||||
return GVUtil.launchGV(psFile, gvExe);
|
||||
return PDFViewUtil.launchPDFView(psFile, gvExe);
|
||||
|
||||
} catch (WalaException e) {
|
||||
// TODO Auto-generated catch block
|
||||
@ -44,7 +44,7 @@ import com.ibm.wala.util.io.CommandLine;
|
||||
import com.ibm.wala.util.io.FileProvider;
|
||||
import com.ibm.wala.util.warnings.WalaException;
|
||||
import com.ibm.wala.viz.DotUtil;
|
||||
import com.ibm.wala.viz.GVUtil;
|
||||
import com.ibm.wala.viz.PDFViewUtil;
|
||||
import com.ibm.wala.viz.NodeDecorator;
|
||||
|
||||
/**
|
||||
@ -54,9 +54,9 @@ import com.ibm.wala.viz.NodeDecorator;
|
||||
*
|
||||
* @author sfink
|
||||
*/
|
||||
public class GVSDG {
|
||||
public class PDFSDG {
|
||||
|
||||
private final static String PS_FILE = "sdg.ps";
|
||||
private final static String PDF_FILE = "sdg.pdf";
|
||||
|
||||
/**
|
||||
* Usage: GVSDG -appJar [jar file name] -mainclass [main class]
|
||||
@ -144,14 +144,14 @@ public class GVSDG {
|
||||
e.printStackTrace();
|
||||
Assertions.UNREACHABLE();
|
||||
}
|
||||
String psFile = p.getProperty(WalaProperties.OUTPUT_DIR) + File.separatorChar + PS_FILE;
|
||||
String psFile = p.getProperty(WalaProperties.OUTPUT_DIR) + File.separatorChar + PDF_FILE;
|
||||
|
||||
String dotExe = p.getProperty(WalaExamplesProperties.DOT_EXE);
|
||||
Graph<Statement> g = pruneSDG(sdg);
|
||||
DotUtil.dotify(g, makeNodeDecorator(), PDFTypeHierarchy.DOT_FILE, psFile, dotExe);
|
||||
|
||||
String gvExe = p.getProperty(WalaExamplesProperties.PDFVIEW_EXE);
|
||||
return GVUtil.launchGV(psFile, gvExe);
|
||||
return PDFViewUtil.launchPDFView(psFile, gvExe);
|
||||
|
||||
} catch (WalaException e) {
|
||||
// TODO Auto-generated catch block
|
||||
@ -55,7 +55,7 @@ import com.ibm.wala.util.io.CommandLine;
|
||||
import com.ibm.wala.util.io.FileProvider;
|
||||
import com.ibm.wala.util.warnings.WalaException;
|
||||
import com.ibm.wala.viz.DotUtil;
|
||||
import com.ibm.wala.viz.GVUtil;
|
||||
import com.ibm.wala.viz.PDFViewUtil;
|
||||
import com.ibm.wala.viz.NodeDecorator;
|
||||
|
||||
/**
|
||||
@ -69,12 +69,12 @@ import com.ibm.wala.viz.NodeDecorator;
|
||||
*
|
||||
* @author sfink
|
||||
*/
|
||||
public class GVSlice {
|
||||
public class PDFSlice {
|
||||
|
||||
/**
|
||||
* Name of the postscript file generated by dot
|
||||
*/
|
||||
private final static String PS_FILE = "slice.ps";
|
||||
private final static String PDF_FILE = "slice.pdf";
|
||||
|
||||
/**
|
||||
* Usage: GVSlice -appJar [jar file name] -mainClass [main class] -srcCaller [method name] -srcCallee [method name]
|
||||
@ -117,7 +117,7 @@ public class GVSlice {
|
||||
|
||||
// run the applications
|
||||
return run(p.getProperty("appJar"), p.getProperty("mainClass"), p.getProperty("srcCaller"), p.getProperty("srcCallee"),
|
||||
goBackward(p), GVSDG.getDataDependenceOptions(p), GVSDG.getControlDependenceOptions(p));
|
||||
goBackward(p), PDFSDG.getDataDependenceOptions(p), PDFSDG.getControlDependenceOptions(p));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -190,13 +190,13 @@ public class GVSlice {
|
||||
Assertions.UNREACHABLE();
|
||||
}
|
||||
// create a dot representation.
|
||||
String psFile = p.getProperty(WalaProperties.OUTPUT_DIR) + File.separatorChar + PS_FILE;
|
||||
String psFile = p.getProperty(WalaProperties.OUTPUT_DIR) + File.separatorChar + PDF_FILE;
|
||||
String dotExe = p.getProperty(WalaExamplesProperties.DOT_EXE);
|
||||
DotUtil.dotify(g, makeNodeDecorator(), PDFTypeHierarchy.DOT_FILE, psFile, dotExe);
|
||||
|
||||
// fire off ghostview
|
||||
String gvExe = p.getProperty(WalaExamplesProperties.PDFVIEW_EXE);
|
||||
return GVUtil.launchGV(psFile, gvExe);
|
||||
return PDFViewUtil.launchPDFView(psFile, gvExe);
|
||||
|
||||
} catch (WalaException e) {
|
||||
// something bad happened.
|
||||
@ -31,7 +31,7 @@ import com.ibm.wala.util.graph.GraphSlicer;
|
||||
import com.ibm.wala.util.io.FileProvider;
|
||||
import com.ibm.wala.util.warnings.WalaException;
|
||||
import com.ibm.wala.viz.DotUtil;
|
||||
import com.ibm.wala.viz.GVUtil;
|
||||
import com.ibm.wala.viz.PDFViewUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -80,7 +80,7 @@ public class PDFTypeHierarchy {
|
||||
String dotExe = p.getProperty(WalaExamplesProperties.DOT_EXE);
|
||||
String gvExe = p.getProperty(WalaExamplesProperties.PDFVIEW_EXE);
|
||||
DotUtil.dotify(g, null, dotFile, pdfFile, dotExe);
|
||||
return GVUtil.launchGV(pdfFile, gvExe);
|
||||
return PDFViewUtil.launchPDFView(pdfFile, gvExe);
|
||||
|
||||
} catch (WalaException e) {
|
||||
// TODO Auto-generated catch block
|
||||
|
||||
@ -32,7 +32,7 @@ import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.io.FileProvider;
|
||||
import com.ibm.wala.util.strings.StringStuff;
|
||||
import com.ibm.wala.util.warnings.WalaException;
|
||||
import com.ibm.wala.viz.GhostviewUtil;
|
||||
import com.ibm.wala.viz.PDFViewUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -41,9 +41,9 @@ import com.ibm.wala.viz.GhostviewUtil;
|
||||
*
|
||||
* @author sfink
|
||||
*/
|
||||
public class GVWalaIR {
|
||||
public class PDFWalaIR {
|
||||
|
||||
final public static String PS_FILE = "ir.ps";
|
||||
final public static String PDF_FILE = "ir.pdf";
|
||||
|
||||
/**
|
||||
* Usage: GVWalaIR -appJar [jar file name] -sig [method signature] The "jar
|
||||
@ -111,12 +111,12 @@ public class GVWalaIR {
|
||||
e.printStackTrace();
|
||||
Assertions.UNREACHABLE();
|
||||
}
|
||||
String psFile = wp.getProperty(WalaProperties.OUTPUT_DIR) + File.separatorChar + GVWalaIR.PS_FILE;
|
||||
String psFile = wp.getProperty(WalaProperties.OUTPUT_DIR) + File.separatorChar + PDFWalaIR.PDF_FILE;
|
||||
String dotFile = wp.getProperty(WalaProperties.OUTPUT_DIR) + File.separatorChar + PDFTypeHierarchy.DOT_FILE;
|
||||
String dotExe = wp.getProperty(WalaExamplesProperties.DOT_EXE);
|
||||
String gvExe = wp.getProperty(WalaExamplesProperties.PDFVIEW_EXE);
|
||||
|
||||
return GhostviewUtil.ghostviewIR(cha, ir, psFile, dotFile, dotExe, gvExe);
|
||||
return PDFViewUtil.ghostviewIR(cha, ir, psFile, dotFile, dotExe, gvExe);
|
||||
|
||||
} catch (WalaException e) {
|
||||
// TODO Auto-generated catch block
|
||||
@ -65,7 +65,7 @@ public class SWTCallGraph {
|
||||
*/
|
||||
public static void main(String[] args) throws WalaException {
|
||||
Properties p = CommandLine.parse(args);
|
||||
GVCallGraph.validateCommandLine(p);
|
||||
PDFCallGraph.validateCommandLine(p);
|
||||
run(p);
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ public class SWTCallGraph {
|
||||
e.printStackTrace();
|
||||
Assertions.UNREACHABLE();
|
||||
}
|
||||
String psFile = wp.getProperty(WalaProperties.OUTPUT_DIR) + File.separatorChar + GVWalaIR.PS_FILE;
|
||||
String psFile = wp.getProperty(WalaProperties.OUTPUT_DIR) + File.separatorChar + PDFWalaIR.PDF_FILE;
|
||||
String dotFile = wp.getProperty(WalaProperties.OUTPUT_DIR) + File.separatorChar + PDFTypeHierarchy.DOT_FILE;
|
||||
String dotExe = wp.getProperty(WalaExamplesProperties.DOT_EXE);
|
||||
String gvExe = wp.getProperty(WalaExamplesProperties.PDFVIEW_EXE);
|
||||
|
||||
@ -52,7 +52,7 @@ public class SWTPointsTo {
|
||||
*/
|
||||
public static void main(String[] args) throws WalaException {
|
||||
Properties p = CommandLine.parse(args);
|
||||
GVCallGraph.validateCommandLine(p);
|
||||
PDFCallGraph.validateCommandLine(p);
|
||||
run(p.getProperty("appJar"));
|
||||
}
|
||||
|
||||
|
||||
@ -1,43 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2002 - 2006 IBM Corporation.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM Corporation - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package com.ibm.wala.viz;
|
||||
|
||||
import com.ibm.wala.util.warnings.WalaException;
|
||||
|
||||
/**
|
||||
* utilities for ghostview
|
||||
*
|
||||
* @author sfink
|
||||
*/
|
||||
public class GVUtil {
|
||||
|
||||
/**
|
||||
* Launch a process to view a postscript file
|
||||
*/
|
||||
public static Process launchGV(String psFile, String gvExe) throws WalaException {
|
||||
// set up a viewer for the ps file.
|
||||
if (gvExe == null) {
|
||||
throw new IllegalArgumentException("null gvExe");
|
||||
}
|
||||
if (psFile == null) {
|
||||
throw new IllegalArgumentException("null psFile");
|
||||
}
|
||||
final GSViewLauncher gv = new GSViewLauncher();
|
||||
gv.setGvExe(gvExe);
|
||||
gv.setPsfile(psFile);
|
||||
gv.run();
|
||||
if (gv.getProcess() == null) {
|
||||
throw new WalaException(" problem spawning process ");
|
||||
}
|
||||
return gv.getProcess();
|
||||
}
|
||||
|
||||
}
|
||||
@ -20,30 +20,30 @@ import com.ibm.wala.util.warnings.WalaException;
|
||||
*
|
||||
* TODO: inherit from a launcher?
|
||||
*/
|
||||
class GSViewLauncher {
|
||||
class PDFViewLauncher {
|
||||
|
||||
private Process process;
|
||||
|
||||
/**
|
||||
* Name of the postscript file to view
|
||||
*/
|
||||
protected String psfile = null;
|
||||
protected String pdffile = null;
|
||||
|
||||
/**
|
||||
* Path to ghostview executable
|
||||
*/
|
||||
protected String gvExe = null;
|
||||
|
||||
GSViewLauncher() {
|
||||
PDFViewLauncher() {
|
||||
super();
|
||||
}
|
||||
|
||||
String getPsfile() {
|
||||
return psfile;
|
||||
String getPDFFile() {
|
||||
return pdffile;
|
||||
}
|
||||
|
||||
void setPsfile(String newPsfile) {
|
||||
psfile = newPsfile;
|
||||
void setPDFFile(String newPsfile) {
|
||||
pdffile = newPsfile;
|
||||
}
|
||||
|
||||
String getGvExe() {
|
||||
@ -58,7 +58,7 @@ class GSViewLauncher {
|
||||
public String toString() {
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(", psfile: ");
|
||||
result.append(psfile);
|
||||
result.append(pdffile);
|
||||
result.append(", gvExe: ");
|
||||
result.append(gvExe);
|
||||
result.append(')');
|
||||
@ -71,7 +71,7 @@ class GSViewLauncher {
|
||||
* @see java.lang.Runnable#run()
|
||||
*/
|
||||
public void run() {
|
||||
String[] cmdarray = { getGvExe(), getPsfile() };
|
||||
String[] cmdarray = { getGvExe(), getPDFFile() };
|
||||
try {
|
||||
Process p = Runtime.getRuntime().exec(cmdarray);
|
||||
setProcess(p);
|
||||
@ -34,7 +34,7 @@ import com.ibm.wala.util.warnings.WalaException;
|
||||
*
|
||||
* @author sfink
|
||||
*/
|
||||
public class GhostviewUtil {
|
||||
public class PDFViewUtil {
|
||||
|
||||
/**
|
||||
* spawn a process to ghostview a WALA IR
|
||||
@ -70,7 +70,7 @@ public class GhostviewUtil {
|
||||
|
||||
DotUtil.dotify(g, labels, dotFile, psFile, dotExe);
|
||||
|
||||
return GVUtil.launchGV(psFile, gvExe);
|
||||
return launchPDFView(psFile, gvExe);
|
||||
}
|
||||
|
||||
public static NodeDecorator makeIRDecorator(IR ir) {
|
||||
@ -158,4 +158,26 @@ public class GhostviewUtil {
|
||||
}
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch a process to view a postscript file
|
||||
*/
|
||||
public static Process launchPDFView(String pdfFile, String gvExe) throws WalaException {
|
||||
// set up a viewer for the ps file.
|
||||
if (gvExe == null) {
|
||||
throw new IllegalArgumentException("null gvExe");
|
||||
}
|
||||
if (pdfFile == null) {
|
||||
throw new IllegalArgumentException("null psFile");
|
||||
}
|
||||
final PDFViewLauncher gv = new PDFViewLauncher();
|
||||
gv.setGvExe(gvExe);
|
||||
gv.setPDFFile(pdfFile);
|
||||
gv.run();
|
||||
if (gv.getProcess() == null) {
|
||||
throw new WalaException(" problem spawning process ");
|
||||
}
|
||||
return gv.getProcess();
|
||||
}
|
||||
|
||||
}
|
||||
@ -184,7 +184,7 @@ public class ViewIFDSLocalAction<T, P, F> extends Action {
|
||||
DotUtil.dotify(localGraph, labels, dotFile, psFile, dotExe);
|
||||
|
||||
if (DotUtil.getOutputType() == DotUtil.DotOutputType.PS) {
|
||||
GVUtil.launchGV(psFile, gvExe);
|
||||
PDFViewUtil.launchPDFView(psFile, gvExe);
|
||||
}
|
||||
} catch (WalaException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@ -80,7 +80,7 @@ public class ViewIRAction extends Action {
|
||||
// spawn the viewer
|
||||
System.err.println("Spawn IR Viewer for " + ir.getMethod());
|
||||
try {
|
||||
GhostviewUtil.ghostviewIR(cg.getClassHierarchy(), ir, psFile, dotFile, dotExe, gvExe);
|
||||
PDFViewUtil.ghostviewIR(cg.getClassHierarchy(), ir, psFile, dotFile, dotExe, gvExe);
|
||||
} catch (WalaException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user