3 # (must be called from the valgrind top source dir).
5 # Make local links in the gdbserver_tests directory
6 # so that tests needing gdb can be disabled if
7 # a tool old version of gdb is provided or if no gdb is
10 # The vgdb link is needed either for gdb tests
11 # or for standalone vgdb tests.
15 ln -f -s "$1" gdbserver_tests/gdb
16 # Try to extract the gdb version.
17 VERSIONLINE=`gdbserver_tests/gdb --version | head -n 1`
18 VERSION=`echo $VERSIONLINE |
19 sed -e 's/[^0-9\.]//g' -e 's/\./ /g'`
21 # We need at least a 6.5 version to run any gdb test
22 VERSIONOK=`echo $VERSION |
23 awk '{ if ( ($1 >= 7) || (($1 == 6) && ($2 >= 5)) ) print "version ok"}'`
24 if [ "$VERSIONOK" = "" ]
26 echo "gdbserver tests suppressed as $1 version is not >= 6.5: " $VERSIONLINE
27 rm gdbserver_tests/gdb
30 # We need at least a 7.2 version for gdb tests using eval command
31 VERSIONOK=`echo $VERSION |
32 awk '{ if ( ($1 >= 8) || (($1 == 7) && ($2 >= 2)) ) print "version ok"}'`
33 if [ "$VERSIONOK" = "" ]
35 echo "gdbserver eval tests suppressed as $1 version is not >= 7.2: " $VERSIONLINE
36 rm -f gdbserver_tests/gdb.eval
38 touch gdbserver_tests/gdb.eval
41 echo "gdbserver gdb tests suppressed as $1 is not executable"
44 ln -f -s ../coregrind/vgdb gdbserver_tests/vgdb
46 # if ptrace not implemented in vgdb or OS restricts the initial attach,
47 # some tests would block for a loooonnnng time.
48 if gdbserver_tests/vgdb --help 2>&1 |
49 grep -e 'ptrace invoker not implemented' \
50 -e 'kernel restricts ptrace invoker' > /dev/null
52 rm -f gdbserver_tests/vgdb.ptraceinvoker
54 touch gdbserver_tests/vgdb.ptraceinvoker
57 # cleanup the possibly big garbage previously collected output
58 rm -f gdbserver_tests/garbage.filtered.out