Add a helper function to resolve TLS variable addresses for FreeBSD.
authorJohn Baldwin <jhb@FreeBSD.org>
Tue, 12 Mar 2019 20:39:02 +0000 (13:39 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Tue, 12 Mar 2019 20:45:48 +0000 (13:45 -0700)
commit945f3901b5889e57edf5a2ee25acb51f0078a719
tree6f5f49f7bc52cc23fb577de1a84106b81e68c88b
parentef0bd2046f58fac69577892c2d3b44b20d027476
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.
gdb/ChangeLog
gdb/fbsd-tdep.c
gdb/fbsd-tdep.h