diff --git a/.gitattributes b/.gitattributes index 7dac0ee908fc4f4db2092b76910b5425405d5b7b..65c86d79637fc7cd36b5d5e95538c5cccaed6cd8 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 0000000000000000000000000000000000000000..72c0299fbb4e6a68c82847326eecba615e0975f2 --- /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 +