Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23405>
exit 0
}
-gdb=""
+gdb=
+valgrind=
platform="skl"
while true; do
gdb=1
shift
;;
+ --valgrind)
+ valgrind=1
+ shift
+ ;;
-p)
platform=$2
shift 2
INTEL_STUB_GPU_PLATFORM=$platform
ld_preload="@install_libdir@/libintel_noop_drm_shim.so${LD_PRELOAD:+:$LD_PRELOAD}"
-if [ -z $gdb ]; then
+if [ -n "$gdb" ]; then
+ gdb -iex "set exec-wrapper env LD_PRELOAD=$ld_preload INTEL_STUB_GPU_PLATFORM=$platform" --args "$@"
LD_PRELOAD=$ld_preload INTEL_STUB_GPU_PLATFORM=$platform exec "$@"
+elif [ -n "$valgrind" ]; then
+ LD_PRELOAD=$ld_preload INTEL_STUB_GPU_PLATFORM=$platform exec valgrind "$@"
else
- gdb -iex "set exec-wrapper env LD_PRELOAD=$ld_preload INTEL_STUB_GPU_PLATFORM=$platform" --args "$@"
+ LD_PRELOAD=$ld_preload INTEL_STUB_GPU_PLATFORM=$platform exec "$@"
fi