1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-02-23 15:45:00 +02:00
Files
coreutils/README-valgrind

49 lines
1.7 KiB
Plaintext
Raw Normal View History

2002-11-30 16:34:20 +00:00
#! /bin/bash
# Convert this package for use with valgrind.
# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
2002-11-30 16:17:29 +00:00
2002-11-30 16:34:20 +00:00
# Convert Makefile.am files:
2003-07-27 10:01:55 +00:00
# find tests -name Makefile.am | xargs grep -wl PATH|xargs perl -pi -e \
# 's,src(\$\(PATH_SEPARATOR\)\$\$PATH),src/vg$1,'
2004-03-22 20:40:03 +00:00
# To restore:
# find tests -name Makefile.am|xargs grep -wl PATH|xargs perl -pi -e 's,src/vg,src,'
2003-11-17 13:46:34 +00:00
#
# Create this symlink for suppressions (this is no longer necessary,
# with linux-2.6.9 and valgrind-2.2.0):
2003-11-17 13:46:34 +00:00
# ln -s $PWD/.vg-suppressions /tmp/cu-vg
2002-11-30 16:34:20 +00:00
# Create src/vg:
2002-11-30 17:13:33 +00:00
coreutils=$(echo 'spy:;@echo $(all_programs)' | (cd src; make -f Makefile -f - spy | tr -s '\n ' ' '))
2003-07-27 10:02:16 +00:00
mkdir -p src/vg
2002-11-30 16:17:29 +00:00
pwd=`pwd`
2003-07-27 10:01:55 +00:00
srcdir=$pwd/src
_path='export PATH='$srcdir':${PATH#*:}'
pre='#!/bin/sh\n'"$_path"'\n'
2005-10-03 16:13:06 +00:00
n=15
vg='exec /usr/bin/valgrind --suppressions=/tmp/cu-vg --log-fd=3 --leak-check=yes --track-fds=yes --leak-check=full --num-callers='$n
2002-11-30 17:13:33 +00:00
cat <<EOF > src/vg/gen
2002-11-30 16:34:20 +00:00
for i in $coreutils; do
printf "$pre$vg -- \$i"' "\$@"\n' > \$i
2002-11-30 17:13:33 +00:00
chmod a+x \$i
2002-11-30 16:17:29 +00:00
done
EOF
cd src/vg
2002-11-30 17:13:33 +00:00
. ./gen