]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
More gdbserver test fixes, from #214909 c 101:
authorJulian Seward <jseward@acm.org>
Tue, 31 May 2011 07:09:06 +0000 (07:09 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 31 May 2011 07:09:06 +0000 (07:09 +0000)
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

gdbserver_tests/filter_gdb
gdbserver_tests/mcinfcallRU.stdinB.gdb
gdbserver_tests/mcinfcallWSRU.stdinB.gdb
gdbserver_tests/mcsignopass.stdoutB.exp
gdbserver_tests/mcsigpass.stdinB.gdb
gdbserver_tests/mcsigpass.stdoutB.exp
gdbserver_tests/nlcontrolc.stdinB.gdb
gdbserver_tests/nlcontrolc.stdoutB.exp
gdbserver_tests/simulate_control_c

index bb7b0eebeaca175b6cec5a7c5ef8c39882479a44..6439489e8c919870bff2937b0eb122d272d2546a 100755 (executable)
@@ -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' 
 
index 7ca7290a938df89e91961dd34b41fb15f7185864..32bd61a14468ccd53ec23ca54974b3745cb5c3e0 100644 (file)
@@ -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
index 4ccbcdccf49f22d49381fc8a7d8e8a23bfbb3df4..fdedd8a1667a53d42989db68167c54ee09aa8be1 100644 (file)
@@ -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
 #
index 06c00cab1a7854f8878d95d122a46f0650230693..e3499411bb31e73c028c14947d1867131a9ea5a9 100644 (file)
@@ -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.
index 0e1799a5e0468c5803040dd1583e86b9766b3558..dcc389e25f56d63ab3a274ffa09d9f5d6fb798d3 100644 (file)
@@ -20,6 +20,7 @@ continue
 #
 # SIGFPE  : line 114
 continue
+echo after continue SIGFPE
 #
 # program will exit
 quit
index c7723dc325d1bea44e55a9e4e6c73b270ec040cd..4c2d799706e673a41ead5145d5fddd44ea5fd9f8 100644 (file)
@@ -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.
index 9fc513286f6539acc46db9573d4093e3bd23fc24..3ec07984e5e16e87ef7613a92b8cc9c4486bf989 100644 (file)
@@ -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
index 90d6d3c79ba74b9890ecd6071bd798dce0f6587f..fa1c73d0dc656d5d6a8d6f1d605c8b58462a726b 100644 (file)
@@ -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
index cea1e5963575ae498be6a452f698f89ee3e346e2..913eaa9dafe0bcb70c80f4a664887ba1e38e8222 100755 (executable)
@@ -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) &