From f153346b4082b0c9035fbbd1d1fb32a4f352b599 Mon Sep 17 00:00:00 2001 From: jjenista Date: Tue, 3 May 2011 17:38:26 +0000 Subject: [PATCH] allow debug reach graphs to show taints but supress node, edge AND taint predicates, and some other tiny debug changes --- Robust/src/Analysis/Disjoint/DisjointAnalysis.java | 6 +++--- Robust/src/Analysis/Disjoint/ReachGraph.java | 6 +++--- Robust/src/Analysis/Disjoint/RefEdge.java | 2 +- Robust/src/Analysis/Disjoint/Taint.java | 13 ++++++++++++- Robust/src/Analysis/Disjoint/TaintSet.java | 4 ++-- Robust/src/Benchmarks/oooJava/master-makefile | 3 ++- 6 files changed, 23 insertions(+), 11 deletions(-) diff --git a/Robust/src/Analysis/Disjoint/DisjointAnalysis.java b/Robust/src/Analysis/Disjoint/DisjointAnalysis.java index 4a4ec001..6792fa18 100644 --- a/Robust/src/Analysis/Disjoint/DisjointAnalysis.java +++ b/Robust/src/Analysis/Disjoint/DisjointAnalysis.java @@ -690,8 +690,8 @@ public class DisjointAnalysis implements HeapAnalysis { this.releaseMode = state.DISJOINTRELEASEMODE; this.determinismDesired = state.DISJOINTDETERMINISM; - this.writeFinalDOTs = state.DISJOINTWRITEDOTS && !state.DISJOINTWRITEALL && !suppressOutput; - this.writeAllIncrementalDOTs = state.DISJOINTWRITEDOTS && state.DISJOINTWRITEALL && !suppressOutput; + this.writeFinalDOTs = state.DISJOINTWRITEDOTS && !state.DISJOINTWRITEALL; + this.writeAllIncrementalDOTs = state.DISJOINTWRITEDOTS && state.DISJOINTWRITEALL; this.takeDebugSnapshots = state.DISJOINTSNAPSYMBOL != null; this.descSymbolDebug = state.DISJOINTSNAPSYMBOL; @@ -1789,7 +1789,7 @@ public class DisjointAnalysis implements HeapAnalysis { true, // write labels (variables) true, // selectively hide intermediate temp vars true, // prune unreachable heap regions - false, // hide reachability altogether + true, // hide reachability altogether true, // hide subset reachability states true, // hide predicates false); // hide edge taints diff --git a/Robust/src/Analysis/Disjoint/ReachGraph.java b/Robust/src/Analysis/Disjoint/ReachGraph.java index 4db4c91f..186e58aa 100644 --- a/Robust/src/Analysis/Disjoint/ReachGraph.java +++ b/Robust/src/Analysis/Disjoint/ReachGraph.java @@ -2221,10 +2221,10 @@ public class ReachGraph { private static boolean resolveMethodDebugDOTwriteLabels = true; private static boolean resolveMethodDebugDOTselectTemps = true; private static boolean resolveMethodDebugDOTpruneGarbage = true; - private static boolean resolveMethodDebugDOThideReach = false; - private static boolean resolveMethodDebugDOThideSubsetReach = false; + private static boolean resolveMethodDebugDOThideReach = true; + private static boolean resolveMethodDebugDOThideSubsetReach = true; private static boolean resolveMethodDebugDOThidePreds = true; - private static boolean resolveMethodDebugDOThideEdgeTaints = true; + private static boolean resolveMethodDebugDOThideEdgeTaints = false; static String debugGraphPrefix; static int debugCallSiteVisitCounter; diff --git a/Robust/src/Analysis/Disjoint/RefEdge.java b/Robust/src/Analysis/Disjoint/RefEdge.java index f8d8b0c6..8c8c6852 100644 --- a/Robust/src/Analysis/Disjoint/RefEdge.java +++ b/Robust/src/Analysis/Disjoint/RefEdge.java @@ -275,7 +275,7 @@ public class RefEdge { if( !hideEdgeTaints ) { if( !taints.isEmpty() ) { - s += "\\n"+taints.toStringEscNewline(); + s += "\\n"+taints.toStringEscNewline( hidePreds ); } } diff --git a/Robust/src/Analysis/Disjoint/Taint.java b/Robust/src/Analysis/Disjoint/Taint.java index 0f47a4de..05f6c201 100644 --- a/Robust/src/Analysis/Disjoint/Taint.java +++ b/Robust/src/Analysis/Disjoint/Taint.java @@ -223,7 +223,13 @@ public class Taint extends Canonical { return hash; } + public String toString() { + return toString( false ); + } + + + public String toString( boolean suppressPredicates ) { String s; @@ -238,11 +244,16 @@ public class Taint extends Canonical { f += ", "+fnDefined; } + String p = ""; + if( !suppressPredicates ) { + p += ":"+preds; + } + return "("+s+ "-"+var+ ", "+allocSite.toStringBrief()+ f+ - "):"+preds; + ")"+p; } } diff --git a/Robust/src/Analysis/Disjoint/TaintSet.java b/Robust/src/Analysis/Disjoint/TaintSet.java index bcbc883b..39b12077 100644 --- a/Robust/src/Analysis/Disjoint/TaintSet.java +++ b/Robust/src/Analysis/Disjoint/TaintSet.java @@ -157,14 +157,14 @@ public class TaintSet extends Canonical { return taints.hashCode(); } - public String toStringEscNewline() { + public String toStringEscNewline( boolean suppressPredicates ) { String s = "taints["; Iterator tItr = taints.iterator(); while( tItr.hasNext() ) { Taint t = tItr.next(); - s += t.toString(); + s += t.toString( suppressPredicates ); if( tItr.hasNext() ) { s += ",\\n"; } diff --git a/Robust/src/Benchmarks/oooJava/master-makefile b/Robust/src/Benchmarks/oooJava/master-makefile index 5789c0bd..37f023d9 100644 --- a/Robust/src/Benchmarks/oooJava/master-makefile +++ b/Robust/src/Benchmarks/oooJava/master-makefile @@ -74,7 +74,8 @@ DISJOINT= -disjoint -disjoint-k 1 -enable-assertions $(DRELEASEMODE) #-disjoint- # -disjoint-debug-snap-method Remove 10 3 true DISJOINTDEBUG= -justanalyze -disjoint -disjoint-k 1 -enable-assertions \ - -disjoint-debug-callsite Demand.add Lateral.compute 35 1000 true + -disjoint-write-dots final \ + -disjoint-debug-callsite Demand.add Lateral.compute 1 1000 true # -disjoint-desire-determinism # -disjoint-debug-snap-method ComputeCenterOfMass 6 2 true # -disjoint-debug-scheduling -- 2.34.1