forked from Imagelibrary/binutils-gdb
* 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.
This commit is contained in:
@@ -188,7 +188,8 @@ dwarf_expr_tls_address (void *baton, CORE_ADDR offset)
|
||||
struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton;
|
||||
volatile CORE_ADDR addr = 0;
|
||||
|
||||
if (target_get_thread_local_address_p ())
|
||||
if (target_get_thread_local_address_p ()
|
||||
&& gdbarch_fetch_tls_load_module_address_p (current_gdbarch))
|
||||
{
|
||||
ptid_t ptid = inferior_ptid;
|
||||
struct objfile *objfile = debaton->objfile;
|
||||
@@ -196,7 +197,21 @@ dwarf_expr_tls_address (void *baton, CORE_ADDR offset)
|
||||
|
||||
TRY_CATCH (ex, RETURN_MASK_ALL)
|
||||
{
|
||||
addr = target_get_thread_local_address (ptid, objfile, offset);
|
||||
CORE_ADDR lm_addr;
|
||||
|
||||
/* Fetch the load module address for this objfile. */
|
||||
lm_addr = gdbarch_fetch_tls_load_module_address (current_gdbarch,
|
||||
objfile);
|
||||
/* If it's 0, throw the appropriate exception. */
|
||||
if (lm_addr == 0)
|
||||
{
|
||||
struct exception e
|
||||
= { RETURN_ERROR, TLS_LOAD_MODULE_NOT_FOUND_ERROR, 0 };
|
||||
|
||||
throw_exception (e);
|
||||
}
|
||||
|
||||
addr = target_get_thread_local_address (ptid, lm_addr, offset);
|
||||
}
|
||||
/* If an error occurred, print TLS related messages here. Otherwise,
|
||||
throw the error to some higher catcher. */
|
||||
|
||||
Reference in New Issue
Block a user