|
|
|
@ -3,9 +3,7 @@ |
|
|
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|
|
|
# |
|
|
|
# Filename: src/tools-source/fl_wrapper_test.sh |
|
|
|
# Copyright (C) 2006 The OpenSDE Project |
|
|
|
# Copyright (C) 2004 - 2006 The T2 SDE Project |
|
|
|
# Copyright (C) 1998 - 2003 Clifford Wolf |
|
|
|
# Copyright (C) 2010 The OpenSDE Project |
|
|
|
# |
|
|
|
# More information can be found in the files COPYING and README. |
|
|
|
# |
|
|
|
@ -15,19 +13,21 @@ |
|
|
|
# GNU General Public License can be found in the file COPYING. |
|
|
|
# --- SDE-COPYRIGHT-NOTE-END --- |
|
|
|
|
|
|
|
for x in exec{l,v}{,p,e} ; do |
|
|
|
touch fltest_$x ; done |
|
|
|
|
|
|
|
bash src/tools-source/fl_wrapper.c.sh > fl_wrapper.c |
|
|
|
gcc -O2 -shared -fPIC -Wall -ldl fl_wrapper.c -o fl_wrapper.so |
|
|
|
|
|
|
|
echo -n > rlog.txt |
|
|
|
echo -n > wlog.txt |
|
|
|
|
|
|
|
if [ "$1" = "gdb" ]; then |
|
|
|
shift |
|
|
|
cat > fltest.gdb <<-EOT |
|
|
|
set env LD_PRELOAD ./fl_wrapper.so |
|
|
|
set env FLWRAPPER_RLOG rlog.txt |
|
|
|
set env FLWRAPPER_WLOG wlog.txt |
|
|
|
EOT |
|
|
|
|
|
|
|
exec gdb -x fltest.gdb ./fltest |
|
|
|
fi |
|
|
|
|
|
|
|
export FLWRAPPER_RLOG=rlog.txt |
|
|
|
export FLWRAPPER_WLOG=wlog.txt |
|
|
|
|
|
|
|
gcc src/tools-source/fl_wrapper_test.c -o fltest_bin |
|
|
|
LD_PRELOAD=./fl_wrapper.so ./fltest_bin |
|
|
|
|
|
|
|
#rm fltest_* fl_wrapper.so |
|
|
|
LD_PRELOAD=./fl_wrapper.so ./fltest |