diff options
Diffstat (limited to 'gdb/solib-dsbt.c')
-rw-r--r-- | gdb/solib-dsbt.c | 63 |
1 files changed, 32 insertions, 31 deletions
diff --git a/gdb/solib-dsbt.c b/gdb/solib-dsbt.c index 2b31536..f18d9a2 100644 --- a/gdb/solib-dsbt.c +++ b/gdb/solib-dsbt.c @@ -120,6 +120,25 @@ struct dbst_ext_link_map ext_ptr l_next, l_prev; /* struct link_map *l_next, *l_prev; */ }; +/* solib_ops for DSBT systems. */ + +struct dsbt_solib_ops : public solib_ops +{ + void relocate_section_addresses (solib &so, target_section *) const override; + void clear_solib (program_space *pspace) const override; + void create_inferior_hook (int from_tty) const override; + owning_intrusive_list<solib> current_sos () const override; + bool in_dynsym_resolve_code (CORE_ADDR pc) const override; +}; + +/* See solib-dsbt.h. */ + +solib_ops_up +make_dsbt_solib_ops () +{ + return std::make_unique<dsbt_solib_ops> (); +} + /* Link map info to include in an allocated solib entry */ struct lm_info_dsbt final : public lm_info @@ -502,8 +521,8 @@ lm_base (void) themselves. The declaration of `struct solib' says which fields we provide values for. */ -static owning_intrusive_list<solib> -dsbt_current_sos (void) +owning_intrusive_list<solib> +dsbt_solib_ops::current_sos () const { bfd_endian byte_order = gdbarch_byte_order (current_inferior ()->arch ()); CORE_ADDR lm_addr; @@ -584,7 +603,7 @@ dsbt_current_sos (void) break; } - auto &sop = sos.emplace_back (); + auto &sop = sos.emplace_back (*this); auto li = std::make_unique<lm_info_dsbt> (); li->map = loadmap; /* Fetch the name. */ @@ -623,8 +642,8 @@ dsbt_current_sos (void) /* Return true if PC lies in the dynamic symbol resolution code of the run time loader. */ -static bool -dsbt_in_dynsym_resolve_code (CORE_ADDR pc) +bool +dsbt_solib_ops::in_dynsym_resolve_code (CORE_ADDR pc) const { dsbt_info *info = get_dsbt_info (current_program_space); @@ -840,8 +859,8 @@ dsbt_relocate_main_executable (void) For the DSBT shared library, the main executable needs to be relocated. The shared library breakpoints also need to be enabled. */ -static void -dsbt_solib_create_inferior_hook (int from_tty) +void +dsbt_solib_ops::create_inferior_hook (int from_tty) const { /* Relocate main executable. */ dsbt_relocate_main_executable (); @@ -854,8 +873,8 @@ dsbt_solib_create_inferior_hook (int from_tty) } } -static void -dsbt_clear_solib (program_space *pspace) +void +dsbt_solib_ops::clear_solib (program_space *pspace) const { dsbt_info *info = get_dsbt_info (pspace); @@ -866,8 +885,9 @@ dsbt_clear_solib (program_space *pspace) info->main_executable_lm_info = NULL; } -static void -dsbt_relocate_section_addresses (solib &so, target_section *sec) +void +dsbt_solib_ops::relocate_section_addresses (solib &so, + target_section *sec) const { int seg; auto *li = gdb::checked_static_cast<lm_info_dsbt *> (so.lm_info.get ()); @@ -893,26 +913,7 @@ show_dsbt_debug (struct ui_file *file, int from_tty, gdb_printf (file, _("solib-dsbt debugging is %s.\n"), value); } -const solib_ops dsbt_so_ops = -{ - dsbt_relocate_section_addresses, - nullptr, - dsbt_clear_solib, - dsbt_solib_create_inferior_hook, - dsbt_current_sos, - nullptr, - dsbt_in_dynsym_resolve_code, - solib_bfd_open, - nullptr, - nullptr, - nullptr, - nullptr, - default_find_solib_addr, -}; - -void _initialize_dsbt_solib (); -void -_initialize_dsbt_solib () +INIT_GDB_FILE (dsbt_solib) { /* Debug this file's internals. */ add_setshow_zuinteger_cmd ("solib-dsbt", class_maintenance, |