Created attachment 158950 [details] Add --with-gdbscripts-dir=PATH configure option Add --with-gdbscripts-dir=PATH configure option Currently the gdb valgrind scripts are installed under VG_LIBDIR which is normally pkglibexecdir which is likely not in the default gdb safe-path (a list of directories from which it is safe to auto-load files). So users will have to add the directory to their .gdbinit file. This patch adds a --with-gdbscripts-dir=PATH configure option that sets VG_GDBSCRIPTS_DIR to the given PATH (${libexecdir}/valgrind if not given). Use VG_GDBSCRIPTS_DIR as gdbscriptsdir to install the valgrind-monitor python files and pass it with CPPFLAGS when building vg_preloaded.c and vgdb.c to use instead of VG_LIBDIR.
e.g. for fedora this would be used with configure --with-gdbscripts-dir=%{_datadir}/gdb/auto-load
Sasha tried this on Fedora and it seems to work well: https://bodhi.fedoraproject.org/updates/FEDORA-2023-8f22f996f2
Created attachment 159103 [details] Add --with-gdbscripts-dir=PATH configure option Updated patch to include --without-gdbscripts-dir option to not install the scripts
commit e3602b3eec0696b183722ea21da14588cf205c74 Author: Mark Wielaard <mark@klomp.org> Date: Sun May 14 23:34:05 2023 +0200 Add --with-gdbscripts-dir=PATH configure option Currently the gdb valgrind scripts are installed under VG_LIBDIR which is normally pkglibexecdir which is likely not in the default gdb safe-path (a list of directories from which it is safe to auto-load files). So users will have to add the directory to their .gdbinit file. This patch adds a --with-gdbscripts-dir=PATH configure option that sets VG_GDBSCRIPTS_DIR to the given PATH (${libexecdir}/valgrind if not given). A user can also configure --without-gdbscripts-dir to disable adding a .debug_gdb_scripts section to the vgpreload library and installing the valgrind-monitor python scripts completely. Use VG_GDBSCRIPTS_DIR as gdbscriptsdir to install the valgrind-monitor python files and pass it with CPPFLAGS when building vg_preloaded.c and vgdb.c to use instead of VG_LIBDIR. https://bugs.kde.org/show_bug.cgi?id=469768