From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24251 invoked by alias); 27 Mar 2018 19:56:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 23587 invoked by uid 89); 27 Mar 2018 19:56:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=BAYES_00,KAM_STOCKGEN,SPF_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=Hx-languages-length:2246 X-HELO: aserp2120.oracle.com Received: from aserp2120.oracle.com (HELO aserp2120.oracle.com) (141.146.126.78) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 27 Mar 2018 19:56:01 +0000 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2RJpxf1011786; Tue, 27 Mar 2018 19:55:53 GMT Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2gyvg3g0hu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Mar 2018 19:55:52 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w2RJtpfc025768 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Mar 2018 19:55:52 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w2RJtpcO007421; Tue, 27 Mar 2018 19:55:51 GMT Received: from [10.132.97.56] (/10.132.97.56) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 27 Mar 2018 19:55:51 +0000 Subject: Re: [PATCH2 PR gdb/18071] aarch64: "info addr" command can't resolve TLS variables To: Simon Marchi Cc: gdb-patches@sourceware.org References: <1522101252-114393-1-git-send-email-weimin.pan@oracle.com> <14dfe03b9667658549aeae6b28835f16@polymtl.ca> From: Weimin Pan Message-ID: <8916c8d9-0ce1-fc7c-370a-f97c9f7e6a4f@oracle.com> Date: Tue, 27 Mar 2018 19:56:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <14dfe03b9667658549aeae6b28835f16@polymtl.ca> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8845 signatures=668695 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803270190 X-SW-Source: 2018-03/txt/msg00575.txt.bz2 On 3/26/2018 8:31 PM, Simon Marchi wrote: > 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. > Hi Simon, Yes, I will do another patch  get rid of all lookup_minimal_symbol_and_objfile calls. Weimin > Simon