]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: rename struct shobj -> struct solib
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 5 Feb 2024 20:18:33 +0000 (15:18 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 5 Feb 2024 21:10:15 +0000 (16:10 -0500)
`struct so_list` was recently renamed to `struct shobj` (in 3fe0dfd1604f
("gdb: rename struct so_list to shobj")).  In hindsight, `solib` would
have been a better name.  We have solib.c, the implementations in
solib-*.c, many functions with solib in their name, the solib_loaded /
solib_unloaded observables, etc.

Rename shobj to solib.

Change-Id: I0af1c7a9b29bdda027e9af633f6d37e1cfcacd5d
Approved-By: Tom Tromey <tom@tromey.com>
26 files changed:
gdb/break-catch-load.c
gdb/breakpoint.c
gdb/bsd-uthread.c
gdb/hppa-tdep.c
gdb/hppa-tdep.h
gdb/interps.c
gdb/interps.h
gdb/mi/mi-cmd-file.c
gdb/mi/mi-interp.c
gdb/mi/mi-interp.h
gdb/nto-tdep.c
gdb/nto-tdep.h
gdb/observable.h
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-target.c
gdb/solib.c
gdb/solib.h
gdb/solist.h
gdb/target-section.h

index b2106ac84de86ba62846cf65ffc4e9a5778b82fd..9582a7ccaad4bd9950e5b1630010baeb9ab935a3 100644 (file)
@@ -117,7 +117,7 @@ solib_catchpoint::check_status (struct bpstat *bs)
 {
   if (is_load)
     {
-      for (shobj *iter : current_program_space->added_solibs)
+      for (solib *iter : current_program_space->added_solibs)
        {
          if (!regex
              || compiled->exec (iter->so_name.c_str (), 0, nullptr, 0) == 0)
index 1173b6e3d6027b691dbfa68e095445f651c33115..7d1171ec35eb2091902721b5535c75f588a5f7dc 100644 (file)
@@ -5044,7 +5044,7 @@ print_solib_event (bool is_catchpoint)
       current_uiout->text (_("  Inferior loaded "));
       ui_out_emit_list list_emitter (current_uiout, "added");
       bool first = true;
-      for (shobj *iter : current_program_space->added_solibs)
+      for (solib *iter : current_program_space->added_solibs)
        {
          if (!first)
            current_uiout->text ("    ");
@@ -8019,7 +8019,7 @@ disable_breakpoints_in_shlibs (void)
    disabled ones can just stay disabled.  */
 
 static void
-disable_breakpoints_in_unloaded_shlib (program_space *pspace, const shobj &solib)
+disable_breakpoints_in_unloaded_shlib (program_space *pspace, const solib &solib)
 {
   bool disabled_shlib_breaks = false;
 
index 5a4c84d7ce69aa321f5c19cec98d66771f895b70..10e2ca5939e7a1b353ecd82528d108e11a743969 100644 (file)
@@ -275,7 +275,7 @@ static const char * const bsd_uthread_solib_names[] =
 };
 
 static void
-bsd_uthread_solib_loaded (shobj &so)
+bsd_uthread_solib_loaded (solib &so)
 {
   const char * const *names = bsd_uthread_solib_names;
 
@@ -295,7 +295,7 @@ bsd_uthread_solib_loaded (shobj &so)
 }
 
 static void
-bsd_uthread_solib_unloaded (program_space *pspace, const shobj &so)
+bsd_uthread_solib_unloaded (program_space *pspace, const solib &so)
 {
   if (bsd_uthread_solib_name.empty ())
     return;
index 76e13a6b52f364b339a20e1138acf2dbb7ed2d5c..32e46b831cbc55217e99ccb06362f32c9ce72995 100644 (file)
@@ -71,7 +71,7 @@ struct hppa_unwind_info
 struct hppa_objfile_private
   {
     struct hppa_unwind_info *unwind_info = nullptr;    /* a pointer */
-    shobj *so_info = nullptr;                  /* a pointer  */
+    solib *so_info = nullptr;                  /* a pointer  */
     CORE_ADDR dp = 0;
 
     int dummy_call_sequence_reg = 0;
index b0b68f820c8ec09569439018ede218751cf30ba5..2372dd6dd12d5660b7103827381597b645f432f0 100644 (file)
@@ -24,7 +24,7 @@
 
 struct trad_frame_saved_reg;
 struct objfile;
-struct shobj;
+struct solib;
 
 /* Register numbers of various important registers.  */
 
@@ -114,7 +114,7 @@ struct hppa_gdbarch_tdep : gdbarch_tdep_base
 
   /* These are solib-dependent methods.  They are really HPUX only, but
      we don't have a HPUX-specific tdep vector at the moment.  */
-  CORE_ADDR (*solib_thread_start_addr) (shobj *so) = nullptr;
+  CORE_ADDR (*solib_thread_start_addr) (solib *so) = nullptr;
   CORE_ADDR (*solib_get_got_by_pc) (CORE_ADDR addr) = nullptr;
   CORE_ADDR (*solib_get_solib_by_pc) (CORE_ADDR addr) = nullptr;
   CORE_ADDR (*solib_get_text_base) (struct objfile *objfile) = nullptr;
index 391fea1da038565d3dc2d3d8a67ada2f1c80fd05..8e9570ecb1ebe47361d68bf3bcb4a1a8e9f0ed18 100644 (file)
@@ -487,7 +487,7 @@ interps_notify_target_resumed (ptid_t ptid)
 /* See interps.h.  */
 
 void
-interps_notify_solib_loaded (const shobj &so)
+interps_notify_solib_loaded (const solib &so)
 {
   interps_notify (&interp::on_solib_loaded, so);
 }
@@ -495,7 +495,7 @@ interps_notify_solib_loaded (const shobj &so)
 /* See interps.h.  */
 
 void
-interps_notify_solib_unloaded (const shobj &so)
+interps_notify_solib_unloaded (const solib &so)
 {
   interps_notify (&interp::on_solib_unloaded, so);
 }
index b602e0e20ce14724609ea16a0d770266794f69a6..bd435d734afcc042bc3d29e039d9a8f26c5ffd69 100644 (file)
@@ -31,7 +31,7 @@ struct ui;
 class completion_tracker;
 struct thread_info;
 struct inferior;
-struct shobj;
+struct solib;
 struct trace_state_variable;
 
 typedef struct interp *(*interp_factory_func) (const char *name);
@@ -147,10 +147,10 @@ public:
   virtual void on_target_resumed (ptid_t ptid) {}
 
   /* Notify the interpreter that solib SO has been loaded.  */
-  virtual void on_solib_loaded (const shobj &so) {}
+  virtual void on_solib_loaded (const solib &so) {}
 
   /* Notify the interpreter that solib SO has been unloaded.  */
-  virtual void on_solib_unloaded (const shobj &so) {}
+  virtual void on_solib_unloaded (const solib &so) {}
 
   /* Notify the interpreter that a command it is executing is about to cause
      the inferior to proceed.  */
@@ -324,10 +324,10 @@ extern void interps_notify_record_changed (inferior *inf, int started,
 extern void interps_notify_target_resumed (ptid_t ptid);
 
 /* Notify all interpreters that solib SO has been loaded.  */
-extern void interps_notify_solib_loaded (const shobj &so);
+extern void interps_notify_solib_loaded (const solib &so);
 
 /* Notify all interpreters that solib SO has been unloaded.  */
-extern void interps_notify_solib_unloaded (const shobj &so);
+extern void interps_notify_solib_unloaded (const solib &so);
 
 /* Notify all interpreters that the selected traceframe changed.
 
index 91e5272ac782fb2e7ac7e0f33f477cdf507cf5f9..95128a9ad6dc60e789fb8ad2c09bc8c3fcdda751 100644 (file)
@@ -163,7 +163,7 @@ mi_cmd_file_list_shared_libraries (const char *command,
   /* Print the table header.  */
   ui_out_emit_list list_emitter (uiout, "shared-libraries");
 
-  for (const shobj &so : current_program_space->solibs ())
+  for (const solib &so : current_program_space->solibs ())
     {
       if (so.so_name.empty ())
        continue;
index 21d530554c767724a39aab6a054404d3ffc9c6e2..38ae227690151ca9f4b30e15243e682356810422 100644 (file)
@@ -724,7 +724,7 @@ mi_interp::on_target_resumed (ptid_t ptid)
 /* See mi-interp.h.  */
 
 void
-mi_output_solib_attribs (ui_out *uiout, const shobj &solib)
+mi_output_solib_attribs (ui_out *uiout, const solib &solib)
 {
   gdbarch *gdbarch = current_inferior ()->arch ();
 
@@ -745,7 +745,7 @@ mi_output_solib_attribs (ui_out *uiout, const shobj &solib)
 }
 
 void
-mi_interp::on_solib_loaded (const shobj &solib)
+mi_interp::on_solib_loaded (const solib &solib)
 {
   ui_out *uiout = this->interp_ui_out ();
 
@@ -762,7 +762,7 @@ mi_interp::on_solib_loaded (const shobj &solib)
 }
 
 void
-mi_interp::on_solib_unloaded (const shobj &solib)
+mi_interp::on_solib_unloaded (const solib &solib)
 {
   ui_out *uiout = this->interp_ui_out ();
 
index 9bb6b95031fb365b8faa9a1adec33a778fb6966c..cd48fcf0aa158f682c57eb299cbe67cf83133f29 100644 (file)
@@ -60,8 +60,8 @@ public:
   void on_record_changed (inferior *inf, int started, const char *method,
                          const char *format) override;
   void on_target_resumed (ptid_t ptid) override;
-  void on_solib_loaded (const shobj &so) override;
-  void on_solib_unloaded (const shobj &so) override;
+  void on_solib_loaded (const solib &so) override;
+  void on_solib_unloaded (const solib &so) override;
   void on_about_to_proceed () override;
   void on_traceframe_changed (int tfnum, int tpnum) override;
   void on_tsv_created (const trace_state_variable *tsv) override;
@@ -108,7 +108,7 @@ public:
 
 /* Output the shared object attributes to UIOUT.  */
 
-void mi_output_solib_attribs (ui_out *uiout, const shobj &solib);
+void mi_output_solib_attribs (ui_out *uiout, const solib &solib);
 
 /* Returns the INTERP's data cast as mi_interp if INTERP is an MI, and
    returns NULL otherwise.  */
index a86d3e7b784ceb4a2fbd9ab4fafe7af605839c2f..a16459283f5031914a63d7fc0d7bbc445e8045e8 100644 (file)
@@ -245,7 +245,7 @@ nto_parse_redirection (char *pargv[], const char **pin, const char **pout,
 }
 
 static CORE_ADDR
-lm_addr (const shobj &so)
+lm_addr (const solib &so)
 {
   auto *li = gdb::checked_static_cast<const lm_info_svr4 *> (so.lm_info.get ());
 
@@ -283,7 +283,7 @@ find_load_phdr (bfd *abfd)
 }
 
 void
-nto_relocate_section_addresses (shobj &so, target_section *sec)
+nto_relocate_section_addresses (solib &so, target_section *sec)
 {
   /* Neutrino treats the l_addr base address field in link.h as different than
      the base address in the System V ABI and so the offset needs to be
index 7289d6adc575a1c6f056554b55d79acd7641d48e..249a4f631fe623ba019188608b33d886c4f9725c 100644 (file)
@@ -166,7 +166,7 @@ void nto_init_solib_absolute_prefix (void);
 char **nto_parse_redirection (char *start_argv[], const char **in,
                              const char **out, const char **err);
 
-void nto_relocate_section_addresses (shobj &, target_section *);
+void nto_relocate_section_addresses (solib &, target_section *);
 
 int nto_map_arch_to_cputype (const char *);
 
index 963af57eba200247d7f136747121791205af45d7..0e9226982772a2284a249f380c6a9f9bcc5b623a 100644 (file)
@@ -24,7 +24,7 @@
 #include "target/waitstatus.h"
 
 struct bpstat;
-struct shobj;
+struct solib;
 struct objfile;
 struct thread_info;
 struct inferior;
@@ -99,12 +99,12 @@ extern observable<inferior */* parent_inf */, inferior */* child_inf */,
 /* The shared library specified by SOLIB has been loaded.  Note that
    when gdb calls this observer, the library's symbols probably
    haven't been loaded yet.  */
-extern observable<shobj &/* solib */> solib_loaded;
+extern observable<solib &/* solib */> solib_loaded;
 
 /* The shared library SOLIB has been unloaded from program space PSPACE.
    Note  when gdb calls this observer, the library's symbols have not
    been unloaded yet, and thus are still available.  */
-extern observable<program_space *, const shobj &/* solib */> solib_unloaded;
+extern observable<program_space *, const solib &/* solib */> solib_unloaded;
 
 /* The symbol file specified by OBJFILE has been loaded.  */
 extern observable<struct objfile */* objfile */> new_objfile;
index cc17da3e1d65506a562284158a57ad68c8a88324..cda0f415a3fd697205f4c125b22aba933a8274d8 100644 (file)
@@ -130,7 +130,7 @@ void
 program_space::free_all_objfiles ()
 {
   /* Any objfile reference would become stale.  */
-  for (const shobj &so : current_program_space->solibs ())
+  for (const solib &so : current_program_space->solibs ())
     gdb_assert (so.objfile == NULL);
 
   while (!objfiles_list.empty ())
index cf24ba73364ecdd83846e4200e1000e06fb93e73..e3ade5101f94892e17c1fd5891cbe240d05632e4 100644 (file)
@@ -41,7 +41,7 @@ struct inferior;
 struct exec;
 struct address_space;
 struct program_space;
-struct shobj;
+struct solib;
 
 typedef std::list<std::unique_ptr<objfile>> objfile_list;
 
@@ -291,7 +291,7 @@ struct program_space
   struct objfile *objfile_for_address (CORE_ADDR address);
 
   /* Return the list of  all the solibs in this program space.  */
-  intrusive_list<shobj> &solibs ()
+  intrusive_list<solib> &solibs ()
   { return so_list; }
 
   /* Close and clear exec_bfd.  If we end up with no target sections
@@ -395,14 +395,14 @@ struct program_space
 
   /* List of shared objects mapped into this space.  Managed by
      solib.c.  */
-  intrusive_list<shobj> so_list;
+  intrusive_list<solib> so_list;
 
   /* Number of calls to solib_add.  */
   unsigned int solib_add_generation = 0;
 
   /* When an solib is added, it is also added to this vector.  This
      is so we can properly report solib changes to the user.  */
-  std::vector<shobj *> added_solibs;
+  std::vector<solib *> added_solibs;
 
   /* When an solib is removed, its name is added to this vector.
      This is so we can properly report solib changes to the user.  */
index dfde05ad98197d684c9cbf3c0f60cc8d244ae376..70bfe258e67898d2903c6ce0939d808d05d7faae 100644 (file)
@@ -26,7 +26,7 @@
 #include "xcoffread.h"
 #include "observable.h"
 
-/* Our private data in struct shobj.  */
+/* Our private data in struct solib.  */
 
 struct lm_info_aix final : public lm_info
 {
@@ -311,7 +311,7 @@ solib_aix_bss_data_overlap (bfd *abfd)
 /* Implement the "relocate_section_addresses" target_so_ops method.  */
 
 static void
-solib_aix_relocate_section_addresses (shobj &so, target_section *sec)
+solib_aix_relocate_section_addresses (solib &so, target_section *sec)
 {
   struct bfd_section *bfd_sect = sec->the_bfd_section;
   bfd *abfd = bfd_sect->owner;
@@ -445,7 +445,7 @@ solib_aix_solib_create_inferior_hook (int from_tty)
 
 /* Implement the "current_sos" target_so_ops method.  */
 
-static intrusive_list<shobj>
+static intrusive_list<solib>
 solib_aix_current_sos ()
 {
   std::optional<std::vector<lm_info_aix>> &library_list
@@ -453,14 +453,14 @@ solib_aix_current_sos ()
   if (!library_list.has_value ())
     return {};
 
-  intrusive_list<shobj> sos;
+  intrusive_list<solib> sos;
 
-  /* Build a struct shobj for each entry on the list.
+  /* Build a struct solib for each entry on the list.
      We skip the first entry, since this is the entry corresponding
      to the main executable, not a shared library.  */
   for (int ix = 1; ix < library_list->size (); ix++)
     {
-      shobj *new_solib = new shobj;
+      solib *new_solib = new solib;
       std::string so_name;
 
       lm_info_aix &info = (*library_list)[ix];
index 707e389988f63aa2d803ecb11f2de91f757f49ba..27d4546e5774f9a47c306018d4611433d9c4a00b 100644 (file)
@@ -212,7 +212,7 @@ open_symbol_file_object (int from_tty)
 
 /* Build a list of currently loaded shared objects.  See solib-svr4.c.  */
 
-static intrusive_list<shobj>
+static intrusive_list<solib>
 darwin_current_sos ()
 {
   type *ptr_type
@@ -230,7 +230,7 @@ darwin_current_sos ()
 
   image_info_size = ptr_len * 3;
 
-  intrusive_list<shobj> sos;
+  intrusive_list<solib> sos;
 
   /* Read infos for each solib.
      The first entry was rumored to be the executable itself, but this is not
@@ -271,8 +271,8 @@ darwin_current_sos ()
       if (file_path == nullptr)
        break;
 
-      /* Create and fill the new struct shobj element.  */
-      shobj *newobj = new shobj;
+      /* Create and fill the new struct solib element.  */
+      solib *newobj = new solib;
 
       auto li = std::make_unique<lm_info_darwin> ();
 
@@ -605,7 +605,7 @@ darwin_clear_solib (program_space *pspace)
    Relocate these VMAs according to solib info.  */
 
 static void
-darwin_relocate_section_addresses (shobj &so, target_section *sec)
+darwin_relocate_section_addresses (solib &so, target_section *sec)
 {
   auto *li = gdb::checked_static_cast<lm_info_darwin *> (so.lm_info.get ());
 
index 813b9d1178b96d87fc22ab0ea22ddca978286eee..d90bb7510a3004bdb6335bec1a2183f91ce9880e 100644 (file)
@@ -503,22 +503,22 @@ lm_base (void)
 }
 
 
-/* Build a list of `struct shobj' objects describing the shared
+/* Build a list of `struct solib' objects describing the shared
    objects currently loaded in the inferior.  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 shobj' says which fields
+   themselves.  The declaration of `struct solib' says which fields
    we provide values for.  */
 
-static intrusive_list<shobj>
+static intrusive_list<solib>
 dsbt_current_sos (void)
 {
   bfd_endian byte_order = gdbarch_byte_order (current_inferior ()->arch ());
   CORE_ADDR lm_addr;
   dsbt_info *info = get_dsbt_info (current_program_space);
-  intrusive_list<shobj> sos;
+  intrusive_list<solib> sos;
 
   /* Make sure that the main executable has been relocated.  This is
      required in order to find the address of the global offset table,
@@ -593,7 +593,7 @@ dsbt_current_sos (void)
              break;
            }
 
-         shobj *sop = new shobj;
+         solib *sop = new solib;
          auto li = std::make_unique<lm_info_dsbt> ();
          li->map = loadmap;
          /* Fetch the name.  */
@@ -876,7 +876,7 @@ dsbt_clear_solib (program_space *pspace)
 }
 
 static void
-dsbt_relocate_section_addresses (shobj &so, target_section *sec)
+dsbt_relocate_section_addresses (solib &so, target_section *sec)
 {
   int seg;
   auto *li = gdb::checked_static_cast<lm_info_dsbt *> (so.lm_info.get ());
index dd6785c4bdafc7a8f01463a9305621be99c973f4..9a098f7943f278d3297e79dfc14320b780a49205 100644 (file)
@@ -306,12 +306,12 @@ lm_base (void)
 
 /* Implement the "current_sos" target_so_ops method.  */
 
-static intrusive_list<shobj>
+static intrusive_list<solib>
 frv_current_sos ()
 {
   bfd_endian byte_order = gdbarch_byte_order (current_inferior ()->arch ());
   CORE_ADDR lm_addr, mgot;
-  intrusive_list<shobj> sos;
+  intrusive_list<solib> sos;
 
   /* Make sure that the main executable has been relocated.  This is
      required in order to find the address of the global offset table,
@@ -376,7 +376,7 @@ frv_current_sos ()
              break;
            }
 
-         shobj *sop = new shobj;
+         solib *sop = new solib;
          auto li = std::make_unique<lm_info_frv> ();
          li->map = loadmap;
          li->got_value = got_addr;
@@ -811,7 +811,7 @@ frv_clear_solib (program_space *pspace)
 }
 
 static void
-frv_relocate_section_addresses (shobj &so, target_section *sec)
+frv_relocate_section_addresses (solib &so, target_section *sec)
 {
   int seg;
   auto *li = gdb::checked_static_cast<lm_info_frv *> (so.lm_info.get ());
@@ -852,7 +852,7 @@ main_got (void)
 CORE_ADDR
 frv_fdpic_find_global_pointer (CORE_ADDR addr)
 {
-  for (const shobj &so : current_program_space->solibs ())
+  for (const solib &so : current_program_space->solibs ())
     {
       int seg;
       auto *li = gdb::checked_static_cast<lm_info_frv *> (so.lm_info.get ());
@@ -909,7 +909,7 @@ frv_fdpic_find_canonical_descriptor (CORE_ADDR entry_point)
      in list of shared objects.  */
   if (addr == 0)
     {
-      for (const shobj &so : current_program_space->solibs ())
+      for (const solib &so : current_program_space->solibs ())
        {
          auto *li = gdb::checked_static_cast<lm_info_frv *> (so.lm_info.get ());
 
@@ -1061,7 +1061,7 @@ frv_fetch_objfile_link_map (struct objfile *objfile)
 
   /* The other link map addresses may be found by examining the list
      of shared libraries.  */
-  for (const shobj &so : current_program_space->solibs ())
+  for (const solib &so : current_program_space->solibs ())
     {
       auto *li = gdb::checked_static_cast<lm_info_frv *> (so.lm_info.get ());
 
index 58689a31529251fcc8109f950b722c48a88b4b68..f4538c1540bb9b7259ca2b704a3466706a9e4823 100644 (file)
@@ -172,7 +172,7 @@ get_solib_info (inferior *inf)
 /* Relocate section addresses.  */
 
 static void
-rocm_solib_relocate_section_addresses (shobj &so,
+rocm_solib_relocate_section_addresses (solib &so,
                                       struct target_section *sec)
 {
   if (!is_amdgpu_arch (gdbarch_from_bfd (so.abfd.get ())))
@@ -204,14 +204,14 @@ rocm_solib_handle_event ()
 
 /* Create so_list objects from rocm_so objects in SOS.  */
 
-static intrusive_list<shobj>
+static intrusive_list<solib>
 so_list_from_rocm_sos (const std::vector<rocm_so> &sos)
 {
-  intrusive_list<shobj> dst;
+  intrusive_list<solib> dst;
 
   for (const rocm_so &so : sos)
     {
-      struct shobj *newobj = new struct shobj;
+      solib *newobj = new solib;
       newobj->lm_info = std::make_unique<lm_info_svr4> (*so.lm_info);
 
       newobj->so_name = so.name;
@@ -223,14 +223,14 @@ so_list_from_rocm_sos (const std::vector<rocm_so> &sos)
   return dst;
 }
 
-/* Build a list of `struct shobj' objects describing the shared
+/* Build a list of `struct solib' objects describing the shared
    objects currently loaded in the inferior.  */
 
-static intrusive_list<shobj>
+static intrusive_list<solib>
 rocm_solib_current_sos ()
 {
   /* First, retrieve the host-side shared library list.  */
-  intrusive_list<shobj> sos = svr4_so_ops.current_sos ();
+  intrusive_list<solib> sos = svr4_so_ops.current_sos ();
 
   /* Then, the device-side shared library list.  */
   std::vector<rocm_so> &dev_sos = get_solib_info (current_inferior ())->solib_list;
@@ -238,7 +238,7 @@ rocm_solib_current_sos ()
   if (dev_sos.empty ())
     return sos;
 
-  intrusive_list<shobj> dev_so_list = so_list_from_rocm_sos (dev_sos);
+  intrusive_list<solib> dev_so_list = so_list_from_rocm_sos (dev_sos);
 
   if (sos.empty ())
     return dev_so_list;
index 45d1d5f5d13a5b3c3a5edec0e1d69e5bd356f5f2..eb726a203af65858d448c95a2501b576984550fb 100644 (file)
@@ -186,7 +186,7 @@ svr4_same (const char *gdb_name, const char *inferior_name,
 }
 
 static int
-svr4_same (const shobj &gdb, const shobj &inferior)
+svr4_same (const solib &gdb, const solib &inferior)
 {
   auto *lmg
     = gdb::checked_static_cast<const lm_info_svr4 *> (gdb.lm_info.get ());
@@ -239,7 +239,7 @@ has_lm_dynamic_from_link_map (void)
 }
 
 static CORE_ADDR
-lm_addr_check (const shobj &so, bfd *abfd)
+lm_addr_check (const solib &so, bfd *abfd)
 {
   auto *li = gdb::checked_static_cast<lm_info_svr4 *> (so.lm_info.get ());
 
@@ -980,7 +980,7 @@ svr4_free_objfile_observer (struct objfile *objfile)
 /* Implement target_so_ops.clear_so.  */
 
 static void
-svr4_clear_so (const shobj &so)
+svr4_clear_so (const solib &so)
 {
   auto *li = gdb::checked_static_cast<lm_info_svr4 *> (so.lm_info.get ());
 
@@ -990,14 +990,14 @@ svr4_clear_so (const shobj &so)
 
 /* Create the so_list objects equivalent to the svr4_sos in SOS.  */
 
-static intrusive_list<shobj>
+static intrusive_list<solib>
 so_list_from_svr4_sos (const std::vector<svr4_so> &sos)
 {
-  intrusive_list<shobj> dst;
+  intrusive_list<solib> dst;
 
   for (const svr4_so &so : sos)
     {
-      struct shobj *newobj = new struct shobj;
+      struct solib *newobj = new struct solib;
 
       newobj->so_name = so.name;
       newobj->so_original_name = so.name;
@@ -1183,13 +1183,13 @@ svr4_current_sos_via_xfer_libraries (struct svr4_library_list *list,
 /* If no shared library information is available from the dynamic
    linker, build a fallback list from other sources.  */
 
-static intrusive_list<shobj>
+static intrusive_list<solib>
 svr4_default_sos (svr4_info *info)
 {
   if (!info->debug_loader_offset_p)
     return {};
 
-  shobj *newobj = new shobj;
+  solib *newobj = new solib;
   auto li = std::make_unique<lm_info_svr4> ();
 
   /* Nothing will ever check the other fields if we set l_addr_p.  */
@@ -1200,7 +1200,7 @@ svr4_default_sos (svr4_info *info)
   newobj->so_name = info->debug_loader_name;
   newobj->so_original_name = newobj->so_name;
 
-  intrusive_list<shobj> sos;
+  intrusive_list<solib> sos;
   sos.push_back (*newobj);
 
   return sos;
@@ -1372,10 +1372,10 @@ svr4_current_sos_direct (struct svr4_info *info)
 
 /* Collect sos read and stored by the probes interface.  */
 
-static intrusive_list<shobj>
+static intrusive_list<solib>
 svr4_collect_probes_sos (svr4_info *info)
 {
-  intrusive_list<shobj> res;
+  intrusive_list<solib> res;
 
   for (const auto &tuple : info->solib_lists)
     {
@@ -1389,10 +1389,10 @@ svr4_collect_probes_sos (svr4_info *info)
 /* Implement the main part of the "current_sos" target_so_ops
    method.  */
 
-static intrusive_list<shobj>
+static intrusive_list<solib>
 svr4_current_sos_1 (svr4_info *info)
 {
-  intrusive_list<shobj> sos;
+  intrusive_list<solib> sos;
 
   /* If we're using the probes interface, we can use the cache as it will
      be maintained by probe update/reload actions.  */
@@ -1416,11 +1416,11 @@ svr4_current_sos_1 (svr4_info *info)
 
 /* Implement the "current_sos" target_so_ops method.  */
 
-static intrusive_list<shobj>
+static intrusive_list<solib>
 svr4_current_sos ()
 {
   svr4_info *info = get_svr4_info (current_program_space);
-  intrusive_list<shobj> sos = svr4_current_sos_1 (info);
+  intrusive_list<solib> sos = svr4_current_sos_1 (info);
   struct mem_range vsyscall_range;
 
   /* Filter out the vDSO module, if present.  Its symbol file would
@@ -1507,7 +1507,7 @@ svr4_fetch_objfile_link_map (struct objfile *objfile)
 
   /* The other link map addresses may be found by examining the list
      of shared libraries.  */
-  for (const shobj &so : current_program_space->solibs ())
+  for (const solib &so : current_program_space->solibs ())
     if (so.objfile == objfile)
       {
        auto *li
@@ -2348,7 +2348,7 @@ enable_break (struct svr4_info *info, int from_tty)
 
       /* On a running target, we can get the dynamic linker's base
         address from the shared library table.  */
-      for (const shobj &so : current_program_space->solibs ())
+      for (const solib &so : current_program_space->solibs ())
        {
          if (svr4_same_1 (interp_name, so.so_original_name.c_str ()))
            {
@@ -3096,7 +3096,7 @@ svr4_truncate_ptr (CORE_ADDR addr)
 
 
 static void
-svr4_relocate_section_addresses (shobj &so, target_section *sec)
+svr4_relocate_section_addresses (solib &so, target_section *sec)
 {
   bfd *abfd = sec->the_bfd_section->owner;
 
@@ -3237,7 +3237,7 @@ svr4_lp64_fetch_link_map_offsets (void)
 
 /* Return the DSO matching OBJFILE or nullptr if none can be found.  */
 
-static const shobj *
+static const solib *
 find_solib_for_objfile (struct objfile *objfile)
 {
   if (objfile == nullptr)
@@ -3248,7 +3248,7 @@ find_solib_for_objfile (struct objfile *objfile)
   if (objfile->separate_debug_objfile_backlink != nullptr)
     objfile = objfile->separate_debug_objfile_backlink;
 
-  for (const shobj &so : current_program_space->solibs ())
+  for (const solib &so : current_program_space->solibs ())
     if (so.objfile == objfile)
       return &so;
 
@@ -3263,7 +3263,7 @@ find_solib_for_objfile (struct objfile *objfile)
    right thing for the main executable.  */
 
 static CORE_ADDR
-find_debug_base_for_solib (const shobj *solib)
+find_debug_base_for_solib (const solib *solib)
 {
   if (solib == nullptr)
     return 0;
@@ -3324,7 +3324,7 @@ svr4_iterate_over_objfiles_in_search_order
   /* The linker namespace to iterate identified by the address of its
      r_debug object, defaulting to the initial namespace.  */
   CORE_ADDR initial = elf_locate_base ();
-  const shobj *curr_solib = find_solib_for_objfile (current_objfile);
+  const solib *curr_solib = find_solib_for_objfile (current_objfile);
   CORE_ADDR debug_base = find_debug_base_for_solib (curr_solib);
   if (debug_base == 0)
     debug_base = initial;
@@ -3339,7 +3339,7 @@ svr4_iterate_over_objfiles_in_search_order
         If we fail, e.g. for manually added symbol files or for the main
         executable, we assume that they were added to the initial
         namespace.  */
-      const shobj *solib = find_solib_for_objfile (objfile);
+      const solib *solib = find_solib_for_objfile (objfile);
       CORE_ADDR solib_base = find_debug_base_for_solib (solib);
       if (solib_base == 0)
        solib_base = initial;
index ef2bf82f0a41e6d5729756b2425359f316a10671..5e46adcf224a34931034b19bee6f88c70346c186 100644 (file)
@@ -227,10 +227,10 @@ solib_target_parse_libraries (const char *library)
 }
 #endif
 
-static intrusive_list<shobj>
+static intrusive_list<solib>
 solib_target_current_sos (void)
 {
-  intrusive_list<shobj> sos;
+  intrusive_list<solib> sos;
 
   /* Fetch the list of shared libraries.  */
   std::optional<gdb::char_vector> library_document
@@ -243,10 +243,10 @@ solib_target_current_sos (void)
   std::vector<lm_info_target_up> library_list
     = solib_target_parse_libraries (library_document->data ());
 
-  /* Build a struct shobj for each entry on the list.  */
+  /* Build a struct solib for each entry on the list.  */
   for (lm_info_target_up &info : library_list)
     {
-      shobj *new_solib = new shobj;
+      solib *new_solib = new solib;
 
       /* We don't need a copy of the name in INFO anymore.  */
       new_solib->so_name = std::move (info->name);
@@ -267,7 +267,7 @@ solib_target_solib_create_inferior_hook (int from_tty)
 }
 
 static void
-solib_target_relocate_section_addresses (shobj &so, target_section *sec)
+solib_target_relocate_section_addresses (solib &so, target_section *sec)
 {
   CORE_ADDR offset;
   auto *li = gdb::checked_static_cast<lm_info_target *> (so.lm_info.get ());
index d33880a54e7a887fed53f84fef68c091c6dd169e..be9ec3dde37f92bf92f292ef4201c7ebe0b7fa66 100644 (file)
@@ -539,7 +539,7 @@ get_cbfd_soname_build_id (gdb_bfd_ref_ptr abfd, const char *soname)
    expansion stuff?).  */
 
 static int
-solib_map_sections (shobj &so)
+solib_map_sections (solib &so)
 {
   const target_so_ops *ops = gdbarch_so_ops (current_inferior ()->arch ());
 
@@ -626,7 +626,7 @@ solib_map_sections (shobj &so)
 /* See solist.h.  */
 
 void
-shobj::clear ()
+solib::clear ()
 {
   const target_so_ops *ops = gdbarch_so_ops (current_inferior ()->arch ());
 
@@ -654,7 +654,7 @@ lm_info::~lm_info () = default;
    be chatty about it.  Return true if any symbols were actually loaded.  */
 
 bool
-solib_read_symbols (shobj &so, symfile_add_flags flags)
+solib_read_symbols (solib &so, symfile_add_flags flags)
 {
   if (so.symbols_loaded)
     {
@@ -715,9 +715,9 @@ solib_read_symbols (shobj &so, symfile_add_flags flags)
    in the list of shared libraries.  Return false otherwise.  */
 
 static bool
-solib_used (const shobj &known)
+solib_used (const solib &known)
 {
-  for (const shobj &pivot : current_program_space->solibs ())
+  for (const solib &pivot : current_program_space->solibs ())
     if (&pivot != &known && pivot.objfile == known.objfile)
       return true;
   return false;
@@ -726,7 +726,7 @@ solib_used (const shobj &known)
 /* Notify interpreters and observers that solib SO has been loaded.  */
 
 static void
-notify_solib_loaded (shobj &so)
+notify_solib_loaded (solib &so)
 {
   interps_notify_solib_loaded (so);
   gdb::observers::solib_loaded.notify (so);
@@ -735,7 +735,7 @@ notify_solib_loaded (shobj &so)
 /* Notify interpreters and observers that solib SO has been unloaded.  */
 
 static void
-notify_solib_unloaded (program_space *pspace, const shobj &so)
+notify_solib_unloaded (program_space *pspace, const solib &so)
 {
   interps_notify_solib_unloaded (so);
   gdb::observers::solib_unloaded.notify (pspace, so);
@@ -797,12 +797,12 @@ update_solib_list (int from_tty)
      the time we're done walking GDB's list, the inferior's list
      contains only the new shared objects, which we then add.  */
 
-  intrusive_list<shobj> inferior = ops->current_sos ();
-  intrusive_list<shobj>::iterator gdb_iter
+  intrusive_list<solib> inferior = ops->current_sos ();
+  intrusive_list<solib>::iterator gdb_iter
     = current_program_space->so_list.begin ();
   while (gdb_iter != current_program_space->so_list.end ())
     {
-      intrusive_list<shobj>::iterator inferior_iter = inferior.begin ();
+      intrusive_list<solib>::iterator inferior_iter = inferior.begin ();
 
       /* Check to see whether the shared object *gdb also appears in
         the inferior's current list.  */
@@ -840,7 +840,7 @@ update_solib_list (int from_tty)
 
          current_program_space->deleted_solibs.push_back (gdb_iter->so_name);
 
-         intrusive_list<shobj>::iterator gdb_iter_next
+         intrusive_list<solib>::iterator gdb_iter_next
            = current_program_space->so_list.erase (gdb_iter);
 
          /* Unless the user loaded it explicitly, free SO's objfile.  */
@@ -867,13 +867,13 @@ update_solib_list (int from_tty)
       const char *not_found_filename = NULL;
 
       /* Fill in the rest of each of the `so' nodes.  */
-      for (shobj &new_so : inferior)
+      for (solib &new_so : inferior)
        {
          current_program_space->added_solibs.push_back (&new_so);
 
          try
            {
-             /* Fill in the rest of the `struct shobj' node.  */
+             /* Fill in the rest of the `struct solib' node.  */
              if (!solib_map_sections (new_so))
                {
                  not_found++;
@@ -939,7 +939,7 @@ libpthread_name_p (const char *name)
 /* Return non-zero if SO is the libpthread shared library.  */
 
 static bool
-libpthread_solib_p (const shobj &so)
+libpthread_solib_p (const solib &so)
 {
   return libpthread_name_p (so.so_name.c_str ());
 }
@@ -990,7 +990,7 @@ solib_add (const char *pattern, int from_tty, int readsyms)
     if (from_tty)
        add_flags |= SYMFILE_VERBOSE;
 
-    for (shobj &gdb : current_program_space->solibs ())
+    for (solib &gdb : current_program_space->solibs ())
       if (! pattern || re_exec (gdb.so_name.c_str ()))
        {
          /* Normally, we would read the symbols from that library
@@ -1064,7 +1064,7 @@ info_sharedlibrary_command (const char *pattern, int from_tty)
      so we need to make two passes over the libs.  */
 
   nr_libs = 0;
-  for (const shobj &so : current_program_space->solibs ())
+  for (const solib &so : current_program_space->solibs ())
     {
       if (!so.so_name.empty ())
        {
@@ -1085,7 +1085,7 @@ info_sharedlibrary_command (const char *pattern, int from_tty)
 
     uiout->table_body ();
 
-    for (const shobj &so : current_program_space->solibs ())
+    for (const solib &so : current_program_space->solibs ())
       {
        if (so.so_name.empty ())
          continue;
@@ -1140,7 +1140,7 @@ info_sharedlibrary_command (const char *pattern, int from_tty)
 /* See solib.h.  */
 
 bool
-solib_contains_address_p (const shobj &solib, CORE_ADDR address)
+solib_contains_address_p (const solib &solib, CORE_ADDR address)
 {
   for (const target_section &p : solib.sections)
     if (p.addr <= address && address < p.endaddr)
@@ -1163,7 +1163,7 @@ solib_contains_address_p (const shobj &solib, CORE_ADDR address)
 const char *
 solib_name_from_address (struct program_space *pspace, CORE_ADDR address)
 {
-  for (const shobj &so : pspace->so_list)
+  for (const solib &so : pspace->so_list)
     if (solib_contains_address_p (so, address))
       return so.so_name.c_str ();
 
@@ -1192,7 +1192,7 @@ clear_solib (void)
 
   disable_breakpoints_in_shlibs ();
 
-  current_program_space->so_list.clear_and_dispose ([] (shobj *so)
+  current_program_space->so_list.clear_and_dispose ([] (solib *so)
     {
       notify_solib_unloaded (current_program_space, *so);
       current_program_space->remove_target_sections (so);
@@ -1293,7 +1293,7 @@ reload_shared_libraries_1 (int from_tty)
   if (print_symbol_loading_p (from_tty, 0, 0))
     gdb_printf (_("Loading symbols for shared libraries.\n"));
 
-  for (shobj &so : current_program_space->solibs ())
+  for (solib &so : current_program_space->solibs ())
     {
       const char *found_pathname = NULL;
       bool was_loaded = so.symbols_loaded != 0;
@@ -1702,7 +1702,7 @@ remove_user_added_objfile (struct objfile *objfile)
 {
   if (objfile != 0 && objfile->flags & OBJF_USERLOADED)
     {
-      for (shobj &so : objfile->pspace->solibs ())
+      for (solib &so : objfile->pspace->solibs ())
        if (so.objfile == objfile)
          so.objfile = nullptr;
     }
index 0fb47e014509af41181eed4542c51e447941c360..d267e3fefa4794435cdd630dde76737790338f24 100644 (file)
@@ -21,7 +21,7 @@
 #define SOLIB_H
 
 /* Forward decl's for prototypes */
-struct shobj;
+struct solib;
 struct target_ops;
 struct target_so_ops;
 struct program_space;
@@ -50,7 +50,7 @@ extern void clear_solib (void);
 /* Called to add symbols from a shared library to gdb's symbol table.  */
 
 extern void solib_add (const char *, int, int);
-extern bool solib_read_symbols (shobj &, symfile_add_flags);
+extern bool solib_read_symbols (solib &, symfile_add_flags);
 
 /* Function to be called when the inferior starts up, to discover the
    names of shared libraries that are dynamically linked, the base
@@ -65,7 +65,7 @@ extern const char *solib_name_from_address (struct program_space *, CORE_ADDR);
 
 /* Return true if ADDR lies within SOLIB.  */
 
-extern bool solib_contains_address_p (const shobj &, CORE_ADDR);
+extern bool solib_contains_address_p (const solib &, CORE_ADDR);
 
 /* Return whether the data starting at VADDR, size SIZE, must be kept
    in a core file for shared libraries loaded before "gcore" is used
index 6e93d0ff0174a1dab3666bea3b0854cf2f3d8135..b485d3748800155aa8ac0306e08fe959893d3e3c 100644 (file)
@@ -36,7 +36,7 @@ struct lm_info
 
 using lm_info_up = std::unique_ptr<lm_info>;
 
-struct shobj : intrusive_list_node<shobj>
+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
@@ -97,12 +97,12 @@ struct target_so_ops
 {
   /* Adjust the section binding addresses by the base address at
      which the object was actually mapped.  */
-  void (*relocate_section_addresses) (shobj &so, target_section *);
+  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 shobj &so);
+  void (*clear_so) (const solib &so);
 
   /* Free private data structures associated to PSPACE.  This method
      should not free resources associated to individual so_list entries,
@@ -117,9 +117,9 @@ struct target_so_ops
 
      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 shobj' says which fields
+     themselves.  The declaration of `struct solib' says which fields
      we provide values for.  */
-  intrusive_list<shobj> (*current_sos) ();
+  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.  */
@@ -145,7 +145,7 @@ struct target_so_ops
      if they represent the same library.
      Falls back to using strcmp on so_original_name field when set
      to NULL.  */
-  int (*same) (const shobj &gdb, const shobj &inferior);
+  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
@@ -170,7 +170,7 @@ struct target_so_ops
 };
 
 /* A unique pointer to a so_list.  */
-using shobj_up = std::unique_ptr<shobj>;
+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,
index 151145bf4f975633b87b93417bdad9d79822be91..d7cea4f5f015ae30239ecee06c5c3b359e38debe 100644 (file)
@@ -22,7 +22,7 @@
 
 struct bfd;
 struct objfile;
-struct shobj;
+struct solib;
 
 /* A union representing the possible owner types of a target_section.  */
 
@@ -31,7 +31,7 @@ union target_section_owner
   target_section_owner () : m_v (nullptr) {}
   target_section_owner (const bfd *bfd) : bfd (bfd) {}
   target_section_owner (const objfile *objfile) : objfile (objfile) {}
-  target_section_owner (const shobj *shobj) : shobj (shobj) {}
+  target_section_owner (const solib *solib) : solib (solib) {}
 
   /* Use this to access the type-erased version of the owner, for
      comparisons, printing, etc.  We don't access the M_V member
@@ -46,7 +46,7 @@ union target_section_owner
 
   const struct bfd *bfd;
   const struct objfile *objfile;
-  const struct shobj *shobj;
+  const struct solib *solib;
 
 private:
   const void *m_v;
@@ -79,7 +79,7 @@ struct target_section
 
      It is set by add_target_sections and used by remove_target_sections.
      For example, for executables it is a pointer to exec_bfd and
-     for shlibs it is the shobj pointer.  */
+     for shlibs it is the solib pointer.  */
   target_section_owner owner;
 };