aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib.h
diff options
context:
space:
mode:
authorAaron Merey <amerey@redhat.com>2022-03-02 18:46:14 -0500
committerAaron Merey <amerey@redhat.com>2022-03-21 14:11:51 -0400
commit39f53acb410c3e303fb25ff823de57eb316515ca (patch)
treebe9ede6479d9008442629295ba7bd685f2ce634f /gdb/solib.h
parentd37e084783a04c63ae137f953ebdb58bb6f7f704 (diff)
downloadgdb-39f53acb410c3e303fb25ff823de57eb316515ca.zip
gdb-39f53acb410c3e303fb25ff823de57eb316515ca.tar.gz
gdb-39f53acb410c3e303fb25ff823de57eb316515ca.tar.bz2
gdb: Add soname to build-id mapping for core files
Since commit aa2d5a422 gdb has been able to read executable and shared library build-ids within core files. Expand this functionality so that each core file bfd maintains a map of soname to build-id for each shared library referenced in the core file. This feature may be used to verify that gdb has found the correct shared libraries for core files and to facilitate downloading shared libaries via debuginfod.
Diffstat (limited to 'gdb/solib.h')
-rw-r--r--gdb/solib.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/solib.h b/gdb/solib.h
index 2258b0b..cd6c8a8 100644
--- a/gdb/solib.h
+++ b/gdb/solib.h
@@ -118,6 +118,12 @@ extern CORE_ADDR gdb_bfd_lookup_symbol_from_symtab (bfd *abfd,
extern int gdb_bfd_scan_elf_dyntag (const int desired_dyntag, bfd *abfd,
CORE_ADDR *ptr, CORE_ADDR *ptr_addr);
+/* If FILENAME refers to an ELF shared object then attempt to return the
+ string referred to by its DT_SONAME tag. */
+
+extern gdb::unique_xmalloc_ptr<char> gdb_bfd_read_elf_soname
+ (const char *filename);
+
/* Enable or disable optional solib event breakpoints as appropriate. */
extern void update_solib_breakpoints (void);
@@ -126,4 +132,18 @@ extern void update_solib_breakpoints (void);
extern void handle_solib_event (void);
+/* Associate SONAME with BUILD_ID in ABFD's registry so that it can be
+ retrieved with get_cbfd_soname_build_id. */
+
+extern void set_cbfd_soname_build_id (gdb_bfd_ref_ptr abfd,
+ const char *soname,
+ const bfd_build_id *build_id);
+
+/* If SONAME had a build-id associated with it in ABFD's registry by a
+ previous call to set_cbfd_soname_build_id then return the build-id
+ as a NULL-terminated hex string. */
+
+extern gdb::unique_xmalloc_ptr<char> get_cbfd_soname_build_id
+ (gdb_bfd_ref_ptr abfd, const char *soname);
+
#endif /* SOLIB_H */