aboutsummaryrefslogtreecommitdiff
path: root/gdb/debuginfod-support.h
diff options
context:
space:
mode:
authorAaron Merey <amerey@redhat.com>2022-03-02 20:00:59 -0500
committerAaron Merey <amerey@redhat.com>2022-03-21 14:11:57 -0400
commitb91f93a02c9c32e55073c0f18b330a6a9c5cfa34 (patch)
tree5b8559303a407e81b9f7876da7814b68cb58323a /gdb/debuginfod-support.h
parent39f53acb410c3e303fb25ff823de57eb316515ca (diff)
downloadfsf-binutils-gdb-b91f93a02c9c32e55073c0f18b330a6a9c5cfa34.zip
fsf-binutils-gdb-b91f93a02c9c32e55073c0f18b330a6a9c5cfa34.tar.gz
fsf-binutils-gdb-b91f93a02c9c32e55073c0f18b330a6a9c5cfa34.tar.bz2
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.
Diffstat (limited to 'gdb/debuginfod-support.h')
-rw-r--r--gdb/debuginfod-support.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/debuginfod-support.h b/gdb/debuginfod-support.h
index 29e361b..5b1c1cb 100644
--- a/gdb/debuginfod-support.h
+++ b/gdb/debuginfod-support.h
@@ -61,4 +61,21 @@ debuginfod_debuginfo_query (const unsigned char *build_id,
const char *filename,
gdb::unique_xmalloc_ptr<char> *destname);
+/* Query debuginfod servers for an executable file with BUILD_ID.
+ BUILD_ID can be given as a binary blob or a null-terminated string.
+ If given as a binary blob, BUILD_ID_LEN should be the number of bytes.
+ If given as a null-terminated string, BUILD_ID_LEN should be 0.
+
+ FILENAME should be the name or path associated with the executable.
+ It is used for printing messages to the user.
+
+ If the file is successfully retrieved, its path on the local machine
+ is stored in DESTNAME. If GDB is not built with debuginfod, this
+ function returns -ENOSYS. */
+
+extern scoped_fd debuginfod_exec_query (const unsigned char *build_id,
+ int build_id_len,
+ const char *filename,
+ gdb::unique_xmalloc_ptr<char>
+ *destname);
#endif /* DEBUGINFOD_SUPPORT_H */