aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-04-04 15:08:15 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2022-04-04 15:08:15 -0700
commit4cc98c360d8e9ab567e915e7b080b5d4113d5b3b (patch)
tree227812e156e9459ff7dfa574dfba377df77a3e00 /gdb/target.c
parent6109f7a39eb956a4121875630895669cece178e8 (diff)
downloadgdb-4cc98c360d8e9ab567e915e7b080b5d4113d5b3b.zip
gdb-4cc98c360d8e9ab567e915e7b080b5d4113d5b3b.tar.gz
gdb-4cc98c360d8e9ab567e915e7b080b5d4113d5b3b.tar.bz2
Handle TLS variable lookups when using separate debug files.
Commit df22c1e5d53c38f38bce6072bb46de240f9e0e2b handled the case that a separate debug file was passed as the objfile for a shared library to svr4_fetch_objfile_link_map. However, a separate debug file can also be passed for TLS variables in the main executable. In addition, frv_fetch_objfile_link_map also expects to be passed the original objfile rather than a separate debug file, so pull the code to resolve a separate debug file to the main objfile up into target_translate_tls_address.
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 928f558..f33bf34 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -1296,6 +1296,11 @@ target_translate_tls_address (struct objfile *objfile, CORE_ADDR offset)
struct target_ops *target = current_inferior ()->top_target ();
struct gdbarch *gdbarch = target_gdbarch ();
+ /* If OBJFILE is a separate debug object file, look for the
+ original object file. */
+ if (objfile->separate_debug_objfile_backlink != NULL)
+ objfile = objfile->separate_debug_objfile_backlink;
+
if (gdbarch_fetch_tls_load_module_address_p (gdbarch))
{
ptid_t ptid = inferior_ptid;