drd/tests/tsan_unittest: Avoid that this test reads from uninitialized memory
[valgrind.git] / gdbserver_tests / send_signal
blob0657a7a6c77f89eb68b7a78eacf303816c0831dd
1 #! /bin/sh
3 # send_signal sends signal $1 to the Valgrind process using prefix $2 in $3 seconds
4 # If there are some args after $3, the rest of these args is a command and its arg
5 # which is run every second. When this command is successful, then the sleep and
6 # the signal sending is done
7 SIG=$1
8 shift
9 PREFIX=$1
10 shift
11 SLEEP=$1
12 shift
13 GUARDCMD="$@"
14 if [ "$GUARDCMD" = "" ]
15 then
16 GUARDCMD="true"
18 VPID=`./vgdb -l $PREFIX 2>&1 | awk '{print $2}' | sed -e 's/--pid=//'`
19 if [ "$VPID" = "" ]
20 then
21 echo "send_signal could not determine the valgrind pid with " $PREFIX
22 exit 1
24 (while ! $GUARDCMD >> garbage.filtered.out 2>&1
26 sleep 1
27 done
28 sleep $SLEEP
29 echo sending signal
30 kill -s $SIG $VPID) &