diff options
author | John Baldwin <jhb@FreeBSD.org> | 2019-03-12 13:39:02 -0700 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2019-03-12 13:45:48 -0700 |
commit | 945f3901b5889e57edf5a2ee25acb51f0078a719 (patch) | |
tree | 6f5f49f7bc52cc23fb577de1a84106b81e68c88b /gdb/fbsd-tdep.h | |
parent | ef0bd2046f58fac69577892c2d3b44b20d027476 (diff) | |
download | fsf-binutils-gdb-945f3901b5889e57edf5a2ee25acb51f0078a719.zip fsf-binutils-gdb-945f3901b5889e57edf5a2ee25acb51f0078a719.tar.gz fsf-binutils-gdb-945f3901b5889e57edf5a2ee25acb51f0078a719.tar.bz2 |
Add a helper function to resolve TLS variable addresses for FreeBSD.
The fbsd_get_thread_local_address function accepts the base address of
a thread's DTV array and the base address of an object file's link map
and uses this to compute a TLS variable's address. FreeBSD
architectures use an architecture-specific method to determine the
address of the DTV array pointer and call this helper function to
perform the rest of the address calculation.
* fbsd-tdep.c (fbsd_pspace_data_handle): New variable.
(struct fbsd_pspace_data): New type.
(get_fbsd_pspace_data, fbsd_pspace_data_cleanup)
(fbsd_read_integer_by_name, fbsd_fetch_rtld_offsets)
(fbsd_get_tls_index, fbsd_get_thread_local_address): New function.
(_initialize_fbsd_tdep): Initialize 'fbsd_pspace_data_handle'.
* fbsd-tdep.c (fbsd_get_thread_local_address): New prototype.
Diffstat (limited to 'gdb/fbsd-tdep.h')
-rw-r--r-- | gdb/fbsd-tdep.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/fbsd-tdep.h b/gdb/fbsd-tdep.h index efd7c2c..0e29508 100644 --- a/gdb/fbsd-tdep.h +++ b/gdb/fbsd-tdep.h @@ -60,4 +60,15 @@ extern void fbsd_info_proc_mappings_entry (int addr_bit, ULONGEST kve_start, int kve_flags, int kve_protection, const void *kve_path); +/* Helper function to fetch the address of a thread-local variable. + DTV_ADDR is the base address of the thread's dtv array. LM_ADDR is + the address of the link_map structure for the associated object + file. OFFSET is the offset of the variable in the object file's + thread-local variable block. */ + +extern CORE_ADDR fbsd_get_thread_local_address (struct gdbarch *gdbarch, + CORE_ADDR dtv_addr, + CORE_ADDR lm_addr, + CORE_ADDR offset); + #endif /* fbsd-tdep.h */ |