]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/valgrind/src/valgrind-3.6.0-svn/gdbserver_tests/make_local_links
update
[l4.git] / l4 / pkg / valgrind / src / valgrind-3.6.0-svn / gdbserver_tests / make_local_links
1 #! /bin/sh
2
3 # (must be called from the valgrind top source dir).
4 #
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
8 # provided.
9 #
10 # The vgdb link is needed either for gdb tests
11 # or for standalone vgdb tests.
12
13 if [ -x "$1" ]
14 then
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'`
20    
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" = "" ]
25    then
26       echo "gdbserver tests suppressed as $1 version is not >= 6.5: " $VERSIONLINE
27       rm gdbserver_tests/gdb
28    fi
29
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" = "" ]
34    then
35       echo "gdbserver eval tests suppressed as $1 version is not >= 7.2: " $VERSIONLINE
36       rm -f gdbserver_tests/gdb.eval
37    else
38       touch gdbserver_tests/gdb.eval
39    fi
40 else
41    echo "gdbserver gdb tests suppressed as $1 is not executable"
42 fi
43
44 ln -f -s ../coregrind/vgdb gdbserver_tests/vgdb
45
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
51 then
52     rm -f gdbserver_tests/vgdb.ptraceinvoker
53 else
54     touch gdbserver_tests/vgdb.ptraceinvoker
55 fi
56
57 # cleanup the possibly big garbage previously collected output
58 rm -f gdbserver_tests/garbage.filtered.out