summaryrefslogtreecommitdiff
path: root/gdbserver_tests
diff options
context:
space:
mode:
authorsewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9>2011-05-31 07:09:06 +0000
committersewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9>2011-05-31 07:09:06 +0000
commit762918075005524a8398870b4bae71787f1a4007 (patch)
tree35e0d9834b1ed0b140d2c55f2bff135ef5ef1805 /gdbserver_tests
parent452e89a9f847975609b3ad318943830f2cce841c (diff)
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 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'gdbserver_tests')
-rwxr-xr-xgdbserver_tests/filter_gdb19
-rw-r--r--gdbserver_tests/mcinfcallRU.stdinB.gdb9
-rw-r--r--gdbserver_tests/mcinfcallWSRU.stdinB.gdb2
-rw-r--r--gdbserver_tests/mcsignopass.stdoutB.exp3
-rw-r--r--gdbserver_tests/mcsigpass.stdinB.gdb1
-rw-r--r--gdbserver_tests/mcsigpass.stdoutB.exp3
-rw-r--r--gdbserver_tests/nlcontrolc.stdinB.gdb5
-rw-r--r--gdbserver_tests/nlcontrolc.stdoutB.exp1
-rwxr-xr-xgdbserver_tests/simulate_control_c24
9 files changed, 37 insertions, 30 deletions
diff --git a/gdbserver_tests/filter_gdb b/gdbserver_tests/filter_gdb
index bb7b0eeb..6439489e 100755
--- a/gdbserver_tests/filter_gdb
+++ b/gdbserver_tests/filter_gdb
@@ -42,10 +42,8 @@ $dir/filter_memcheck_monitor |
# 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)
@@ -89,18 +87,17 @@ sed -e '/Remote debugging using/,/vgdb launched process attached/d'
-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'
diff --git a/gdbserver_tests/mcinfcallRU.stdinB.gdb b/gdbserver_tests/mcinfcallRU.stdinB.gdb
index 7ca7290a..32bd61a1 100644
--- a/gdbserver_tests/mcinfcallRU.stdinB.gdb
+++ b/gdbserver_tests/mcinfcallRU.stdinB.gdb
@@ -3,12 +3,9 @@ target remote | ./vgdb --wait=60 --vgdb-prefix=./vgdb-prefix-mcinfcallRU
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
diff --git a/gdbserver_tests/mcinfcallWSRU.stdinB.gdb b/gdbserver_tests/mcinfcallWSRU.stdinB.gdb
index 4ccbcdcc..fdedd8a1 100644
--- a/gdbserver_tests/mcinfcallWSRU.stdinB.gdb
+++ b/gdbserver_tests/mcinfcallWSRU.stdinB.gdb
@@ -13,7 +13,7 @@ continue
# 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
#
diff --git a/gdbserver_tests/mcsignopass.stdoutB.exp b/gdbserver_tests/mcsignopass.stdoutB.exp
index 06c00cab..e3499411 100644
--- a/gdbserver_tests/mcsignopass.stdoutB.exp
+++ b/gdbserver_tests/mcsignopass.stdoutB.exp
@@ -57,6 +57,3 @@ Program received signal SIGBUS, Bus error.
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.
diff --git a/gdbserver_tests/mcsigpass.stdinB.gdb b/gdbserver_tests/mcsigpass.stdinB.gdb
index 0e1799a5..dcc389e2 100644
--- a/gdbserver_tests/mcsigpass.stdinB.gdb
+++ b/gdbserver_tests/mcsigpass.stdinB.gdb
@@ -20,6 +20,7 @@ continue
#
# SIGFPE : line 114
continue
+echo after continue SIGFPE
#
# program will exit
quit
diff --git a/gdbserver_tests/mcsigpass.stdoutB.exp b/gdbserver_tests/mcsigpass.stdoutB.exp
index c7723dc3..4c2d7997 100644
--- a/gdbserver_tests/mcsigpass.stdoutB.exp
+++ b/gdbserver_tests/mcsigpass.stdoutB.exp
@@ -12,6 +12,3 @@ Program received signal SIGBUS, Bus error.
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.
diff --git a/gdbserver_tests/nlcontrolc.stdinB.gdb b/gdbserver_tests/nlcontrolc.stdinB.gdb
index 9fc51328..3ec07984 100644
--- a/gdbserver_tests/nlcontrolc.stdinB.gdb
+++ b/gdbserver_tests/nlcontrolc.stdinB.gdb
@@ -5,7 +5,7 @@ monitor vg.set vgdb-error 999999
#
#
# 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
#
@@ -23,8 +23,9 @@ p t[2].tv_sec = 0
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
diff --git a/gdbserver_tests/nlcontrolc.stdoutB.exp b/gdbserver_tests/nlcontrolc.stdoutB.exp
index 90d6d3c7..fa1c73d0 100644
--- a/gdbserver_tests/nlcontrolc.stdoutB.exp
+++ b/gdbserver_tests/nlcontrolc.stdoutB.exp
@@ -12,6 +12,7 @@ $1 = 0
$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
diff --git a/gdbserver_tests/simulate_control_c b/gdbserver_tests/simulate_control_c
index cea1e596..913eaa9d 100755
--- a/gdbserver_tests/simulate_control_c
+++ b/gdbserver_tests/simulate_control_c
@@ -1,11 +1,27 @@
#! /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) &