This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH RFC] Add debuginfod support to objdump and readelf
On Tue, Nov 26, 2019 at 8:49 AM Tom Tromey <tom@tromey.com> wrote:
>
> >>>>> "Aaron" == Aaron Merey <amerey@redhat.com> writes:
>
> Aaron> +# Enable debuginfod
> Aaron> +AC_ARG_WITH([debuginfod],
> Aaron> + AC_HELP_STRING([--with-debuginfod],
> Aaron> + [Enable debuginfo lookups with debuginfod (auto/yes/no)]),
> Aaron> + [], [with_debuginfod=auto])
> Aaron> +AC_MSG_CHECKING([whether to use debuginfod])
> Aaron> +AC_MSG_RESULT([$with_debuginfod])
> Aaron> +
> Aaron> +if test "${with_debuginfod}" = no; then
> Aaron> + AC_MSG_WARN([debuginfod support disabled; some features may be unavailable.])
> Aaron> +else
> Aaron> + AC_CHECK_LIB([debuginfod], [debuginfod_begin], [have_debuginfod_lib=yes])
> Aaron> + AC_CHECK_DECL([debuginfod_begin], [have_debuginfod_h=yes], [],
> Aaron> + [#include <elfutils/debuginfod.h>])
> Aaron> + if test "x$have_debuginfod_lib" = "xyes" -a \
> Aaron> + "x$have_debuginfod_h" = "xyes"; then
> Aaron> + AC_DEFINE([HAVE_LIBDEBUGINFOD], [1],
> Aaron> + [Define to 1 if debuginfod is enabled.])
> Aaron> + AC_SUBST([LIBDEBUGINFOD], ["-ldebuginfod"])
> Aaron> + else
> Aaron> + AC_SUBST([LIBDEBUGINFOD], [])
> Aaron> + if test "$with_debuginfod" = yes; then
> Aaron> + AC_MSG_ERROR([debuginfod is missing or unusable])
> Aaron> + else
> Aaron> + AC_MSG_WARN([debuginfod is missing or unusable; some features may be unavailable.])
> Aaron> + fi
> Aaron> + fi
> Aaron> +fi
>
> How does this relate to the gdb patch? The two patches seem to do
> similar things but use different configure options and different names.
> Maybe I'm looking at an outdated version of the gdb patch?
>
> Anyway, how about shipping a pkg-config file for the library so that
> some of this configury can be removed? Also, if the code is shared, how
> about either putting it into BFD for reuse, or at least putting the
> configury into a new .m4 file in config/ so that this can be reused?
The patch I posted to gdb-patches@ is a bit outdated and we have
renamed dbgserver to debuginfod. This patch allows objdump and readelf
to query debuginfod servers for dwz and separate debug files much like
the gdb patch (dwz lookups have since been added to gdb in our
experimental branch users/fche/dbgserver, the branch name has not been
updated since the name change). The debuginfod configury for binutils
and gdb should definitely be consolidated, I will make these
changes to the revised patch.
Aaron