Commit a7cba5d1 authored by Andrea Gussoni's avatar Andrea Gussoni
Browse files

Add revng decompilation driver

parent fedab41c
#!/bin/bash
basepath=$(pwd)
arch=$1
workdir=$basepath/workdir-$arch
timing_dir=$workdir/timings
revng_lifted_dir=$workdir/revng-isolated
revng_source_dir=$workdir/revng-sources
revng_decompilation_dir=$workdir/revng-decompilation-info
metrics_dir=$workdir/revng-metrics
if [ ! -d $metrics_dir ]; then
mkdir $metrics_dir;
fi
# Blank the outcome file
echo > $revng_decompilation_dir/outcome.txt
if [ ! -d $timing_dir ]; then
mkdir -p $timing_dir;
fi
if [ ! -d $revng_source_dir ]; then
mkdir -p $revng_source_dir;
fi
if [ ! -d $revng_decompilation_dir ]; then
mkdir -p $revng_decompilation_dir;
fi
cd $arch
for filename in *
do
echo "Decompiling input: $filename"
metrics_subdir1=$metrics_dir/$filename/duplication/
if [ ! -d $metrics_subdir1 ]; then
mkdir -p $metrics_subdir1;
fi
metrics_subdir2=$metrics_dir/$filename/short-circuit/
if [ ! -d $metrics_subdir2 ]; then
mkdir -p $metrics_subdir2;
fi
(/usr/bin/time --format="%S,%U,%e,%M" -o "$timing_dir/$filename.revng.decompilation.time" revng opt -decompilation --decompiled-dir=$revng_source_dir/$filename --restructure-metrics-output-dir=$metrics_subdir1/ --short-circuit-metrics-output-dir=$metrics_subdir2/ -o /dev/null $revng_lifted_dir/$filename.ll.isolated.purged.sroa|& tee $revng_decompilation_dir/$filename-raw-log.txt)
ret_value=$?
if [ $ret_value -eq 0 ]; then
echo "OK"
echo "$filename OK" >> $revng_decompilation_dir/outcome.txt
else
echo "ERROR"
echo "$filename ERROR" >> $revng_decompilation_dir/outcome.txt
fi
done;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment