updating graph display options
authorjjenista <jjenista>
Wed, 14 Oct 2009 15:09:22 +0000 (15:09 +0000)
committerjjenista <jjenista>
Wed, 14 Oct 2009 15:09:22 +0000 (15:09 +0000)
Robust/src/Analysis/MLP/MLPAnalysis.java
Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java
Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java
Robust/src/Analysis/OwnershipAnalysis/ReferenceEdge.java

index 227354ab842e1b6a23e9c697cf408b96b73f7977..db941a4277bc134c7ade64c2c2a13026035dd823 100644 (file)
@@ -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);
index 0921ef0c0b9fef273c19dd868c413283a0dc6877..c28f264cd1c73972f9416abb497ea177b05bcdd1 100644 (file)
@@ -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);
index 0d4d803cf561121b3c7b6be8eb8851b9b4951081..5a5717abda80a765d0fd3f3a902807ab840a819c 100644 (file)
@@ -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<HeapRegionNode> 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);
     }
   }
   
index 2fcc443d68b5af9e6588d7430c15d047bc6829ab..94778f876709b796d87da07e7868a4d7a68a8150 100644 (file)
@@ -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 ) {