ftmemsim-valgrind/gdbserver_tests/simulate_control_c
Julian Seward 62e0d0b316 More gdbserver test fixes, from #214909 c 101:
fix mcsig(no)pass on arm Ubuntu10, arm thumb internal doc, improve
simulate_control_c

* new file docs/internals/arm_thumb_notes_gdbserver.txt
  documentation about the subtilities of the thumb bit handling in gdbsrv.
* made the SIGFPE backtrace filtering less dependent on gdb/os/libc/...
* improved simulate_control_c : runs faster/less dependent on timeout value


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11791
2011-05-31 07:09:06 +00:00

28 lines
666 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 -10 $VGDBPID) &