diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2024-02-05 15:18:33 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2024-02-05 16:10:15 -0500 |
commit | 7b323785ef83a7d6f023909fe21b7983651c3f27 (patch) | |
tree | b1833dfb62b268955f3be8af5aa7493e9ad92c15 /gdb | |
parent | 68d3bf7d246321407697aeb036036dae1a99a742 (diff) | |
download | gdb-7b323785ef83a7d6f023909fe21b7983651c3f27.zip gdb-7b323785ef83a7d6f023909fe21b7983651c3f27.tar.gz gdb-7b323785ef83a7d6f023909fe21b7983651c3f27.tar.bz2 |
gdb: rename struct shobj -> struct solib
`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>
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/break-catch-load.c | 2 | ||||
-rw-r--r-- | gdb/breakpoint.c | 4 | ||||
-rw-r--r-- | gdb/bsd-uthread.c | 4 | ||||
-rw-r--r-- | gdb/hppa-tdep.c | 2 | ||||
-rw-r--r-- | gdb/hppa-tdep.h | 4 | ||||
-rw-r--r-- | gdb/interps.c | 4 | ||||
-rw-r--r-- | gdb/interps.h | 10 | ||||
-rw-r--r-- | gdb/mi/mi-cmd-file.c | 2 | ||||
-rw-r--r-- | gdb/mi/mi-interp.c | 6 | ||||
-rw-r--r-- | gdb/mi/mi-interp.h | 6 | ||||
-rw-r--r-- | gdb/nto-tdep.c | 4 | ||||
-rw-r--r-- | gdb/nto-tdep.h | 2 | ||||
-rw-r--r-- | gdb/observable.h | 6 | ||||
-rw-r--r-- | gdb/progspace.c | 2 | ||||
-rw-r--r-- | gdb/progspace.h | 8 | ||||
-rw-r--r-- | gdb/solib-aix.c | 12 | ||||
-rw-r--r-- | gdb/solib-darwin.c | 10 | ||||
-rw-r--r-- | gdb/solib-dsbt.c | 12 | ||||
-rw-r--r-- | gdb/solib-frv.c | 14 | ||||
-rw-r--r-- | gdb/solib-rocm.c | 16 | ||||
-rw-r--r-- | gdb/solib-svr4.c | 46 | ||||
-rw-r--r-- | gdb/solib-target.c | 10 | ||||
-rw-r--r-- | gdb/solib.c | 44 | ||||
-rw-r--r-- | gdb/solib.h | 6 | ||||
-rw-r--r-- | gdb/solist.h | 14 | ||||
-rw-r--r-- | gdb/target-section.h | 8 |
26 files changed, 129 insertions, 129 deletions
diff --git a/gdb/break-catch-load.c b/gdb/break-catch-load.c index b2106ac8..9582a7c 100644 --- a/gdb/break-catch-load.c +++ b/gdb/break-catch-load.c @@ -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) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 1173b6e..7d1171e 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -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; diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c index 5a4c84d..10e2ca5 100644 --- a/gdb/bsd-uthread.c +++ b/gdb/bsd-uthread.c @@ -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; diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 76e13a6..32e46b8 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -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; diff --git a/gdb/hppa-tdep.h b/gdb/hppa-tdep.h index b0b68f8..2372dd6 100644 --- a/gdb/hppa-tdep.h +++ b/gdb/hppa-tdep.h @@ -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; diff --git a/gdb/interps.c b/gdb/interps.c index 391fea1..8e9570e 100644 --- a/gdb/interps.c +++ b/gdb/interps.c @@ -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); } diff --git a/gdb/interps.h b/gdb/interps.h index b602e0e..bd435d7 100644 --- a/gdb/interps.h +++ b/gdb/interps.h @@ -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. diff --git a/gdb/mi/mi-cmd-file.c b/gdb/mi/mi-cmd-file.c index 91e5272..95128a9 100644 --- a/gdb/mi/mi-cmd-file.c +++ b/gdb/mi/mi-cmd-file.c @@ -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; diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c index 21d5305..38ae227 100644 --- a/gdb/mi/mi-interp.c +++ b/gdb/mi/mi-interp.c @@ -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 (); diff --git a/gdb/mi/mi-interp.h b/gdb/mi/mi-interp.h index 9bb6b95..cd48fcf 100644 --- a/gdb/mi/mi-interp.h +++ b/gdb/mi/mi-interp.h @@ -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. */ diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c index a86d3e7..a164592 100644 --- a/gdb/nto-tdep.c +++ b/gdb/nto-tdep.c @@ -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 diff --git a/gdb/nto-tdep.h b/gdb/nto-tdep.h index 7289d6a..249a4f6 100644 --- a/gdb/nto-tdep.h +++ b/gdb/nto-tdep.h @@ -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 *); diff --git a/gdb/observable.h b/gdb/observable.h index 963af57..0e92269 100644 --- a/gdb/observable.h +++ b/gdb/observable.h @@ -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; diff --git a/gdb/progspace.c b/gdb/progspace.c index cc17da3..cda0f41 100644 --- a/gdb/progspace.c +++ b/gdb/progspace.c @@ -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 ()) diff --git a/gdb/progspace.h b/gdb/progspace.h index cf24ba7..e3ade51 100644 --- a/gdb/progspace.h +++ b/gdb/progspace.h @@ -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. */ diff --git a/gdb/solib-aix.c b/gdb/solib-aix.c index dfde05a..70bfe25 100644 --- a/gdb/solib-aix.c +++ b/gdb/solib-aix.c @@ -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]; diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c index 707e389..27d4546 100644 --- a/gdb/solib-darwin.c +++ b/gdb/solib-darwin.c @@ -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 ()); diff --git a/gdb/solib-dsbt.c b/gdb/solib-dsbt.c index 813b9d1..d90bb75 100644 --- a/gdb/solib-dsbt.c +++ b/gdb/solib-dsbt.c @@ -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 ()); diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c index dd6785c..9a098f7 100644 --- a/gdb/solib-frv.c +++ b/gdb/solib-frv.c @@ -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 ()); diff --git a/gdb/solib-rocm.c b/gdb/solib-rocm.c index 58689a3..f4538c1 100644 --- a/gdb/solib-rocm.c +++ b/gdb/solib-rocm.c @@ -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; diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 45d1d5f..eb726a2 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -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; diff --git a/gdb/solib-target.c b/gdb/solib-target.c index ef2bf82..5e46adc 100644 --- a/gdb/solib-target.c +++ b/gdb/solib-target.c @@ -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 ()); diff --git a/gdb/solib.c b/gdb/solib.c index d33880a..be9ec3d 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -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; } diff --git a/gdb/solib.h b/gdb/solib.h index 0fb47e0..d267e3f 100644 --- a/gdb/solib.h +++ b/gdb/solib.h @@ -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 diff --git a/gdb/solist.h b/gdb/solist.h index 6e93d0f..b485d37 100644 --- a/gdb/solist.h +++ b/gdb/solist.h @@ -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, diff --git a/gdb/target-section.h b/gdb/target-section.h index 151145b..d7cea4f 100644 --- a/gdb/target-section.h +++ b/gdb/target-section.h @@ -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; }; |