public inbox for gdb-cvs@sourceware.org help / color / mirror / Atom feed
From: John Baldwin <jhb@sourceware.org> To: gdb-cvs@sourceware.org Subject: [binutils-gdb/gdb-12-branch] Handle TLS variable lookups when using separate debug files. Date: Mon, 11 Apr 2022 15:56:30 +0000 (GMT) [thread overview] Message-ID: <20220411155630.B99AA3858D1E@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=aba6eff2e0d2d32380ec28e2eb0ee926e6f715b4 commit aba6eff2e0d2d32380ec28e2eb0ee926e6f715b4 Author: John Baldwin <jhb@FreeBSD.org> Date: Mon Apr 4 15:08:15 2022 -0700 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. Diff: --- gdb/solib-svr4.c | 5 ----- gdb/target.c | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 69f2991f5e6..f0f02cb37e1 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -1453,11 +1453,6 @@ svr4_fetch_objfile_link_map (struct objfile *objfile) if (objfile == current_program_space->symfile_object_file) return info->main_lm_addr; - /* 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; - /* The other link map addresses may be found by examining the list of shared libraries. */ for (struct so_list *so : current_program_space->solibs ()) diff --git a/gdb/target.c b/gdb/target.c index e3df9275c9a..1ee051b520a 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;
reply other threads:[~2022-04-11 15:56 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220411155630.B99AA3858D1E@sourceware.org \ --to=jhb@sourceware.org \ --cc=gdb-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).