ODR warning for "enum string_repr_result"
[binutils-gdb.git] / gdb / solib.h
index a94e9d3cd9e4b61d455093daeffb6a724edc64a4..f9b4d3566d7171b475553afd6f345fd2c8097b78 100644 (file)
@@ -1,6 +1,6 @@
 /* Shared library declarations for GDB, the GNU Debugger.
-   
-   Copyright (C) 1992-2021 Free Software Foundation, Inc.
+
+   Copyright (C) 1992-2022 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -26,6 +26,7 @@ struct target_ops;
 struct target_so_ops;
 struct program_space;
 
+#include "gdb_bfd.h"
 #include "symfile-add-flags.h"
 
 /* Called when we free all symtabs, to free the shared library information
@@ -112,6 +113,18 @@ extern CORE_ADDR gdb_bfd_lookup_symbol_from_symtab (bfd *abfd,
                                                       const void *),
                                                    const void *data);
 
+/* Scan for DESIRED_DYNTAG in .dynamic section of ABFD.  If DESIRED_DYNTAG is
+   found, 1 is returned and the corresponding PTR and PTR_ADDR are set.  */
+
+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);
@@ -120,4 +133,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 */