+2020-08-20 Dmitry V. Levin <ldv@altlinux.org>
+
+ * configure.ac (--enable-libdebuginfod): AC_DEFINE ENABLE_LIBDEBUGINFOD.
+
2020-07-17 Mark Wielaard <mark@klomp.org>
* configure.ac: Set -DBAD_FTS=1 also for CXXFLAGS.
fi
])
-AS_IF([test "x$enable_libdebuginfod" = "xdummy"],AC_DEFINE([DUMMY_LIBDEBUGINFOD],[1],[Build dummy libdebuginfod]))
+AS_IF([test "x$enable_libdebuginfod" = "xyes" || test "x$enable_libdebuginfod" = "xdummy"],
+ [AC_DEFINE([ENABLE_LIBDEBUGINFOD], [1], [Enable libdebuginfod])])
+AS_IF([test "x$enable_libdebuginfod" = "xdummy"],
+ [AC_DEFINE([DUMMY_LIBDEBUGINFOD], [1], [Build dummy libdebuginfod])])
AM_CONDITIONAL([LIBDEBUGINFOD],[test "x$enable_libdebuginfod" = "xyes" || test "x$enable_libdebuginfod" = "xdummy"])
AM_CONDITIONAL([DUMMY_LIBDEBUGINFOD],[test "x$enable_libdebuginfod" = "xdummy"])
+2020-08-20 Dmitry V. Levin <ldv@altlinux.org>
+
+ * Makefile.am (libdwfl_a_SOURCES): Conditionalize
+ debuginfod-client.c on LIBDEBUGINFOD.
+ * dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Conditionalize
+ __libdwfl_debuginfod_find_executable invocation on
+ ENABLE_LIBDEBUGINFOD.
+ * dwfl_end.c (dwfl_end): Conditionalize __libdwfl_debuginfod_end
+ invocation on ENABLE_LIBDEBUGINFOD.
+ * find-debuginfo.c (dwfl_standard_find_debuginfo): Conditionalize
+ __libdwfl_debuginfod_find_debuginfo invocation on
+ ENABLE_LIBDEBUGINFOD.
+ * libdwflP.h: Guard debuginfod.h include with ENABLE_LIBDEBUGINFOD.
+ (struct Dwfl): Guard debuginfod field with ENABLE_LIBDEBUGINFOD.
+ (__libdwfl_debuginfod_find_executable,
+ __libdwfl_debuginfod_find_debuginfo, __libdwfl_debuginfod_end):
+ Guard declarations with ENABLE_LIBDEBUGINFOD.
+
2020-07-05 Mark Wielaard <mark@klomp.org>
* argp-std.c (parse_opt): Don't assert, but call fail when
link_map.c core-file.c open.c image-header.c \
dwfl_frame.c frame_unwind.c dwfl_frame_pc.c \
linux-pid-attach.c linux-core-attach.c dwfl_frame_regs.c \
- gzip.c debuginfod-client.c
+ gzip.c
if BZLIB
libdwfl_a_SOURCES += bzip2.c
if LZMA
libdwfl_a_SOURCES += lzma.c
endif
+if LIBDEBUGINFOD
+libdwfl_a_SOURCES += debuginfod-client.c
+endif
libdwfl = $(libdw)
libdw = ../libdw/libdw.so
}
else
{
+#ifdef ENABLE_LIBDEBUGINFOD
/* If all else fails and a build-id is available, query the
debuginfo-server if enabled. */
if (fd < 0 && mod->build_id_len > 0)
fd = __libdwfl_debuginfod_find_executable (mod->dwfl,
mod->build_id_bits,
mod->build_id_len);
+#endif
}
if (fd < 0 && errno == 0 && mod->build_id_len > 0)
if (dwfl == NULL)
return;
+#ifdef ENABLE_LIBDEBUGINFOD
__libdwfl_debuginfod_end (dwfl->debuginfod);
+#endif
if (dwfl->process)
__libdwfl_process_free (dwfl->process);
free (canon);
}
+#ifdef ENABLE_LIBDEBUGINFOD
/* Still nothing? Try if we can use the debuginfod client.
But note that we might be looking for the alt file.
We use the same trick as dwfl_build_id_find_debuginfo.
if (bits_len > 0)
fd = __libdwfl_debuginfod_find_debuginfo (mod->dwfl, bits, bits_len);
}
+#endif
return fd;
}
#include "../libdw/libdwP.h" /* We need its INTDECLs. */
#include "../libdwelf/libdwelfP.h"
+
+#ifdef ENABLE_LIBDEBUGINFOD
#include "../debuginfod/debuginfod.h"
+#endif
typedef struct Dwfl_Process Dwfl_Process;
struct Dwfl
{
const Dwfl_Callbacks *callbacks;
+#ifdef ENABLE_LIBDEBUGINFOD
debuginfod_client *debuginfod;
-
+#endif
Dwfl_Module *modulelist; /* List in order used by full traversals. */
Dwfl_Process *process;
extern bool __libdwfl_dynamic_vaddr_get (Elf *elf, GElf_Addr *vaddrp)
internal_function;
+#ifdef ENABLE_LIBDEBUGINFOD
/* Internal interface to libdebuginfod (if installed). */
int
__libdwfl_debuginfod_find_executable (Dwfl *dwfl,
size_t build_id_len);
void
__libdwfl_debuginfod_end (debuginfod_client *c);
+#endif
/* These are working nicely for --core, but are not ready to be