5 # To use this script you need
6 # - a Linux 2.4 system with libc 2.2.* and at least XFree86 4.1
7 # - the valgrind debugger (http://developer.kde.org/~sewardj/)
8 # - lots of memory (RAM + swap space > 600MB!) and
9 # - a fast computer =or= a lot of patience.
11 # It is useful (but not required) to compile FlightGear without
12 # any optimizations (-O0 without -funroll-loops etc.). Otherwise
13 # the debug messages might not seem to make sense in some cases.
15 # The sample suppression file is designed for a SuSE 7.1 system
16 # with Linux 2.4.18, XFree86 4.2.0 and a 3dfx card. Don't use it
17 # as it is, but create your own! You will likely have different
18 # libraries with different bugs.
20 # If you have problems with valgrind and FlightGear, don't bother
21 # the valgrind author -- ask on the flightgear-devel list first!
25 # adapt the following two entries to your needs:
27 fgfs="../../src/Main/fgfs"
28 opt="--disable-game-mode --disable-fullscreen --fdm=magic"
32 gdb="--gdb-attach=yes"
39 debug [-r] [-g] [-i] [-b] [-c] [-x] [-h]
43 -i interactive valgrind run (default)
45 -c start gdb with most recent core dump
46 -x add some extra pedantic valgrind parameters
47 -h show this help screen
51 -r) cmd="$fgfs $opt" ;;
52 -g) cmd="gdb -x .gdbinit $fgfs" ;;
55 -x) extra="--single-step=yes --optimise=no --cleanup=no --dump-error=1" ;;
56 -c) core=$(ls -t core*|head -1)
57 if test -z $core; then
58 echo "$0: there's no core file"
68 if ! test -e "$fgfs"; then
69 echo "$0: there's no fgfs exectuable $fgfs"
73 echo "set args $opt" > .gdbinit
75 test -e fgfs.supp || head -14 sample.fgfs.supp > fgfs.supp
77 test -z "$cmd" && cmd="nice valgrind $gdb --num-callers=10 --suppressions=fgfs.supp $extra $* $fgfs $opt"