]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/solib: move solist.h content to solib.h
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 26 May 2025 20:26:13 +0000 (16:26 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Thu, 29 May 2025 14:47:48 +0000 (10:47 -0400)
I don't think that the file solist.h is useful.  It would make sense to
have `struct solib` in solib.h.  And then, all that would remain is
`struct solib_ops` and some solib-related function declarations.  So,
move it all to solib.h.

Change-Id: I20ecf19787c378066f2c7a6a8a737c1db7c55d9a
Reviewed-By: Guinevere Larsen <guinevere@redhat.com>
28 files changed:
gdb/Makefile.in
gdb/break-catch-load.c
gdb/breakpoint.c
gdb/bsd-uthread.c
gdb/corelow.c
gdb/exec.c
gdb/infrun.c
gdb/mi/mi-cmd-file.c
gdb/mi/mi-interp.c
gdb/mips-linux-tdep.c
gdb/ppc-linux-tdep.c
gdb/progspace.c
gdb/progspace.h
gdb/solib-aix.c
gdb/solib-darwin.c
gdb/solib-dsbt.c
gdb/solib-frv.c
gdb/solib-rocm.c
gdb/solib-svr4.c
gdb/solib-svr4.h
gdb/solib-target.c
gdb/solib.c
gdb/solib.h
gdb/solist.h [deleted file]
gdb/symtab.c
gdb/utils.c
gdb/windows-nat.c
gdb/windows-tdep.c

index 1b86766699157b759140a39bc63258830198e958..f30c38d1b47aef636e1ee53399bae49ff2e18eb1 100644 (file)
@@ -1511,7 +1511,6 @@ HFILES_NO_SRCDIR = \
        solib-darwin.h \
        solib-svr4.h \
        solib-target.h \
-       solist.h \
        source.h \
        source-cache.h \
        sparc-nat.h \
index e084fbbcd5ccea0076554590f7d3bee46959dc88..9d25d75e502dc10756c73680d23fc596e5b5ba59 100644 (file)
@@ -24,7 +24,7 @@
 #include "cli/cli-decode.h"
 #include "mi/mi-common.h"
 #include "progspace.h"
-#include "solist.h"
+#include "solib.h"
 #include "target.h"
 #include "valprint.h"
 
index 7735574f3e22b2aaab99c8e2d10a5f3bf08dc5f3..3fd7f2f099fa2cae788fe497ddf8fa1338497444 100644 (file)
@@ -50,7 +50,6 @@
 #include "cli/cli-script.h"
 #include "block.h"
 #include "solib.h"
-#include "solist.h"
 #include "observable.h"
 #include "memattr.h"
 #include "ada-lang.h"
index 13811923f41d24b1c66747bfeb5a75edd7f64f86..a493b0c6ae4545b031a495bfa5a9a5e7ba490148 100644 (file)
@@ -25,7 +25,6 @@
 #include "observable.h"
 #include "regcache.h"
 #include "solib.h"
-#include "solist.h"
 #include "symfile.h"
 #include "target.h"
 
index 127400eabaa0c42a067486c87e810097225bd798..b5895de9e9c6281cd4438b83b40ce39907317b1d 100644 (file)
@@ -37,7 +37,6 @@
 #include "exec.h"
 #include "readline/tilde.h"
 #include "solib.h"
-#include "solist.h"
 #include "filenames.h"
 #include "progspace.h"
 #include "objfiles.h"
index 33183ab2de80e184919d09113a0d95c21944d733..d08ac7a38f4b53c9856e6ee0760d6e43aa39bb60 100644 (file)
@@ -44,7 +44,7 @@
 
 #include <ctype.h>
 #include <sys/stat.h>
-#include "solist.h"
+#include "solib.h"
 #include <algorithm>
 #include "gdbsupport/pathstuff.h"
 #include "cli/cli-style.h"
index 0b8728799613ca00806b2aa1008418c83654af9e..2e02642c52a4201be2793dee1ce5a568f96bd664 100644 (file)
@@ -58,7 +58,6 @@
 #include "target-descriptions.h"
 #include "target-dcache.h"
 #include "terminal.h"
-#include "solist.h"
 #include "gdbsupport/event-loop.h"
 #include "thread-fsm.h"
 #include "gdbsupport/enum-flags.h"
index a888bee958cd75bb9d7a6a9faf375f0c75f17f79..cf7991f9892032985b22bc348060be59197940ab 100644 (file)
@@ -25,7 +25,6 @@
 #include "symtab.h"
 #include "source.h"
 #include "solib.h"
-#include "solist.h"
 
 /* Return to the client the absolute path and line number of the 
    current file being executed.  */
index 357fc016a1ebcdbccb1c420acb942e9064023a78..1c905347007e5cd93d7bcae5462a05ec6adaaf18 100644 (file)
@@ -34,7 +34,7 @@
 #include "mi-common.h"
 #include "observable.h"
 #include "gdbthread.h"
-#include "solist.h"
+#include "solib.h"
 #include "objfiles.h"
 #include "tracepoint.h"
 #include "cli-out.h"
index 418892bb0dde81525590eef97860a15dc51e4c22..46766e40a190b44095a05fb3d0e2f4b82e455a6d 100644 (file)
@@ -30,7 +30,6 @@
 #include "gdbtypes.h"
 #include "objfiles.h"
 #include "solib.h"
-#include "solist.h"
 #include "symtab.h"
 #include "target-descriptions.h"
 #include "regset.h"
index 441f31767510d3d64f6dba03464411e89b97e50e..c998fc2dbe1bcc10c4ece3d6ffb59e8a8af22b9e 100644 (file)
@@ -32,7 +32,6 @@
 #include "regset.h"
 #include "solib-svr4.h"
 #include "solib.h"
-#include "solist.h"
 #include "ppc-tdep.h"
 #include "ppc64-tdep.h"
 #include "ppc-linux-tdep.h"
index eda63790aec9169724119c766b7e4c72da3cb550..1c27165743738f59d21f8f57e7f758206d85e210 100644 (file)
@@ -21,7 +21,6 @@
 #include "objfiles.h"
 #include "gdbcore.h"
 #include "solib.h"
-#include "solist.h"
 #include "gdbthread.h"
 #include "inferior.h"
 #include <algorithm>
index 1e08439993a1500c74db9f37101386f23ce04dfc..5e5d5edd9b4b97d8b1382ee97376f6acb34e3916 100644 (file)
@@ -24,9 +24,9 @@
 #include "target.h"
 #include "gdb_bfd.h"
 #include "registry.h"
-#include "solist.h"
 #include "gdbsupport/safe-iterator.h"
 #include "gdbsupport/intrusive_list.h"
+#include "gdbsupport/owning_intrusive_list.h"
 #include "gdbsupport/refcounted-object.h"
 #include "gdbsupport/gdb_ref_ptr.h"
 #include <vector>
index 0d8bb69a96e7c521472711ca4906c30b48e14e95..fb9c781f51067d4a16b83674c1551da8d21de471 100644 (file)
@@ -17,7 +17,6 @@
 
 #include "solib-aix.h"
 #include "solib.h"
-#include "solist.h"
 #include "inferior.h"
 #include "gdb_bfd.h"
 #include "objfiles.h"
index a2c30fa19db8b5ed49c61b7e0471f59178565080..c0c6fb5552491cad7759a6b5cddd6c8191790c06 100644 (file)
@@ -27,7 +27,7 @@
 #include "regcache.h"
 #include "gdb_bfd.h"
 
-#include "solist.h"
+#include "solib.h"
 #include "solib-darwin.h"
 
 #include "mach-o.h"
index 05c5616cfb1436d981b5e5ead58edb1a1358a73e..0d8b067a20fabb8cd22cf2f4b4b58b7688311f36 100644 (file)
@@ -21,7 +21,6 @@
 #include "inferior.h"
 #include "gdbcore.h"
 #include "solib.h"
-#include "solist.h"
 #include "objfiles.h"
 #include "symtab.h"
 #include "command.h"
@@ -393,7 +392,7 @@ fetch_loadmap (CORE_ADDR ldmaddr)
 static void dsbt_relocate_main_executable (void);
 static int enable_break (void);
 
-/* See solist.h. */
+/* See solib.h. */
 
 static int
 open_symbol_file_object (int from_tty)
index 4f52614ba902351a9922eece0b480be5b61e1951..124b5eba590878816878b46a867038c7805cf36f 100644 (file)
@@ -20,7 +20,6 @@
 #include "extract-store-integer.h"
 #include "gdbcore.h"
 #include "solib.h"
-#include "solist.h"
 #include "frv-tdep.h"
 #include "objfiles.h"
 #include "symtab.h"
index a5eaee73f2e62840f4653f267dd8d0e32b4450fd..92fb91563f00da14866574cec0a9ed46971ffe49 100644 (file)
@@ -29,7 +29,6 @@
 #include "observable.h"
 #include "solib.h"
 #include "solib-svr4.h"
-#include "solist.h"
 #include "symfile.h"
 
 #include <unordered_map>
index 4c0a8a1246ec885a2fb68be2213ddf1b23e53d46..4aa30858df5f2c8e859ee9ea91d8d67b94d098a3 100644 (file)
@@ -35,7 +35,6 @@
 #include "regcache.h"
 #include "observable.h"
 
-#include "solist.h"
 #include "solib.h"
 #include "solib-svr4.h"
 
@@ -951,7 +950,7 @@ svr4_keep_data_in_core (CORE_ADDR vaddr, unsigned long size)
   return (name_lm >= vaddr && name_lm < vaddr + size);
 }
 
-/* See solist.h.  */
+/* See solib.h.  */
 
 static int
 open_symbol_file_object (int from_tty)
index d75d731d0aeb0d27b7c37130655b6c73f5da720b..0a04d9c2ee668bee3cf1783a4598c53458f95ef5 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef GDB_SOLIB_SVR4_H
 #define GDB_SOLIB_SVR4_H
 
-#include "solist.h"
+#include "solib.h"
 
 struct objfile;
 struct solib_ops;
index 384282441e4be96cc78be47acb35a6c10d23366e..41a7f8eb68f7c496132ee76b9bcd6ef2599cfff1 100644 (file)
@@ -18,7 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "objfiles.h"
-#include "solist.h"
+#include "solib.h"
 #include "symtab.h"
 #include "symfile.h"
 #include "target.h"
index a73f6b9315c0625d73b0d04301c1c2a4a38ae73d..1a105bd7cb9b057f11b643a2634b526999fec4d1 100644 (file)
@@ -37,7 +37,6 @@
 #include "elf/common.h"
 #include "filenames.h"
 #include "exec.h"
-#include "solist.h"
 #include "observable.h"
 #include "readline/tilde.h"
 #include "solib.h"
@@ -582,7 +581,7 @@ solib_map_sections (solib &so)
   return 1;
 }
 
-/* See solist.h.  */
+/* See solib.h.  */
 
 void
 solib::clear ()
index e10f7cf6c7a1b9403a0d2d778f1bf3c93cae6b0e..4955eedd629cfe3cac623f9e797835fa65358a46 100644 (file)
 #ifndef GDB_SOLIB_H
 #define GDB_SOLIB_H
 
-/* Forward decl's for prototypes */
-struct solib;
-struct target_ops;
-struct solib_ops;
-struct program_space;
-
 #include "gdb_bfd.h"
-#include "symfile-add-flags.h"
 #include "gdbsupport/function-view.h"
+#include "gdbsupport/intrusive_list.h"
+#include "gdbsupport/owning_intrusive_list.h"
+#include "symfile-add-flags.h"
+#include "target-section.h"
+
+struct program_space;
 
 /* Value of the 'set debug solib' configuration variable.  */
 
@@ -42,6 +41,201 @@ extern bool debug_solib;
 #define SOLIB_SCOPED_DEBUG_START_END(fmt, ...) \
   scoped_debug_start_end (debug_solib, "solib", fmt, ##__VA_ARGS__)
 
+#define SO_NAME_MAX_PATH_SIZE 512   /* FIXME: Should be dynamic */
+
+/* Base class for target-specific link map information.  */
+
+struct lm_info
+{
+  lm_info () = default;
+  lm_info (const lm_info &) = default;
+  virtual ~lm_info () = 0;
+};
+
+using lm_info_up = std::unique_ptr<lm_info>;
+
+struct solib : intrusive_list_node<solib>
+{
+  /* Free symbol-file related contents of SO and reset for possible reloading
+     of SO.  If we have opened a BFD for SO, close it.  If we have placed SO's
+     sections in some target's section table, the caller is responsible for
+     removing them.
+
+     This function doesn't mess with objfiles at all.  If there is an
+     objfile associated with SO that needs to be removed, the caller is
+     responsible for taking care of that.  */
+  void clear () ;
+
+  /* The following fields of the structure come directly from the
+     dynamic linker's tables in the inferior, and are initialized by
+     current_sos.  */
+
+  /* A pointer to target specific link map information.  Often this
+     will be a copy of struct link_map from the user process, but
+     it need not be; it can be any collection of data needed to
+     traverse the dynamic linker's data structures.  */
+  lm_info_up lm_info;
+
+  /* Shared object file name, exactly as it appears in the
+     inferior's link map.  This may be a relative path, or something
+     which needs to be looked up in LD_LIBRARY_PATH, etc.  We use it
+     to tell which entries in the inferior's dynamic linker's link
+     map we've already loaded.  */
+  std::string original_name;
+
+  /* Shared object file name, expanded to something GDB can open.  */
+  std::string name;
+
+  /* The following fields of the structure are built from
+     information gathered from the shared object file itself, and
+     are set when we actually add it to our symbol tables.
+
+     current_sos must initialize these fields to 0.  */
+
+  gdb_bfd_ref_ptr abfd;
+
+  /* True if symbols have been read in.  */
+  bool symbols_loaded = false;
+
+  /* objfile with symbols for a loaded library.  Target memory is read from
+     ABFD.  OBJFILE may be NULL either before symbols have been loaded, if
+     the file cannot be found or after the command "nosharedlibrary".  */
+  struct objfile *objfile = nullptr;
+
+  std::vector<target_section> sections;
+
+  /* Record the range of addresses belonging to this shared library.
+     There may not be just one (e.g. if two segments are relocated
+     differently).  This is used for "info sharedlibrary" and
+     the MI command "-file-list-shared-libraries".  The latter has a format
+     that supports outputting multiple segments once the related code
+     supports them.  */
+  CORE_ADDR addr_low = 0, addr_high = 0;
+};
+
+/* A unique pointer to an solib.  */
+using solib_up = std::unique_ptr<solib>;
+
+struct solib_ops
+{
+  /* Adjust the section binding addresses by the base address at
+     which the object was actually mapped.  */
+  void (*relocate_section_addresses) (solib &so, target_section *);
+
+  /* Reset private data structures associated with SO.
+     This is called when SO is about to be reloaded.
+     It is also called when SO is about to be freed.  */
+  void (*clear_so) (const solib &so);
+
+  /* Free private data structures associated to PSPACE.  This method
+     should not free resources associated to individual solib entries,
+     those are cleared by the clear_so method.  */
+  void (*clear_solib) (program_space *pspace);
+
+  /* Target dependent code to run after child process fork.  */
+  void (*solib_create_inferior_hook) (int from_tty);
+
+  /* Construct a list of the currently loaded shared objects.  This
+     list does not include an entry for the main executable file.
+
+     Note that we only gather information directly available from the
+     inferior --- we don't examine any of the shared library files
+     themselves.  The declaration of `struct solib' says which fields
+     we provide values for.  */
+  owning_intrusive_list<solib> (*current_sos) ();
+
+  /* Find, open, and read the symbols for the main executable.  If
+     FROM_TTY is non-zero, allow messages to be printed.  */
+  int (*open_symbol_file_object) (int from_ttyp);
+
+  /* Determine if PC lies in the dynamic symbol resolution code of
+     the run time loader.  */
+  int (*in_dynsym_resolve_code) (CORE_ADDR pc);
+
+  /* Find and open shared library binary file.  */
+  gdb_bfd_ref_ptr (*bfd_open) (const char *pathname);
+
+  /* Given two solib objects, one from the GDB thread list
+     and another from the list returned by current_sos, return 1
+     if they represent the same library.
+     Falls back to using strcmp on ORIGINAL_NAME when set to nullptr.  */
+  int (*same) (const solib &gdb, const solib &inferior);
+
+  /* Return whether a region of memory must be kept in a core file
+     for shared libraries loaded before "gcore" is used to be
+     handled correctly when the core file is loaded.  This only
+     applies when the section would otherwise not be kept in the
+     core file (in particular, for readonly sections).  */
+  int (*keep_data_in_core) (CORE_ADDR vaddr,
+                           unsigned long size);
+
+  /* Enable or disable optional solib event breakpoints as
+     appropriate.  This should be called whenever
+     stop_on_solib_events is changed.  This pointer can be
+     NULL, in which case no enabling or disabling is necessary
+     for this target.  */
+  void (*update_breakpoints) (void);
+
+  /* Target-specific processing of solib events that will be
+     performed before solib_add is called.  This pointer can be
+     NULL, in which case no specific preprocessing is necessary
+     for this target.  */
+  void (*handle_event) (void);
+
+  /* Return an address within the inferior's address space which is known
+     to be part of SO.  If there is no such address, or GDB doesn't know
+     how to figure out such an address then an empty optional is
+     returned.
+
+     The returned address can be used when loading the shared libraries
+     for a core file.  GDB knows the build-ids for (some) files mapped
+     into the inferior's address space, and knows the address ranges which
+     those mapped files cover.  If GDB can figure out a representative
+     address for the library then this can be used to match a library to a
+     mapped file, and thus to a build-id.  GDB can then use this
+     information to help locate the shared library objfile, if the objfile
+     is not in the expected place (as defined by the shared libraries file
+     name).  */
+  std::optional<CORE_ADDR> (*find_solib_addr) (solib &so);
+
+  /* Return which linker namespace contains the current so.
+     If the linker or libc does not support linkage namespaces at all
+     (which is basically all of them but solib-svr4), this function should
+     be set to nullptr, so that "info shared" won't add an unnecessary
+     column.
+
+     If the namespace can not be determined (such as when we're stepping
+     though the dynamic linker), this function should throw a
+     gdb_exception_error.  */
+  int (*find_solib_ns) (const solib &so);
+
+  /* Returns the number of active namespaces in the inferior.  */
+  int (*num_active_namespaces) ();
+
+  /* Returns all solibs for a given namespace.  If the namespace is not
+     active, returns an empty vector.  */
+  std::vector<const solib *> (*get_solibs_in_ns) (int ns);
+};
+
+/* Find main executable binary file.  */
+extern gdb::unique_xmalloc_ptr<char> exec_file_find (const char *in_pathname,
+                                                    int *fd);
+
+/* Find shared library binary file.  */
+extern gdb::unique_xmalloc_ptr<char> solib_find (const char *in_pathname,
+                                                int *fd);
+
+/* Open BFD for shared library file.  */
+extern gdb_bfd_ref_ptr solib_bfd_fopen (const char *pathname, int fd);
+
+/* Find solib binary file and open it.  */
+extern gdb_bfd_ref_ptr solib_bfd_open (const char *in_pathname);
+
+/* A default implementation of the solib_ops::find_solib_addr callback.
+   This just returns an empty std::optional<CORE_ADDR> indicating GDB is
+   unable to find an address within the library SO.  */
+extern std::optional<CORE_ADDR> default_find_solib_addr (solib &so);
+
 /* Called when we free all symtabs of PSPACE, to free the shared library
    information as well.  */
 
diff --git a/gdb/solist.h b/gdb/solist.h
deleted file mode 100644 (file)
index fa5e4ff..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
-/* Shared library declarations for GDB, the GNU Debugger.
-   Copyright (C) 1990-2025 Free Software Foundation, Inc.
-
-   This file is part of GDB.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#ifndef GDB_SOLIST_H
-#define GDB_SOLIST_H
-
-#define SO_NAME_MAX_PATH_SIZE 512      /* FIXME: Should be dynamic */
-
-/* For domain_enum domain.  */
-#include "symtab.h"
-#include "gdb_bfd.h"
-#include "gdbsupport/owning_intrusive_list.h"
-#include "target-section.h"
-
-/* Base class for target-specific link map information.  */
-
-struct lm_info
-{
-  lm_info () = default;
-  lm_info (const lm_info &) = default;
-  virtual ~lm_info () = 0;
-};
-
-using lm_info_up = std::unique_ptr<lm_info>;
-
-struct solib : intrusive_list_node<solib>
-{
-  /* Free symbol-file related contents of SO and reset for possible reloading
-     of SO.  If we have opened a BFD for SO, close it.  If we have placed SO's
-     sections in some target's section table, the caller is responsible for
-     removing them.
-
-     This function doesn't mess with objfiles at all.  If there is an
-     objfile associated with SO that needs to be removed, the caller is
-     responsible for taking care of that.  */
-  void clear () ;
-
-  /* The following fields of the structure come directly from the
-     dynamic linker's tables in the inferior, and are initialized by
-     current_sos.  */
-
-  /* A pointer to target specific link map information.  Often this
-     will be a copy of struct link_map from the user process, but
-     it need not be; it can be any collection of data needed to
-     traverse the dynamic linker's data structures.  */
-  lm_info_up lm_info;
-
-  /* Shared object file name, exactly as it appears in the
-     inferior's link map.  This may be a relative path, or something
-     which needs to be looked up in LD_LIBRARY_PATH, etc.  We use it
-     to tell which entries in the inferior's dynamic linker's link
-     map we've already loaded.  */
-  std::string original_name;
-
-  /* Shared object file name, expanded to something GDB can open.  */
-  std::string name;
-
-  /* The following fields of the structure are built from
-     information gathered from the shared object file itself, and
-     are set when we actually add it to our symbol tables.
-
-     current_sos must initialize these fields to 0.  */
-
-  gdb_bfd_ref_ptr abfd;
-
-  /* True if symbols have been read in.  */
-  bool symbols_loaded = false;
-
-  /* objfile with symbols for a loaded library.  Target memory is read from
-     ABFD.  OBJFILE may be NULL either before symbols have been loaded, if
-     the file cannot be found or after the command "nosharedlibrary".  */
-  struct objfile *objfile = nullptr;
-
-  std::vector<target_section> sections;
-
-  /* Record the range of addresses belonging to this shared library.
-     There may not be just one (e.g. if two segments are relocated
-     differently).  This is used for "info sharedlibrary" and
-     the MI command "-file-list-shared-libraries".  The latter has a format
-     that supports outputting multiple segments once the related code
-     supports them.  */
-  CORE_ADDR addr_low = 0, addr_high = 0;
-};
-
-struct solib_ops
-{
-  /* Adjust the section binding addresses by the base address at
-     which the object was actually mapped.  */
-  void (*relocate_section_addresses) (solib &so, target_section *);
-
-  /* Reset private data structures associated with SO.
-     This is called when SO is about to be reloaded.
-     It is also called when SO is about to be freed.  */
-  void (*clear_so) (const solib &so);
-
-  /* Free private data structures associated to PSPACE.  This method
-     should not free resources associated to individual solib entries,
-     those are cleared by the clear_so method.  */
-  void (*clear_solib) (program_space *pspace);
-
-  /* Target dependent code to run after child process fork.  */
-  void (*solib_create_inferior_hook) (int from_tty);
-
-  /* Construct a list of the currently loaded shared objects.  This
-     list does not include an entry for the main executable file.
-
-     Note that we only gather information directly available from the
-     inferior --- we don't examine any of the shared library files
-     themselves.  The declaration of `struct solib' says which fields
-     we provide values for.  */
-  owning_intrusive_list<solib> (*current_sos) ();
-
-  /* Find, open, and read the symbols for the main executable.  If
-     FROM_TTY is non-zero, allow messages to be printed.  */
-  int (*open_symbol_file_object) (int from_ttyp);
-
-  /* Determine if PC lies in the dynamic symbol resolution code of
-     the run time loader.  */
-  int (*in_dynsym_resolve_code) (CORE_ADDR pc);
-
-  /* Find and open shared library binary file.  */
-  gdb_bfd_ref_ptr (*bfd_open) (const char *pathname);
-
-  /* Given two solib objects, one from the GDB thread list
-     and another from the list returned by current_sos, return 1
-     if they represent the same library.
-     Falls back to using strcmp on ORIGINAL_NAME when set to nullptr.  */
-  int (*same) (const solib &gdb, const solib &inferior);
-
-  /* Return whether a region of memory must be kept in a core file
-     for shared libraries loaded before "gcore" is used to be
-     handled correctly when the core file is loaded.  This only
-     applies when the section would otherwise not be kept in the
-     core file (in particular, for readonly sections).  */
-  int (*keep_data_in_core) (CORE_ADDR vaddr,
-                           unsigned long size);
-
-  /* Enable or disable optional solib event breakpoints as
-     appropriate.  This should be called whenever
-     stop_on_solib_events is changed.  This pointer can be
-     NULL, in which case no enabling or disabling is necessary
-     for this target.  */
-  void (*update_breakpoints) (void);
-
-  /* Target-specific processing of solib events that will be
-     performed before solib_add is called.  This pointer can be
-     NULL, in which case no specific preprocessing is necessary
-     for this target.  */
-  void (*handle_event) (void);
-
-  /* Return an address within the inferior's address space which is known
-     to be part of SO.  If there is no such address, or GDB doesn't know
-     how to figure out such an address then an empty optional is
-     returned.
-
-     The returned address can be used when loading the shared libraries
-     for a core file.  GDB knows the build-ids for (some) files mapped
-     into the inferior's address space, and knows the address ranges which
-     those mapped files cover.  If GDB can figure out a representative
-     address for the library then this can be used to match a library to a
-     mapped file, and thus to a build-id.  GDB can then use this
-     information to help locate the shared library objfile, if the objfile
-     is not in the expected place (as defined by the shared libraries file
-     name).  */
-
-  std::optional<CORE_ADDR> (*find_solib_addr) (solib &so);
-
-  /* Return which linker namespace contains the current so.
-     If the linker or libc does not support linkage namespaces at all
-     (which is basically all of them but solib-svr4), this function should
-     be set to nullptr, so that "info shared" won't add an unnecessary
-     column.
-
-     If the namespace can not be determined (such as when we're stepping
-     though the dynamic linker), this function should throw a
-     gdb_exception_error.  */
-  int (*find_solib_ns) (const solib &so);
-
-  /* Returns the number of active namespaces in the inferior.  */
-  int (*num_active_namespaces) ();
-
-  /* Returns all solibs for a given namespace.  If the namespace is not
-     active, returns an empty vector.  */
-  std::vector<const solib *> (*get_solibs_in_ns) (int ns);
-};
-
-/* A unique pointer to an solib.  */
-using solib_up = std::unique_ptr<solib>;
-
-/* Find main executable binary file.  */
-extern gdb::unique_xmalloc_ptr<char> exec_file_find (const char *in_pathname,
-                                                    int *fd);
-
-/* Find shared library binary file.  */
-extern gdb::unique_xmalloc_ptr<char> solib_find (const char *in_pathname,
-                                                int *fd);
-
-/* Open BFD for shared library file.  */
-extern gdb_bfd_ref_ptr solib_bfd_fopen (const char *pathname, int fd);
-
-/* Find solib binary file and open it.  */
-extern gdb_bfd_ref_ptr solib_bfd_open (const char *in_pathname);
-
-/* A default implementation of the solib_ops::find_solib_addr callback.
-   This just returns an empty std::optional<CORE_ADDR> indicating GDB is
-   unable to find an address within the library SO.  */
-extern std::optional<CORE_ADDR> default_find_solib_addr (solib &so);
-
-#endif /* GDB_SOLIST_H */
index bbcbb8ae298475aa588e30396c29c18a2adc181f..241c32973aaa05c89cdcd2e88bcff96e4bad7c84 100644 (file)
@@ -60,7 +60,6 @@
 #include "cp-abi.h"
 #include "cp-support.h"
 #include "observable.h"
-#include "solist.h"
 #include "macrotab.h"
 #include "macroscope.h"
 
index 8d9f0033225f81fe6156ba335759f83403aac157..4f48e15b7ebe23f039acdca7c470fbe6f29a11f5 100644 (file)
@@ -54,7 +54,6 @@
 #include "top.h"
 #include "ui.h"
 #include "main.h"
-#include "solist.h"
 
 #include "inferior.h"
 
index 0fee4ad5866e63b4fd60267b64e41c8d08cfbbab..461d9eb9af5d631dea8425498c70508e22b4e466 100644 (file)
@@ -56,7 +56,6 @@
 #include "cli/cli-style.h"
 #include <unistd.h>
 #include "exec.h"
-#include "solist.h"
 #include "solib.h"
 #include "xml-support.h"
 #include "inttypes.h"
index 0ba14723a53947871ba89dad903f98a992c085e9..d8858a7f1450f78caa9a1f439856838851738b20 100644 (file)
@@ -36,7 +36,6 @@
 #include "gdbcore.h"
 #include "coff/internal.h"
 #include "libcoff.h"
-#include "solist.h"
 
 #define CYGWIN_DLL_NAME "cygwin1.dll"