ODR warning for "enum string_repr_result"
[binutils-gdb.git] / gdb / solib.h
index 2628ca0c2b799c3904a931fa9f06e1cf3f5653d1..f9b4d3566d7171b475553afd6f345fd2c8097b78 100644 (file)
@@ -1,6 +1,6 @@
 /* Shared library declarations for GDB, the GNU Debugger.
-   
-   Copyright (C) 1992-2020 Free Software Foundation, Inc.
+
+   Copyright (C) 1992-2022 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -26,11 +26,9 @@ struct target_ops;
 struct target_so_ops;
 struct program_space;
 
+#include "gdb_bfd.h"
 #include "symfile-add-flags.h"
 
-/* List of known shared objects */
-#define so_list_head current_program_space->so_list
-
 /* Called when we free all symtabs, to free the shared library information
    as well.  */
 
@@ -81,9 +79,9 @@ extern void set_solib_ops (struct gdbarch *gdbarch,
 /* Synchronize GDB's shared object list with inferior's.
 
    Extract the list of currently loaded shared objects from the
-   inferior, and compare it with the list of shared objects currently
-   in GDB's so_list_head list.  Edit so_list_head to bring it in sync
-   with the inferior's new list.
+   inferior, and compare it with the list of shared objects in the
+   current program space's list of shared libraries.  Edit
+   so_list_head to bring it in sync with the inferior's new list.
 
    If we notice that the inferior has unloaded some shared objects,
    free any symbolic info GDB had read about those shared objects.
@@ -115,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);
@@ -123,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 */