Automatically fetching Build ID from remote libraries and resole them locally?

Jan Kratochvil jan.kratochvil@redhat.com
Mon Mar 30 08:45:22 GMT 2020


On Mon, 30 Mar 2020 10:35:30 +0200, Norbert Lange via Gdb wrote:
> Currently its not possible to detect the Build ID without transferring the
> whole library from Remote target to the local gdb. I suppose with coredumps
> its a similar problem. What I would like is using build IDs wherever
> possible. That means retrieve them from the remote, and maybe define some
> fileformat to augment coredumps with the information.

Coredumps already contain build-ids of executables + shared libraries as long
as it is enabled (it is by default):
	https://www.kernel.org/doc/Documentation/filesystems/proc.txt
  - (bit 4) ELF header pages in file-backed private memory areas (it is
            effective only if the bit 2 is cleared)

build-id loading from remote files should be also somehow supported by recent
GDBs (done by Gary Benson).

Fedora+RHEL GDB has patchset
	https://src.fedoraproject.org/rpms/gdb/blob/master/f/gdb-6.6-buildid-locate.patch
	https://src.fedoraproject.org/rpms/gdb/blob/master/f/gdb-6.6-buildid-locate-solib-missing-ids.patch
	https://src.fedoraproject.org/rpms/gdb/blob/master/f/gdb-6.6-buildid-locate-core-as-arg.patch
to locate appropriate executable + shared libraries from such core file by
build-id - it locates then through symlinks in:
	/usr/lib/debug/.build-id/6b/6cd649300ec28b47638e766e9cbb58648cbdac{,.debug}

IIUC that patchset should be now being replaced by the elfutils debuginfod.


Jan



More information about the Gdb mailing list