PR gdb/27570: missing support for debuginfod in core_target::build_file_mappings
authorAaron Merey <amerey@redhat.com>
Thu, 3 Mar 2022 01:00:59 +0000 (20:00 -0500)
committerAaron Merey <amerey@redhat.com>
Mon, 21 Mar 2022 18:11:57 +0000 (14:11 -0400)
commitb91f93a02c9c32e55073c0f18b330a6a9c5cfa34
tree5b8559303a407e81b9f7876da7814b68cb58323a
parent39f53acb410c3e303fb25ff823de57eb316515ca
PR gdb/27570: missing support for debuginfod in core_target::build_file_mappings

Add debuginfod support to core_target::build_file_mappings and
locate_exec_from_corefile_build_id to enable the downloading of
missing executables and shared libraries referenced in core files.

Also add debuginfod support to solib_map_sections so that previously
downloaded shared libraries can be retrieved from the local debuginfod
cache.

When core file shared libraries are found locally, verify that their
build-ids match the corresponding build-ids found in the core file.
If there is a mismatch, attempt to query debuginfod for the correct
build and print a warning if unsuccessful:

  warning: Build-id of /lib64/libc.so.6 does not match core file.

Also disable debuginfod when gcore invokes gdb.  Debuginfo is not
needed for core file generation so debuginfod queries will slow down
gcore unnecessarily.
gdb/corelow.c
gdb/debuginfod-support.c
gdb/debuginfod-support.h
gdb/gcore.in
gdb/solib.c
gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp