ftmemsim-valgrind/gdbserver_tests/simulate_control_c
Philippe Waroquiers 63c4b7e167 Use -s USR1 instead of -10 to send SIGUSR1 signal
On mips32, 10 is SIGBUS. This was making all tests using
simulate_control_c looping for ever or a long time.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12873
2012-08-15 13:27:23 +00:00

28 lines
670 B
Bash
Executable File

#! /bin/sh
# simulate control_c by sending SIGUSR1 to the vgdb using prefix $1 in $2 seconds
# If there are some args after $2, the rest of these args is a command and its arg
# which is run every second. When this command is succesful, then the sleep and
# the control c simul is done.
PREFIX=$1
shift
SLEEP=$1
shift
GUARDCMD="$@"
if [ "$GUARDCMD" = "" ]
then
GUARDCMD="true"
fi
VGDBPID=`./vgdb -D $PREFIX 2>&1 | awk '/vgdb pid/ {print $3}'`
if [ "$VGDBPID" = "" ]
then
echo "simulate_control_c could not determine the vgdb pid with " $PREFIX
exit 1
fi
(while ! $GUARDCMD >> garbage.filtered.out 2>&1
do
sleep 1
done
sleep $SLEEP
kill -s USR1 $VGDBPID) &