Hi Frank, On Wed, 2020-03-25 at 21:39 -0400, Frank Ch. Eigler via Elfutils-devel wrote: > commit b27d38f7eed6d99715fd1cc8a70b0a6a2b04f0ce (HEAD -> fche/pr25722) > Author: Frank Ch. Eigler <f...@redhat.com> > Date: Wed Mar 25 21:36:51 2020 -0400 > > PR25722: debuginfod client api: accept /path/names in place of buildid hex > > As a convenience, this extends the debuginfod find functions (and thus > debuginfod-find) to accept a /path/name to an ELF binary as an > alternative to a hexadecimal string for buildid. Doc & testing incl.
I like the functionality for debuginfod-find, but think it is not really appropriate for the debuginfod client API. It is a little hacky. The user code has to know that it has to call elf_version () first. The interface using path names is somewhat awkward since users probably already have an file descriptor or ELF handle open for the file. It adds a dependency on libelf and libdw for two convenience function calls that the user could do themselves. And it only handles the main build-id in the file, e.g. you cannot easily use it for fetching the multi/alt-file. I think we should move the functionality as is just into debuginfo-find and experiment a bit with it before adding it as a public API to the debuginfod-client API. In debuginfod-find the code would also be slightly simpler since it doesn't have to convert to a hex-string first, it can just pass the build-id bytes as is. Cheers, Mark