diff options
Diffstat (limited to 'gdb/solib-svr4.h')
-rw-r--r-- | gdb/solib-svr4.h | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/gdb/solib-svr4.h b/gdb/solib-svr4.h index 7235fd9..7b38ff4 100644 --- a/gdb/solib-svr4.h +++ b/gdb/solib-svr4.h @@ -34,6 +34,10 @@ struct svr4_so; struct lm_info_svr4 final : public lm_info { + explicit lm_info_svr4 (CORE_ADDR debug_base) + : debug_base (debug_base) + {} + /* Amount by which addresses in the binary should be relocated to match the inferior. The direct inferior value is L_ADDR_INFERIOR. When prelinking is involved and the prelink base address changes, @@ -49,6 +53,18 @@ struct lm_info_svr4 final : public lm_info /* Values read in from inferior's fields of the same name. */ CORE_ADDR l_ld = 0, l_next = 0, l_prev = 0, l_name = 0; + + /* The address of the dynamic linker structure (r_debug) this solib comes + from. This identifies which namespace this library is in. + + This field can be 0 in the following situations: + + - we receive the libraries through XML from an old gdbserver that + doesn't include the "lmid" field + - the default debug base is not yet known + + In other cases, this field should have a sensible value. */ + CORE_ADDR debug_base; }; using lm_info_svr4_up = std::unique_ptr<lm_info_svr4>; @@ -78,6 +94,8 @@ enum probe_action struct svr4_solib_ops : public solib_ops { + using solib_ops::solib_ops; + void relocate_section_addresses (solib &so, target_section *) const override; void clear_so (const solib &so) const override; void clear_solib (program_space *pspace) const override; @@ -94,6 +112,9 @@ struct svr4_solib_ops : public solib_ops int find_solib_ns (const solib &so) const override; int num_active_namespaces () const override; std::vector<const solib *> get_solibs_in_ns (int nsid) const override; + void iterate_over_objfiles_in_search_order + (iterate_over_objfiles_in_search_order_cb_ftype cb, + objfile *current_objfile) const override; /* Return the appropriate link map offsets table for the architecture. */ virtual link_map_offsets *fetch_link_map_offsets () const = 0; @@ -116,8 +137,9 @@ private: CORE_ADDR find_r_ldsomap (svr4_info *info) const; owning_intrusive_list<solib> default_sos (svr4_info *info) const; int read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, - std::vector<svr4_so> &sos, int ignore_first) const; - lm_info_svr4_up read_lm_info (CORE_ADDR lm_addr) const; + CORE_ADDR debug_base, std::vector<svr4_so> &sos, + int ignore_first) const; + lm_info_svr4_up read_lm_info (CORE_ADDR lm_addr, CORE_ADDR debug_base) const; int has_lm_dynamic_from_link_map () const; CORE_ADDR lm_addr_check (const solib &so, bfd *abfd) const; CORE_ADDR read_r_next (CORE_ADDR debug_base) const; @@ -131,12 +153,18 @@ private: int update_incremental (svr4_info *info, CORE_ADDR debug_base, CORE_ADDR lm) const; bool update_event_breakpoint (breakpoint *b) const; + + /* Return the base address of the dynamic linker structure for the default + namespace. */ + CORE_ADDR default_debug_base (svr4_info *info, bool *changed = nullptr) const; }; /* solib_ops for ILP32 SVR4 systems. */ struct ilp32_svr4_solib_ops : public svr4_solib_ops { + using svr4_solib_ops::svr4_solib_ops; + link_map_offsets *fetch_link_map_offsets () const override; }; @@ -192,11 +220,11 @@ extern CORE_ADDR svr4_fetch_objfile_link_map (struct objfile *objfile); /* Return a new solib_ops for ILP32 SVR4 systems. */ -extern solib_ops_up make_svr4_ilp32_solib_ops (); +extern solib_ops_up make_svr4_ilp32_solib_ops (program_space *pspace); /* Return a new solib_ops for LP64 SVR4 systems. */ -extern solib_ops_up make_svr4_lp64_solib_ops (); +extern solib_ops_up make_svr4_lp64_solib_ops (program_space *pspace); /* For the MUSL C library, given link map address LM_ADDR, return the corresponding TLS module id, or 0 if not found. */ |