diff --git a/.gitattributes b/.gitattributes index 83716642c2032729924d14e8945a5e172f467039..2ae02134e6e77a8354957a5888d8a58238287934 100644 --- a/.gitattributes +++ b/.gitattributes @@ -18,6 +18,7 @@ c++_examples/newdelete4.cpp -text c++_examples/newdelete5.cpp -text c++_examples/newdelete6.cpp -text c++_examples/simple_throw.cpp -text +c++_examples/testit.sh -text c++_examples/throw.cpp -text cgc_spri/Makefile -text cgc_spri/spawn_with_spri_open.c -text diff --git a/c++_examples/testit.sh b/c++_examples/testit.sh new file mode 100755 index 0000000000000000000000000000000000000000..84043898af421440c7f695719f5e140980f5295c --- /dev/null +++ b/c++_examples/testit.sh @@ -0,0 +1,41 @@ +#!/bin/bash + + +compare() +{ + env $1 ./a.out > good.txt 2>&1 + env $1 ./xxx > xform.txt 2>&1 + + cmp good.txt xform.txt > /dev/null 2>&1 + + if [ $? != 0 ]; then + echo "Failed test: $1"; + diff good.txt xform.txt + exit 2 + fi +} + +src_files="simple_throw.cpp throw.cpp" +options="-Os -O0 -O1 -O2 -O3" +throws="THROW_INT THROW_CHAR THROW_FLOAT" + +for src in $src_files +do + echo "Trying $src" + + for option in $options + do + echo "With $option" + g++ $option $src + rm -Rf peasoup_executable_direc* + EHIR_VERBOSE=1 $PSZ ./a.out ./xxx --step-option fill_in_indtargs:--split-eh-frame --step-option zipr:'--add-sections true' + + compare + + for throw in $throws + do + compare $throw=1 + done + + done +done diff --git a/tools/db/pdb.createprogram.tbl b/tools/db/pdb.createprogram.tbl index 98d2de1d906d247853037d3e79aa11456ff45608..afa1d7cf6dae2ed7010fbfd10856e89c5a298076 100644 --- a/tools/db/pdb.createprogram.tbl +++ b/tools/db/pdb.createprogram.tbl @@ -120,5 +120,6 @@ CREATE TABLE #EHCS# ( ehcs_id integer, -- id of this object. tt_encoding integer, -- the encoding of the type table. + has_cleanup integer, -- whether this callsite has cleanups, even if the type table is empty. lp_insn_id integer -- the landing pad instruction's id. ); diff --git a/tools/eh_frame_tools/eh_to_bin.sh b/tools/eh_frame_tools/eh_to_bin.sh old mode 100644 new mode 100755 index e8ec91e18b3d77addf1cf0895270491399460501..054b4b728dbdbec7c9ace877c646dad1384a4b13 --- a/tools/eh_frame_tools/eh_to_bin.sh +++ b/tools/eh_frame_tools/eh_to_bin.sh @@ -4,7 +4,7 @@ infile=$1 addr=$2 outfile=$3 -gcc $infile -nostdlib -Wl,--section-start -Wl,eh_frame_hdr=$addr -Wl,-e -Wl,0x1000 -Wl,--build-id=none -Wl,-T -Wl,${PEASOUP_HOME}/tools/eh_frame_tools/eh_frame.ls -o $outfile || exit +gcc $infile -nostdlib -Wl,--section-start -Wl,eh_frame_hdr=$addr -Wl,-e -Wl,0x1000 -Wl,--build-id=none -Wl,-T -Wl,${PEASOUP_HOME}/tools/eh_frame_tools/eh_frame.ls -o $outfile -Wl,-Map,$outfile.map || exit #eu-readelf -S ./a.out objcopy --rename-section eh_frame_hdr=.eh_frame_hdr --rename-section eh_frame=.eh_frame --rename-section gcc_except_table=.gcc_except_table $outfile #eu-readelf -S -w ./b.out