]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
GDB server: fix tests following recent commits.
authorJulian Seward <jseward@acm.org>
Mon, 4 Jul 2011 22:00:41 +0000 (22:00 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 4 Jul 2011 22:00:41 +0000 (22:00 +0000)
Fixes #276987.  (Philippe Waroquiers, philippe.waroquiers@skynet.be)

* make_local_links
  - disable gdb tests if gdb version < 7
  - disable pic tests if gdb version < 7.1
* nlfork_chain test
  - reduce chain from 20 to 15 to avoid ENOMEM
    on small ARM systems
* main_pic.c
  - put break at line 11 rather than main entry, as ARM gdb
     does not properly show main args till it has started executing.
* passsigalrm.c
  - do not setsa.sa_restorer (obsolete on linux, unknown on darwin)
* mcvabits.vgtest
  - make prereq consistent with other tests
* filter_gdb
  - upgraded filter to new linenr in clean_after_fork.c

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11853

gdbserver_tests/filter_gdb
gdbserver_tests/fork_chain.c
gdbserver_tests/make_local_links
gdbserver_tests/mcmain_pic.stdinB.gdb
gdbserver_tests/mcmain_pic.stdout.exp
gdbserver_tests/mcmain_pic.stdoutB.exp
gdbserver_tests/mcmain_pic.vgtest
gdbserver_tests/mcvabits.vgtest
gdbserver_tests/nlfork_chain.stderr.exp
gdbserver_tests/nlfork_chain.stdout.exp
gdbserver_tests/passsigalrm.c

index 3828ebb37a11d89c77922f0c56bd7eda358cbb0c..0078ac5713b627bef912c64914b078d6a38e0f75 100755 (executable)
@@ -88,7 +88,7 @@ sed -e '/Remote debugging using/,/vgdb launched process attached/d'
     -e 's/\(Could not write register \)".*"/\1 "xxx"/'                                                \
     -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 \(main () at clean_after_fork.c:34\)/\1/'                                     \
     -e 's/\(^.*signal SIGFPE.*$\)/\1\nafter trap SIGFPE/'                                             \
     -e '/Id   Target Id         Frame/d'                                                              \
     -e 's/^\([ \*] [1234] \) *Thread /\1Thread /'                                                     \
index ae40f6e88d672a2fa959e3ab5127f7da078a2980..b5d60f0931633953905f022da99dbe4d1108fbb5 100644 (file)
@@ -32,6 +32,6 @@ void fork_chain(int level)
 }
 int main()
 {
-   fork_chain (20);
+   fork_chain (15);
    return 0;
 }
index 7fbdd3352d065c6359d1145b408131c77293fa9f..30d723120018d6e159c576a3e38eb4f8b98e4c51 100755 (executable)
@@ -18,30 +18,35 @@ then
    VERSION=`echo $VERSIONLINE                         |
             sed -e 's/[^0-9\.]//g' -e 's/\./ /g'`
    
-   # We need at least a 6.5 version to run any gdb test
+   # We need at least a 6.5 version to use the Valgrind gdbserver.
+   # However, the tests are only supported/maintained for gdb >= 7
    VERSIONOK=`echo $VERSION |
-              awk '{ if ( ($1 >= 7) || (($1 == 6) && ($2 >= 5)) ) print "version ok"}'`
+              awk '{ if ($1 >= 7) print "version ok"}'`
    if [ "$VERSIONOK" = "" ]
    then
       echo "gdbserver tests suppressed as $1 version is < 6.5: " $VERSIONLINE
       rm -f gdbserver_tests/gdb
    fi
 
-   # We need at least a 7.1 version on ARM to run tests doing step/next/...
+   # We need at least a 7.1 version to run the 'pic' executable test
+   # (with 7.0, it fails on many platforms)
+   # On ARM, we need at least 7.1 to run the 'next/step/...' tests.
    # (gdb 7.0 has bugs in the 'guess next pc' heuristic in thumb mode).
-   if tests/arch_test arm
+   VERSIONOK=`echo $VERSION |
+              awk '{ if ( ($1 >= 8) || (($1 == 7) && ($2 >= 1)) ) print "version ok"}'`
+   # By default, consider step/next/... tests are ok. We will remove for ARM if needed.
+   touch gdbserver_tests/gdb.step
+   if [ "$VERSIONOK" = "" ]
    then
-      VERSIONOK=`echo $VERSION |
-                 awk '{ if ( ($1 >= 8) || (($1 == 7) && ($2 >= 1)) ) print "version ok"}'`
-      if [ "$VERSIONOK" = "" ]
+      echo "gdbserver 'pic' tests suppressed as $1 version is < 7.1: " $VERSIONLINE
+      rm -f gdbserver_tests/gdb.pic
+      if tests/arch_test arm
       then
-          echo "gdbserver 'step/next' tests suppressed as arm $1 version is < 7.1: " $VERSIONLINE
+         echo "gdbserver 'step/next' tests suppressed as arm $1 version is < 7.1: " $VERSIONLINE
          rm -f gdbserver_tests/gdb.step
-      else
-         touch gdbserver_tests/gdb.step
       fi
    else
-      touch gdbserver_tests/gdb.step
+      touch gdbserver_tests/gdb.pic
    fi
 
    # We need at least a 7.2 version for gdb tests using eval command
index baa64fc739a7d6946051eb2150fa18500f6dbabc..46e19f982a67f49983547d673b41cbe4e1c2529d 100644 (file)
@@ -4,7 +4,7 @@ echo vgdb launched process attached\n
 monitor v.set vgdb-error 999999
 #
 # break
-break main
+break main_pic.c:11
 #
 continue
 # first break encountered.
index b20748433e7bf374ae1dbf420567e55696858255..591c8050964c1090c681cf3767970e5ecc1babc4 100644 (file)
@@ -1,4 +1,4 @@
-another func called msg called from gdb
 address of main 0x........
+another func called msg called from gdb
 address of another_func 0x........
 another func called msg called from main
index 4bb0a692665d529e54c1ea75166c83cca2daadcb..a548a666f3b72547c079ea22381892fd0d20af4f 100644 (file)
@@ -1,7 +1,7 @@
-Breakpoint 1 at 0x........: file main_pic.c, line 10.
+Breakpoint 1 at 0x........: file main_pic.c, line 11.
 Continuing.
-Breakpoint 1, main (argc=1, argv=0x........) at main_pic.c:10
-10        printf("address of main %p\n", &main);
+Breakpoint 1, main (argc=1, argv=0x........) at main_pic.c:11
+11        printf("address of another_func %p\n", &another_func);
 $1 = void
 $2 = (int (*)(int, char **)) 0x........ <main>
 $3 = (void (*)(char *)) 0x........ <another_func>
index 80ea6109f095805538e29af1e1c0ad31f9e0fffa..1fab67f66c459f8eb2d1ae12ed4c253e34a44d86 100644 (file)
@@ -3,7 +3,7 @@
 # information via the gdbserver protocol packet qXfer:auxv:read:
 # The content of the auxv data can be shown by gdb using
 # gdb command 'info auxv'
-prereq: test -e gdb
+prereq: test -e gdb.pic
 prog: main_pic
 vgopts: --tool=memcheck --vgdb=yes --vgdb-error=0 --vgdb-prefix=./vgdb-prefix-mcmain_pic
 stdout_filter: filter_gdb
index 48b35e8a3ab9d09825e662fd7b7f4160b0166fc4..9ef834f1c61910335c85caaf0cedb4079006062f 100644 (file)
@@ -4,7 +4,7 @@ prog: t
 vgopts: --tool=memcheck --vgdb=yes --vgdb-error=0 --vgdb-prefix=./vgdb-prefix-mcvabits
 stdout_filter: filter_make_empty
 stderr_filter: filter_make_empty
-prereq: test -e ./gdb.eval
+prereq: test -e gdb.eval
 progB: gdb
 argsB: --quiet -l 60 --nx ./t
 stdinB: mcvabits.stdinB.gdb
index a0eeaba7108091e26bdcd4d226884c60b4e24fd0..8480949f99f8245be432dfb5981f8ae24fb50c55 100644 (file)
@@ -14,11 +14,6 @@ Nulgrind, the minimal Valgrind tool
 
 
 
-
-
-
-
-
 
 
 
index a263b7e628752476d4545bb89c2745b53cb64945..1a425f37b4530cf076ef6e111dc46f4ed048067f 100644 (file)
@@ -1,8 +1,3 @@
-forking level 20
-forking level 19
-forking level 18
-forking level 17
-forking level 16
 forking level 15
 forking level 14
 forking level 13
index c6f1fb52c77ec8f2fe98bbb7e7b20b7c2c7c1891..a625eb6910a6b08dc1e4cd00c92f51157eb0b73e 100644 (file)
@@ -15,7 +15,7 @@ int main (int argc, char *argv[])
    sa.sa_handler = sigalrm_handler;
    sigemptyset(&sa.sa_mask);
    sa.sa_flags = 0;
-   sa.sa_restorer = NULL;
+
    if (sigaction (SIGALRM, &sa, NULL) != 0)
       perror("sigaction");
    if (kill(getpid(), SIGALRM) != 0)