* ==================== CORE CHANGES ===================
+* A new configure option --with-gdbscripts-dir lets you install
+ the gdb valgrind python monitor scripts in a specific location.
+ For example an distro could use it to install the scripts in a
+ safe load location --with-gdbscripts-dir=%{_datadir}/gdb/auto-load
+ It is also possible to configure --without-gdb-scripts-dir so no
+ .debug_gdb_scripts section is added to the vgpreload library and
+ no valgrind-monitor python scripts are installed at all.
* ================== PLATFORM CHANGES =================
460192 Add epoll_pwait2
469049 link failure on ppc64 (big endian) valgrind 3.20
469146 massif --ignore-fn does not ignore inlined functions
+469768 Make it possible to install gdb scripts in a different location
To see details of a given bug, visit
https://bugs.kde.org/show_bug.cgi?id=XXXXXX
AC_DEFINE_UNQUOTED(XCODE_DIR, "$xcodedir", [xcode sdk include directory])
AC_SUBST(XCODE_DIR, [$xcodedir])])
+#----------------------------------------------------------------------------
+# Where to install gdb scripts, defaults to VG_LIBDIR (pkglibexecdir)
+#----------------------------------------------------------------------------
+AC_MSG_CHECKING([where gdb scripts are installed])
+AC_ARG_WITH(gdbscripts-dir,
+ [ --with-gdbscripts-dir=PATH Specify path to install gdb scripts],
+ [gdbscriptsdir=${withval}],
+ [gdbscriptsdir=${libexecdir}/valgrind])
+AC_MSG_RESULT([$gdbscriptsdir])
+if test "x$gdbscriptsdir" != "xno"; then
+ AC_SUBST(VG_GDBSCRIPTS_DIR, [$gdbscriptsdir])
+ AM_CONDITIONAL(GDBSCRIPTS, true)
+else
+ AC_SUBST(VG_GDBSCRIPTS_DIR, [])
+ AM_CONDITIONAL(GDBSCRIPTS, false)
+fi
+
#----------------------------------------------------------------------------
# Libc and suppressions
#----------------------------------------------------------------------------
vgdb_SOURCES += vgdb-invoker-freebsd.c
endif
-vgdb_CPPFLAGS = $(AM_CPPFLAGS_PRI)
+vgdb_CPPFLAGS = $(AM_CPPFLAGS_PRI) $(GDB_SCRIPTS_DIR)
vgdb_CFLAGS = $(AM_CFLAGS_PRI) $(LTO_CFLAGS)
vgdb_CCASFLAGS = $(AM_CCASFLAGS_PRI)
vgdb_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@
noinst_DSYMS = $(noinst_PROGRAMS)
endif
+if GDBSCRIPTS
+ GDB_SCRIPTS_DIR=-DVG_GDBSCRIPTS_DIR="\"@VG_GDBSCRIPTS_DIR@\""
+else
+ GDB_SCRIPTS_DIR=
+endif
+
vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_SOURCES = vg_preloaded.c
vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CPPFLAGS = \
- $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
+ $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) $(GDB_SCRIPTS_DIR)
vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CFLAGS = \
$(AM_CFLAGS_PSO_@VGCONF_PLATFORM_PRI_CAPS@)
vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_LDFLAGS = \
if VGCONF_HAVE_PLATFORM_SEC
vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_SOURCES = vg_preloaded.c
vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CPPFLAGS = \
- $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
+ $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) $(GDBSCRIPTS_DIR)
vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CFLAGS = \
$(AM_CFLAGS_PSO_@VGCONF_PLATFORM_SEC_CAPS@)
vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_LDFLAGS = \
# so as to make sure these get copied into the install tree
vglibdir = $(pkglibexecdir)
vglib_DATA = $(GDBSERVER_XML_FILES)
-vglib_DATA += m_gdbserver/valgrind-monitor.py
-vglib_DATA += m_gdbserver/valgrind-monitor-def.py
+
+if GDBSCRIPTS
+gdbscriptsdir = @VG_GDBSCRIPTS_DIR@
+gdbscripts_DATA = m_gdbserver/valgrind-monitor.py
+gdbscripts_DATA += m_gdbserver/valgrind-monitor-def.py
+endif
# so as to make sure these get copied into the tarball
EXTRA_DIST += $(GDBSERVER_XML_FILES)
.popsection \n\
");
-DEFINE_GDB_PY_SCRIPT(VG_LIBDIR "/valgrind-monitor.py")
+#ifdef VG_GDBSCRIPTS_DIR
+DEFINE_GDB_PY_SCRIPT(VG_GDBSCRIPTS_DIR "/valgrind-monitor.py")
+#endif
#endif
#if defined(VGO_linux) || defined(VGO_solaris) || defined(VGO_freebsd)
" -d arg tells to show debug info. Multiple -d args for more debug info\n"
"\n"
" -h --help shows this message\n"
+#ifdef VG_GDBSCRIPTS_DIR
" The GDB python code defining GDB front end valgrind commands is:\n %s\n"
+#endif
" To get help from the Valgrind gdbserver, use vgdb help\n"
-"\n", vgdb_prefix_default(), VG_LIBDIR "/valgrind-monitor.py"
- );
+"\n", vgdb_prefix_default()
+#ifdef VG_GDBSCRIPTS_DIR
+ , VG_GDBSCRIPTS_DIR "/valgrind-monitor.py"
+#endif
+ );
invoker_restrictions_msg();
}