summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2003-12-15 20:58:18 -0800
committerSteve Reinhardt <stever@eecs.umich.edu>2003-12-15 20:58:18 -0800
commitd0feece6e06aecec134228b577f9a7f22ed792c0 (patch)
tree58a028abebaa9bb2a64f9b74358d7708294d48a3
parenteb1cfea1aaec1584bbc5d2b344eae30b5b29c31f (diff)
downloadgem5-d0feece6e06aecec134228b577f9a7f22ed792c0.tar.xz
Minor enhancements to rundiff.
util/rundiff: Dump buffered lines on loss of sync so we see where things went wrong. Also return proper exit code from checkmatch() function. --HG-- extra : convert_revision : cd88064ee784a50b675bf3fededbb3901c3c266c
-rwxr-xr-xutil/rundiff10
1 files changed, 9 insertions, 1 deletions
diff --git a/util/rundiff b/util/rundiff
index 05beba84b..63c05b96b 100755
--- a/util/rundiff
+++ b/util/rundiff
@@ -191,7 +191,10 @@ sub printdiff
DISCARD_A => \&discard1,
DISCARD_B => \&discard2 });
- die "Lost sync!" if (!$match_found);
+ if (!$match_found) {
+ printdiff(scalar(@lines1), scalar(@lines2));
+ die "Lost sync!";
+ }
# Since we shouldn't get here unless the first lines of the
# buffers are different, then we must discard some lines off
@@ -220,7 +223,10 @@ sub checkmatch
# treated as common; if that bugs you, use Algorithm::Diff.
if ($lines1[$n1] eq $lines2[$n2] && $lines1[$n1+1] eq $lines2[$n2+1]) {
printdiff($n1, $n2);
+ return 1;
}
+
+ return 0;
}
sub simple_diff
@@ -240,6 +246,8 @@ sub simple_diff
return if checkmatch($cnt, $n);
}
}
+
+ printdiff(scalar(@lines1), scalar(@lines2));
die "Lost sync!";
}