# which registers can't be modified
# special transform for arm/ppc watchpoints which have an additional address
# at the beginning
-# special transform for backtrace of arm or ppc division by zero which gives
-# a location in the nptl lib rather than our sources (same as
-# standard gdb gdbserver) gdb 7.0
-# same special transform but for gdb 7.2
+# SIGFPE backtrace is varying so much that we just remove all lines
+# after the signal trapping using an expr in this sed, followed by another sed.
# transform info thread of 7.3 into the layout of 7.2 and before.
# delete lines telling that some memory can't be accessed: this is
# a.o. produced by gdb 7.2 on arm (same with standard gdbserver)
-e 's/\(ERROR changing register \).*$/\1 xxx regno y/' \
-e 's/0x........ in \(main (argc=1, argv=0x........) at watchpoints.c:[24][3689]\)/\1/' \
-e 's/0x........ in \(main () at clean_after_fork.c:32\)/\1/' \
- -e 's/^0x........ in \*__GI_raise (sig=8).*/0x........ in test4 () at faultstatus.c:120\n120 volatile int v = 44\/zero();/' \
- -e 's/^0x........ in raise (.*/0x........ in test4 () at faultstatus.c:120\n120 volatile int v = 44\/zero();/' \
- -e '/ at ..\/nptl\/sysdeps\/unix\/sysv\/linux\/raise.c:[0-9]*/d' \
- -e '/ in ..\/nptl\/sysdeps\/unix\/sysv\/linux\/.*raise.c/d' \
- -e 's/^0x........ in \.\{0,1\}raise () from \/lib[0-9]\{0,2\}\/libc\.so\../0x........ in test4 () at faultstatus.c:120\n120 volatile int v = 44\/zero();'/ \
+ -e 's/\(^.*signal SIGFPE.*$\)/\1\nafter trap SIGFPE/' \
-e '/Id Target Id Frame/d' \
-e 's/^\([ \*] [1234] \) *Thread /\1Thread /' \
-e 's/VgTs_WaitSys) 0x/VgTs_WaitSys) 0x/' \
-e '/Cannot access memory at address 0x......../d' \
- -e '/^$/d' |
+ -e '/^$/d' |
+
+# remove all the lines telling where the SIGFPE was trapped.
+sed -e '/after trap SIGFPE/,/after continue SIGFPE/d' |
# join together two lines that gdb 7.1 splits in two (???)
# (in a separate sed, as the below influences the behaviour of the other expressions)
-sed -e :a -e '$!N;s/\n at sleepers.c:39/ at sleepers.c:39/;ta' -e 'P;D'
+sed -e :a -e '$!N;s/\n at sleepers.c:39/ at sleepers.c:39/;ta' -e 'P;D'
echo vgdb launched process attached\n
monitor vg.set vgdb-error 999999
#
-# We will interrupt in a few seconds (be sure all tasks are in
-# Runnable/Yielding state). We need to wait enough seconds to be sure
-# Valgrind has started to execute the threads.
-# On a heavily loaded slow arm gcc compile farm system, 5 seconds
-# was not enough.
-shell ./simulate_control_c --vgdb-prefix=./vgdb-prefix-mcinfcallRU 10
+# We will interrupt in a few seconds (be sure the main task is ready).
+# Once it is ready, we still have to wait to be sure it is running.
+shell ./simulate_control_c --vgdb-prefix=./vgdb-prefix-mcinfcallRU 1 grep main mcinfcallRU.stderr.out
#
continue
info threads
# Here the 4 threads have been started.
# We will interrupt in a few seconds (be sure all tasks are in Runnable/Yielding state
# or in WaitSys state.
-shell ./simulate_control_c --vgdb-prefix=./vgdb-prefix-mcinfcallWSRU 10
+shell ./simulate_control_c --vgdb-prefix=./vgdb-prefix-mcinfcallWSRU 1 grep main mcinfcallWSRU.stderr.out
#
continue
#
115 mapping[FILESIZE+10];
Continuing.
Program received signal SIGFPE, Arithmetic exception.
-0x........ in test4 () at faultstatus.c:120
-120 volatile int v = 44/zero();
-Continuing.
#
# SIGFPE : line 114
continue
+echo after continue SIGFPE
#
# program will exit
quit
115 mapping[FILESIZE+10];
Continuing.
Program received signal SIGFPE, Arithmetic exception.
-0x........ in test4 () at faultstatus.c:120
-120 volatile int v = 44/zero();
-Continuing.
#
#
# simulate control-c in a few seconds
-shell ./simulate_control_c --vgdb-prefix=./vgdb-prefix-nlcontrolc 10
+shell ./simulate_control_c --vgdb-prefix=./vgdb-prefix-nlcontrolc 1 grep main nlcontrolc.stderr.out
#
continue
#
p t[3].tv_sec = 0
#
# We will change the burning parameters in a few seconds
-shell ./simulate_control_c --vgdb-prefix=./vgdb-prefix-nlcontrolc 10
+shell ./simulate_control_c --vgdb-prefix=./vgdb-prefix-nlcontrolc 1 grep changed nlcontrolc.stdoutB.out
#
+echo changed burning parameters\n
continue
#
# Threads are burning cpu now
$2 = 0
$3 = 0
$4 = 0
+changed burning parameters
Continuing.
Program received signal SIGTRAP, Trace/breakpoint trap.
0x........ in do_burn () at sleepers.c:39
#! /bin/sh
# simulate control_c by sending SIGUSR1 to the vgdb using prefix $1 in $2 seconds
-VGDBPID=`./vgdb -D $1 2>&1 | awk '/vgdb pid/ {print $3}'`
+# 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 " $1
+ echo "simulate_control_c could not determine the vgdb pid with " $PREFIX
exit 1
fi
-(sleep $2; kill -10 $VGDBPID) &
-
+(while ! $GUARDCMD >> garbage.filtered.out 2>&1
+ do
+ sleep 1
+ done
+ sleep $SLEEP
+ kill -10 $VGDBPID) &