diff options
author | Kevin Buettner <kevinb@redhat.com> | 2005-03-31 19:58:26 +0000 |
---|---|---|
committer | Kevin Buettner <kevinb@redhat.com> | 2005-03-31 19:58:26 +0000 |
commit | b27569303241f8fde83dc9f8ea6ba6193e32a419 (patch) | |
tree | 184d54bcc4b4cd2bba010f82e95fb097ae6621bc /gdb/linux-thread-db.c | |
parent | 0e867e795772266c7c4f360f0e0ef4c9f9c2c93a (diff) | |
download | gdb-b27569303241f8fde83dc9f8ea6ba6193e32a419.zip gdb-b27569303241f8fde83dc9f8ea6ba6193e32a419.tar.gz gdb-b27569303241f8fde83dc9f8ea6ba6193e32a419.tar.bz2 |
* gdbarch.sh (fetch_tls_load_module_address): New architecture method.
* gdbarch.c, gdbarch.h: Regenerate.
* dwarf2loc.c (dwarf_expr_tls_address): Fetch TLS load module
address and pass this address, instead of the objfile address, to
target_get_thread_local_address().
* linux-thread-db.c (thread_db_get_thread_local_address): Change
second parameter from type ``struct objfile *'' to CORE_ADDR. Do
not call svr4_fetch_objfile_link_map() to fetch the load module
address.
* target.h (struct target_ops): Change second parameter of
``to_get_thread_local_address'' from ``struct objfile *'' to
``CORE_ADDR''.
* alpha-linux-tdep.c (solib-svr4.h): Include.
(alpha_linux_init_abi): Register TLS load module fetcher.
* amd64-linux-tdep.c (amd64_linux_init_abi): Likewise.
* hppa-linux-tdep.c (hppa_linux_init_abi): Likewise.
* i386-linux-tdep.c (i386_linux_init_abi): Likewise.
* ia64-linux-tdep.c (solib-svr4.h): Include.
(ia64_linux_init_abi): Register TLS load module fetcher.
* m32r-linux-tdep.c (m32r_linux_init_abi): Likewise.
* m68klinux-tdep.c (m68k_linux_init_abi): Likewise.
* mips-linux-tdep.c (mips_linux_init_abi): Likewise.
* s390-tdep.c (s390_gdbarch_init): Likewise.
* sparc-linux-tdep.c (sparc32_linux_init_abi): Likewise.
* sparc64-linux-tdep.c (solib-svr4.h): Include.
(sparc64_linux_init_abi): Register TLS load module fetcher.
* Makefile.in (alpha-linux-tdep.o, ia64-linux-tdep.o)
(sparc-linux-tdep.o): Update dependencies.
Diffstat (limited to 'gdb/linux-thread-db.c')
-rw-r--r-- | gdb/linux-thread-db.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 4c3c093..396b2a4 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -1230,18 +1230,18 @@ thread_db_pid_to_str (ptid_t ptid) return normal_pid_to_str (ptid); } -/* Get the address of the thread local variable in OBJFILE which is - stored at OFFSET within the thread local storage for thread PTID. */ +/* Get the address of the thread local variable in load module LM which + is stored at OFFSET within the thread local storage for thread PTID. */ static CORE_ADDR -thread_db_get_thread_local_address (ptid_t ptid, struct objfile *objfile, +thread_db_get_thread_local_address (ptid_t ptid, + CORE_ADDR lm, CORE_ADDR offset) { if (is_thread (ptid)) { td_err_e err; void *address; - CORE_ADDR lm; struct thread_info *thread_info; /* glibc doesn't provide the needed interface. */ @@ -1253,17 +1253,8 @@ thread_db_get_thread_local_address (ptid_t ptid, struct objfile *objfile, throw_exception (e); } - /* Get the address of the link map for this objfile. */ - lm = svr4_fetch_objfile_link_map (objfile); - - /* Whoops, we couldn't find one. Bail out. */ - if (!lm) - { - struct exception e - = { RETURN_ERROR, TLS_LOAD_MODULE_NOT_FOUND_ERROR, 0 }; - - throw_exception (e); - } + /* Caller should have verified that lm != 0. */ + gdb_assert (lm != 0); /* Get info about the thread. */ thread_info = find_thread_pid (ptid); @@ -1302,7 +1293,7 @@ thread_db_get_thread_local_address (ptid_t ptid, struct objfile *objfile, } if (target_beneath->to_get_thread_local_address) - return target_beneath->to_get_thread_local_address (ptid, objfile, offset); + return target_beneath->to_get_thread_local_address (ptid, lm, offset); else { struct exception e |