diff options
Diffstat (limited to 'libdwfl/find-debuginfo.c')
-rw-r--r-- | libdwfl/find-debuginfo.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libdwfl/find-debuginfo.c b/libdwfl/find-debuginfo.c index 9267788d..6371c253 100644 --- a/libdwfl/find-debuginfo.c +++ b/libdwfl/find-debuginfo.c @@ -31,6 +31,7 @@ #endif #include "libdwflP.h" +#include "debuginfoserver-client.h" #include <stdio.h> #include <fcntl.h> #include <unistd.h> @@ -359,7 +360,8 @@ dwfl_standard_find_debuginfo (Dwfl_Module *mod, other than just by finding nothing, that's all we do. */ const unsigned char *bits; GElf_Addr vaddr; - if (INTUSE(dwfl_module_build_id) (mod, &bits, &vaddr) > 0) + int bits_len; + if ((bits_len = INTUSE(dwfl_module_build_id) (mod, &bits, &vaddr)) > 0) { /* Dropping most arguments means we cannot rely on them in dwfl_build_id_find_debuginfo. But leave it that way since @@ -397,6 +399,11 @@ dwfl_standard_find_debuginfo (Dwfl_Module *mod, free (canon); } + /* If all else fails and a build-id is available, query the + debuginfo-server if enabled. */ + if (fd < 0 && bits_len > 0 && dbgserver_enabled()) + dbgserver_find_debuginfo(bits, bits_len); + return fd; } INTDEF (dwfl_standard_find_debuginfo) |