dwarf_linecontext;
dwarf_linefunctionname;
} ELFUTILS_0.177;
+
+ELFUTILS_0.187 {
+ global:
+ dwfl_get_debuginfod_client;
+} ELFUTILS_0.186;
+2022-06-22 Milian Wolff <mail@milianw.de>
+
+ * libdwfl.h, debuginfod-client.c (dwfl_get_debuginfod_client):
+ Rename get_client to dwfl_get_debuginfod_client and make it public.
+
2022-05-15 Mark Wielaard <mark@klomp.org>
* libdwfl.h (dwfl_module_addrinfo): Update docs and nonnull
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
+ gzip.c debuginfod-client.c
if BZLIB
libdwfl_a_SOURCES += bzip2.c
if ZSTD
libdwfl_a_SOURCES += zstd.c
endif
-if LIBDEBUGINFOD
-libdwfl_a_SOURCES += debuginfod-client.c
-endif
libdwfl = $(libdw)
libdw = ../libdw/libdw.so
#endif
#include "libdwflP.h"
+
+#ifdef ENABLE_LIBDEBUGINFOD
+
#include <pthread.h>
#include <dlfcn.h>
/* NB: this is slightly thread-unsafe */
-static debuginfod_client *
-get_client (Dwfl *dwfl)
+debuginfod_client *
+dwfl_get_debuginfod_client (Dwfl *dwfl)
{
if (dwfl->debuginfod != NULL)
return dwfl->debuginfod;
int fd = -1;
if (build_id_len > 0)
{
- debuginfod_client *c = get_client (dwfl);
+ debuginfod_client *c = dwfl_get_debuginfod_client (dwfl);
if (c != NULL)
fd = (*fp_debuginfod_find_executable) (c, build_id_bits,
build_id_len, NULL);
int fd = -1;
if (build_id_len > 0)
{
- debuginfod_client *c = get_client (dwfl);
+ debuginfod_client *c = dwfl_get_debuginfod_client (dwfl);
if (c != NULL)
fd = (*fp_debuginfod_find_debuginfo) (c, build_id_bits,
build_id_len, NULL);
}
/* Try to get the libdebuginfod library functions.
- Only needs to be called once from get_client. */
+ Only needs to be called once from dwfl_get_debuginfod_client. */
static void
__libdwfl_debuginfod_init (void)
{
}
}
}
+
+#else // ENABLE_LIBDEBUGINFOD
+
+debuginfod_client *
+dwfl_get_debuginfod_client (Dwfl *)
+{
+ return NULL;
+}
+
+#endif // ENABLE_LIBDEBUGINFOD
PC location described by an FDE belonging to Dwfl_Thread. */
typedef struct Dwfl_Frame Dwfl_Frame;
+/* Handle for debuginfod-client connection. */
+typedef struct debuginfod_client debuginfod_client;
+
/* Callbacks. */
typedef struct
{
bool dwfl_frame_pc (Dwfl_Frame *state, Dwarf_Addr *pc, bool *isactivation)
__nonnull_attribute__ (1, 2);
+/* Return the internal debuginfod-client connection handle for the DWFL session.
+ When the client connection has not yet been initialized, it will be done on the
+ first call to this function. If elfutils is compiled without support for debuginfod,
+ NULL will be returned.
+ */
+extern debuginfod_client *dwfl_get_debuginfod_client (Dwfl *dwfl);
+
#ifdef __cplusplus
}
#endif
INTDECL (dwfl_getthreads)
INTDECL (dwfl_thread_getframes)
INTDECL (dwfl_frame_pc)
+INTDECL (dwfl_get_debuginfod_client)
/* Leading arguments standard to callbacks passed a Dwfl_Module. */
#define MODCB_ARGS(mod) (mod), &(mod)->userdata, (mod)->name, (mod)->low_addr