From: Simon Marchi <simon.marchi@polymtl.ca>
To: Weimin Pan <weimin.pan@oracle.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH2 PR gdb/18071] aarch64: "info addr" command can't resolve TLS variables
Date: Tue, 27 Mar 2018 03:31:00 -0000 [thread overview]
Message-ID: <14dfe03b9667658549aeae6b28835f16@polymtl.ca> (raw)
In-Reply-To: <1522101252-114393-1-git-send-email-weimin.pan@oracle.com>
On 2018-03-26 17:54, Weimin Pan wrote:
> Running the test case with upstream gdb shows two failures:
>
> (1) Receiving different error messages when printing TLS variable
> before
> program runs - because the ARM compiler does not emit dwarf
> attribute
> DW_AT_location for TLS, the result is expected and the baseline may
> need to be changed for aarch64.
>
> (2) Using "info address" command on C++ static TLS object resulted in
> "symbol unresolved" error - below is a snippet from the test case:
>
> class K {
> public:
> static __thread int another_thread_local;
> };
>
> __thread int K::another_thread_local;
>
> (gdb) info address K::another_thread_local
> Symbol "K::another_thread_local" is unresolved.
>
> This patch contains fix for (2).
>
> Function info_address_command() handles the "info address" command and
> calls lookup_minimal_symbol_and_objfile() to find sym's symbol entry in
> minimal symbol table if SYMBOL_COMPUTED_OPS (sym) is false. Problem is
> that function lookup_minimal_symbol_and_objfile() only looked up an
> objfile's minsym ordinary hash table, not its demangled hash table,
> which
> was the reason why the C++ name was not found.
>
> The fix is to replace the lookup_minimal_symbol_and_objfile() call with
> the lookup_bound_minimal_symbol() call, which looks up entries in both
> minsym's hash tables, via lookup_minimal_symbol(), to find symbol entry
> that's associated with the demangled name.
Hi Weimin,
I don't know if it was clear, but I pushed this patch already:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=bce02d8884d6baa72c537d0d7c59f924cb290799
Removing lookup_minimal_symbol_and_objfile and replacing it with
lookup_bound_minimal_symbol should be done as a separate patch (with a
relevant title that describes the change). Can you do that? There are
just a few callers of lookup_minimal_symbol_and_objfile that will need
to be updated.
Simon
next prev parent reply other threads:[~2018-03-27 3:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-26 22:20 Weimin Pan
2018-03-27 3:31 ` Simon Marchi [this message]
2018-03-27 19:56 ` Weimin Pan
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=14dfe03b9667658549aeae6b28835f16@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=weimin.pan@oracle.com \
/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: link
Be 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