Added few more stubs so that control reaches to DestroyDevice().
[mesa.git] / src / intel / tools / intel_sanitize_gpu.in
1 #!/bin/bash
2 # -*- mode: sh -*-
3
4 function show_help() {
5 cat <<EOF
6 Usage: intel_sanitize_gpu [OPTION]... [--] COMMAND ARGUMENTS
7
8 Run COMMAND with ARGUMENTS and verify the GPU doesn't write outside its memory
9 mapped buffers.
10
11 -g, --gdb Launch GDB
12
13 --help Display this help message and exit
14
15 EOF
16
17 exit 0
18 }
19
20 gdb=""
21
22 while true; do
23 case "$1" in
24 --gdb)
25 gdb=1
26 shift
27 ;;
28 -g)
29 gdb=1
30 shift
31 ;;
32 --help)
33 show_help
34 ;;
35 --)
36 shift
37 break
38 ;;
39 -*)
40 echo "intel_sanitize_gpu: invalid option: $1"
41 echo
42 show_help
43 ;;
44 *)
45 break
46 ;;
47 esac
48 done
49
50 [ -z $1 ] && show_help
51
52 ld_preload="@install_libexecdir@/libintel_sanitize_gpu.so${LD_PRELOAD:+:$LD_PRELOAD}"
53 if [ -z $gdb ]; then
54 LD_PRELOAD=$ld_preload exec "$@"
55 else
56 gdb -iex "set exec-wrapper env LD_PRELOAD=$ld_preload" --args "$@"
57 fi