From 8312c92dcd8b377e2c2504333271a7ac39c004a7 Mon Sep 17 00:00:00 2001
From: an7s <an7s@git.zephyr-software.com>
Date: Mon, 21 Mar 2011 20:42:11 +0000
Subject: [PATCH] backup

---
 .gitattributes                |  1 +
 tools/generate_io_baseline.sh | 28 ++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+)
 create mode 100755 tools/generate_io_baseline.sh

diff --git a/.gitattributes b/.gitattributes
index 7dac0ee90..65c86d796 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -44,6 +44,7 @@ examples/print_ptr.c -text
 examples/recover_example.c -text
 tools/do_concolic.sh -text
 tools/generate_exe.sh -text
+tools/generate_io_baseline.sh -text
 tools/getsyms.sh -text
 tools/p1xform.doxform.sh -text
 tools/p1xform.pbed.sh -text
diff --git a/tools/generate_io_baseline.sh b/tools/generate_io_baseline.sh
new file mode 100755
index 000000000..72c0299fb
--- /dev/null
+++ b/tools/generate_io_baseline.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# $1 is the top-level directory
+# $2 is the binary (non-stratafied)
+# $3 is the directory that contains the inputs
+
+
+TOP_DIR=$1
+BINARY=`basename $2`
+INPUT_DIR=$3
+BASELINE_OUTPUT_DIR=replay.baseline
+
+echo "=========================================================================="
+echo "Running replayer to get baseline outputs on binary: $TOP_DIR/$BINARY"
+echo "                                   Input directory: $INPUT_DIR"
+echo "                                  Output directory: $BASELINE_OUTPUT_DIR"
+echo "=========================================================================="
+cd $TOP_DIR
+
+mkdir $BASELINE_OUTPUT_DIR
+
+for i in `ls $INPUT_DIR/input*.json`
+do
+  # format input file is:  input_0001.json
+  input=`basename $i .json`
+  $GRACE_HOME/concolic/bin/replayer --stdout=$BASELINE_OUTPUT_DIR/stdout.$input --stderr=$BASELINE_OUTPUT_DIR/stderr.$input --engine=ptrace ./$BINARY $i
+done
+
-- 
GitLab