From a758738257eb3d4015c5795379923178ae3ab3bf Mon Sep 17 00:00:00 2001 From: jjenista Date: Wed, 14 Oct 2009 15:09:22 +0000 Subject: [PATCH] updating graph display options --- Robust/src/Analysis/MLP/MLPAnalysis.java | 9 ++- .../OwnershipAnalysis/OwnershipAnalysis.java | 43 +++++++----- .../OwnershipAnalysis/OwnershipGraph.java | 69 +++++++++++++++---- .../OwnershipAnalysis/ReferenceEdge.java | 39 ++++++----- 4 files changed, 110 insertions(+), 50 deletions(-) diff --git a/Robust/src/Analysis/MLP/MLPAnalysis.java b/Robust/src/Analysis/MLP/MLPAnalysis.java index 227354ab..db941a42 100644 --- a/Robust/src/Analysis/MLP/MLPAnalysis.java +++ b/Robust/src/Analysis/MLP/MLPAnalysis.java @@ -829,7 +829,14 @@ public class MLPAnalysis { if(fm.toString().indexOf(methodName)>0){ try { - og.writeGraph(fm.toString() + "SECONDGRAPH", true, true, true, true, false); + og.writeGraph(fm.toString() + "SECONDGRAPH", + true, // write labels (variables) + true, // selectively hide intermediate temp vars + true, // prune unreachable heap regions + false, // show back edges to confirm graph validity + false, // show parameter indices (unmaintained!) + true, // hide subset reachability states + false);// hide edge taints } catch (IOException e) { System.out.println("Error writing debug capture."); System.exit(0); diff --git a/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java b/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java index 0921ef0c..c28f264c 100644 --- a/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java +++ b/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java @@ -1105,7 +1105,14 @@ public class OwnershipAnalysis { } Integer n = mapMethodContextToNumUpdates.get(mc); try { - og.writeGraph(mc, n, true, true, true, false, false, true); + og.writeGraph(mc+"COMPLETE"+String.format("%05d", n), + true, // write labels (variables) + true, // selectively hide intermediate temp vars + true, // prune unreachable heap regions + false, // show back edges to confirm graph validity + false, // show parameter indices (unmaintained!) + true, // hide subset reachability states + true); // hide edge taints } catch( IOException e ) {} mapMethodContextToNumUpdates.put(mc, n + 1); } @@ -1132,14 +1139,6 @@ public class OwnershipAnalysis { private void writeFinalContextGraphs() { - // arguments to writeGraph are: - // boolean writeLabels, - // boolean labelSelect, - // boolean pruneGarbage, - // boolean writeReferencers - // boolean writeParamMappings - // boolean hideSubsetReachability - Set entrySet = mapMethodContextToCompleteOwnershipGraph.entrySet(); Iterator itr = entrySet.iterator(); while( itr.hasNext() ) { @@ -1148,7 +1147,14 @@ public class OwnershipAnalysis { OwnershipGraph og = (OwnershipGraph) me.getValue(); try { - og.writeGraph(mc, true, true, true, false, false, true); + og.writeGraph(mc+"COMPLETE", + true, // write labels (variables) + true, // selectively hide intermediate temp vars + true, // prune unreachable heap regions + false, // show back edges to confirm graph validity + false, // show parameter indices (unmaintained!) + true, // hide subset reachability states + true); // hide edge taints } catch( IOException e ) {} } } @@ -1451,15 +1457,14 @@ public class OwnershipAnalysis { graphName = graphName+fn; } try { - // arguments to writeGraph are: - // boolean writeLabels, - // boolean labelSelect, - // boolean pruneGarbage, - // boolean writeReferencers - // boolean writeParamMappings - - //og.writeGraph(graphName, true, true, true, false, false); - og.writeGraph(graphName, true, true, true, false, false); + og.writeGraph(graphName, + true, // write labels (variables) + true, // selectively hide intermediate temp vars + true, // prune unreachable heap regions + false, // show back edges to confirm graph validity + false, // show parameter indices (unmaintained!) + true, // hide subset reachability states + true); // hide edge taints } catch( Exception e ) { System.out.println("Error writing debug capture."); System.exit(0); diff --git a/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java b/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java index 0d4d803c..5a5717ab 100644 --- a/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java +++ b/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java @@ -1906,8 +1906,23 @@ public class OwnershipGraph { fm.getMethod().getSymbol().equals( debugCallee ) ) { try { - writeGraph( "debug1BeforeCall", true, true, true, false, false ); - ogCallee.writeGraph( "debug0Callee", true, true, true, false, false ); + writeGraph("debug1BeforeCall", + true, // write labels (variables) + true, // selectively hide intermediate temp vars + true, // prune unreachable heap regions + false, // show back edges to confirm graph validity + false, // show parameter indices (unmaintained!) + true, // hide subset reachability states + true); // hide edge taints + + ogCallee.writeGraph("debug0Callee", + true, // write labels (variables) + true, // selectively hide intermediate temp vars + true, // prune unreachable heap regions + false, // show back edges to confirm graph validity + false, // show parameter indices (unmaintained!) + true, // hide subset reachability states + true); // hide edge taints } catch( IOException e ) {} System.out.println( " "+mc+" is calling "+fm ); @@ -2953,7 +2968,14 @@ public class OwnershipGraph { if( mc.getDescriptor().getSymbol().equals( debugCaller ) && fm.getMethod().getSymbol().equals( debugCallee ) ) { try { - writeGraph( "debug7JustBeforeMergeToKCapacity", true, true, true, false, false ); + writeGraph("debug7JustBeforeMergeToKCapacity", + true, // write labels (variables) + true, // selectively hide intermediate temp vars + true, // prune unreachable heap regions + false, // show back edges to confirm graph validity + false, // show parameter indices (unmaintained!) + true, // hide subset reachability states + true); // hide edge taints } catch( IOException e ) {} } @@ -3029,7 +3051,14 @@ public class OwnershipGraph { if( mc.getDescriptor().getSymbol().equals( debugCaller ) && fm.getMethod().getSymbol().equals( debugCallee ) ) { try { - writeGraph( "debug8JustBeforeSweep", true, true, true, false, false ); + writeGraph( "debug8JustBeforeSweep", + true, // write labels (variables) + true, // selectively hide intermediate temp vars + true, // prune unreachable heap regions + false, // show back edges to confirm graph validity + false, // show parameter indices (unmaintained!) + true, // hide subset reachability states + true); // hide edge taints } catch( IOException e ) {} } @@ -3043,7 +3072,14 @@ public class OwnershipGraph { if( mc.getDescriptor().getSymbol().equals( debugCaller ) && fm.getMethod().getSymbol().equals( debugCallee ) ) { try { - writeGraph( "debug9endResolveCall", true, true, true, false, false ); + writeGraph( "debug9endResolveCall", + true, // write labels (variables) + true, // selectively hide intermediate temp vars + true, // prune unreachable heap regions + false, // show back edges to confirm graph validity + false, // show parameter indices (unmaintained!) + true, // hide subset reachability states + true); // hide edge taints } catch( IOException e ) {} System.out.println( " "+mc+" done calling "+fm ); ++x; @@ -4480,6 +4516,7 @@ public class OwnershipGraph { } + /* // for writing ownership graphs to dot files public void writeGraph(MethodContext mc, FlatNode fn, @@ -4590,6 +4627,7 @@ public class OwnershipGraph { false ); } + */ public void writeGraph(String graphName, boolean writeLabels, @@ -4597,7 +4635,8 @@ public class OwnershipGraph { boolean pruneGarbage, boolean writeReferencers, boolean writeParamMappings, - boolean hideSubsetReachability + boolean hideSubsetReachability, + boolean hideEdgeTaints ) throws java.io.IOException { // remove all non-word characters from the graph name so @@ -4628,7 +4667,8 @@ public class OwnershipGraph { null, visited, writeReferencers, - hideSubsetReachability); + hideSubsetReachability, + hideEdgeTaints); } } } @@ -4684,12 +4724,14 @@ public class OwnershipGraph { null, visited, writeReferencers, - hideSubsetReachability); + hideSubsetReachability, + hideEdgeTaints); } bw.write(" " + ln.toString() + " -> " + hrn.toString() + - "[label=\"" + edge.toGraphEdgeString(hideSubsetReachability) + + "[label=\"" + edge.toGraphEdgeString(hideSubsetReachability, + hideEdgeTaints) + "\",decorate];\n"); } } @@ -4706,7 +4748,8 @@ public class OwnershipGraph { TempDescriptor td, HashSet visited, boolean writeReferencers, - boolean hideSubsetReachability + boolean hideSubsetReachability, + boolean hideEdgeTaints ) throws java.io.IOException { if( visited.contains(hrn) ) { @@ -4776,7 +4819,8 @@ public class OwnershipGraph { case VISIT_HRN_WRITE_FULL: bw.write(" " + hrn.toString() + " -> " + hrnChild.toString() + - "[label=\"" + edge.toGraphEdgeString(hideSubsetReachability) + + "[label=\"" + edge.toGraphEdgeString(hideSubsetReachability, + hideEdgeTaints) + "\",decorate];\n"); break; } @@ -4787,7 +4831,8 @@ public class OwnershipGraph { td, visited, writeReferencers, - hideSubsetReachability); + hideSubsetReachability, + hideEdgeTaints); } } diff --git a/Robust/src/Analysis/OwnershipAnalysis/ReferenceEdge.java b/Robust/src/Analysis/OwnershipAnalysis/ReferenceEdge.java index 2fcc443d..94778f87 100644 --- a/Robust/src/Analysis/OwnershipAnalysis/ReferenceEdge.java +++ b/Robust/src/Analysis/OwnershipAnalysis/ReferenceEdge.java @@ -210,29 +210,32 @@ public class ReferenceEdge { } - public String toGraphEdgeString(boolean hideSubsetReachability) { - String edgeLabel = ""; + public String toGraphEdgeString(boolean hideSubsetReachability, + boolean hideEdgeTaints) { + String edgeLabel = ""; - if (type != null) { - edgeLabel += type.toPrettyString() + "\\n"; - } - - if (field != null) { - edgeLabel += field + "\\n"; - } + if (type != null) { + edgeLabel += type.toPrettyString() + "\\n"; + } - if (isInitialParam) { - edgeLabel += "*init*\\n"; - } + if (field != null) { + edgeLabel += field + "\\n"; + } - edgeLabel += "*taint*=" + Integer.toBinaryString(taintIdentifier) - + "\\n*SESE*=" + Integer.toBinaryString(SESEtaintIdentifier) - + "\\n"; + if (isInitialParam) { + edgeLabel += "*init*\\n"; + } - edgeLabel += beta.toStringEscapeNewline(hideSubsetReachability); + if( !hideEdgeTaints ) { + edgeLabel += "*taint*=" + Integer.toBinaryString(taintIdentifier) + + "\\n*SESE*=" + Integer.toBinaryString(SESEtaintIdentifier) + + "\\n"; + } - return edgeLabel; - } + edgeLabel += beta.toStringEscapeNewline(hideSubsetReachability); + + return edgeLabel; + } public String toString() { if( type != null ) { -- 2.34.1