Hi Frank, On Wed, Sep 28, 2022 at 10:28 AM Frank Ch. Eigler <f...@redhat.com> wrote: > On Tue, Sep 27, 2022 at 10:10:52PM -0400, Aaron Merey via Elfutils-devel > wrote: > > > [...] In order to distinguish between debuginfo and executable > > files with the same build-id, this function includes a bool > > parameter use_debuginfo. If true, attempt to retrieve the section > > from the debuginfo file with the given build-id. If false, use the > > executable instead. [...] > > How would a client know which one to use? Does it provide power or > benefit to force them to choose (or iterate?). Is there a scenario > where the content could be different between the two (if both > existed)? > > If that decisionmaking is not warranted to put upon the shoulders of > the client, the server could just be asked for a section name "as if > from an unstripped executable", and let it find that in the executable > or debuginfo, whereever.
Good point, the server/client should figure this out internally. On IRC we also discussed the possible usefulness of client-side emulation of section queries in case a server isn't built with _find_section support. Will update the patch to include these details. > > [...] Although this patch does not implement it, we could generate > > .gdb_index on-the-fly if the target file does not contain it. > > However for large debuginfo files generating the index can take a > > non-trivial amount of time (ex. about 25 seconds for a 2.5GB > > debuginfo file). [...] > > Even that is not too bad, considering that the alternative would be > having to download that 2.5GB file. I recall you saying that on some > distros, gdb-index sections are always there anyway, so we wouldn't > have to rush to implement this feature. I did a quick experiment checking the debuginfo for the libraries used by gdb, firefox and qemu-kvm on F36. Out of the 265 files I checked only 1 (libicudata.so.69.1 debuginfo) didn't contain a .gdb_index because it strangely does not contain any .debug_* sections at all. Aaron