Skip to content
Snippets Groups Projects
Commit 0db91ca1 authored by bdr7fv's avatar bdr7fv
Browse files

cover.sh no longer adds functions to the blacklist based on coverage. Instead...

cover.sh no longer adds functions to the blacklist based on coverage. Instead it is left to PN to make the decision on how to transform. 



Former-commit-id: 20ab31bce6f2fbce67a47f6716875cfc321cd7f5
parent 64a75275
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,23 @@ OUTPUT_BLACKLIST_FILE=$6 # output file with list of functions to blacklis
CANDIDATE_FNS_PRE_LIBC=`dirname $6`/p1.candidates.prelibc
$SECURITY_TRANSFORMS_HOME/tools/cover/cover $ORIGINAL_BINARY $ANNOTATION_FILE $EXECUTED_ADDRESS_FILE $OUTPUT_COVERAGE_FILE
status=$?
cp $FILTER_FILE $OUTPUT_BLACKLIST_FILE
cat $OUTPUT_COVERAGE_FILE | cut -f1 -d" " > $CANDIDATE_FNS_PRE_LIBC
if [ ! $status -eq 0 ]; then
# cp $FILTER_FILE $OUTPUT_BLACKLIST_FILE
return 1
fi
return 0
#below is a relic from when PN could not take ina coverage file, it is left here
#as it is uncertain as to whether we do want to filter functions at this level
#in this scenario yet.
#
# Prune out functions that do not have sufficient coverage
# Any function whose coverage metric starts with 0.0, e.g. 0.09, 0.0123, is pruned out
......@@ -23,25 +40,20 @@ CANDIDATE_FNS_PRE_LIBC=`dirname $6`/p1.candidates.prelibc
# Yes, this is a hack... but it will do for now until we get a more sophisticated definition of coverage
#
$SECURITY_TRANSFORMS_HOME/tools/cover/cover $ORIGINAL_BINARY $ANNOTATION_FILE $EXECUTED_ADDRESS_FILE $OUTPUT_COVERAGE_FILE
if [ ! $? -eq 0 ]; then
cp $FILTER_FILE $OUTPUT_BLACKLIST_FILE
return 1
fi
if [ ! -f $OUTPUT_COVERAGE_FILE ]; then
cp $FILTER_FILE $OUTPUT_BLACKLIST_FILE
return 1
fi
#if [ ! -f $OUTPUT_COVERAGE_FILE ]; then
# cp $FILTER_FILE $OUTPUT_BLACKLIST_FILE
# return 1
#fi
grep -v "0\.000" $OUTPUT_COVERAGE_FILE | cut -f1 -d" " > $CANDIDATE_FNS_PRE_LIBC
grep "0\.000" $OUTPUT_COVERAGE_FILE | cut -f1 -d" " > $OUTPUT_BLACKLIST_FILE
#cat $OUTPUT_COVERAGE_FILE | cut -f1 -d" ">$CANDIDATE_FNS_PRE_LIBC
#grep -v "0\.000" $OUTPUT_COVERAGE_FILE | cut -f1 -d" " > $CANDIDATE_FNS_PRE_LIBC
#grep "0\.000" $OUTPUT_COVERAGE_FILE | cut -f1 -d" " > $OUTPUT_BLACKLIST_FILE
# Filter out functions that:
# 1. are not sufficiently covered
# 2. are libc function
cat $FILTER_FILE >> $OUTPUT_BLACKLIST_FILE
sort $OUTPUT_BLACKLIST_FILE | uniq > tmp.$$
mv tmp.$$ $OUTPUT_BLACKLIST_FILE
#cat $FILTER_FILE >> $OUTPUT_BLACKLIST_FILE
#sort $OUTPUT_BLACKLIST_FILE | uniq > tmp.$$
#mv tmp.$$ $OUTPUT_BLACKLIST_FILE
return 0
#return 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment