From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9961 invoked by alias); 17 Jan 2018 08:57:04 -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 7516 invoked by uid 89); 17 Jan 2018 08:55:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_STOCKGEN,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: mail-qt0-f194.google.com Received: from mail-qt0-f194.google.com (HELO mail-qt0-f194.google.com) (209.85.216.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 17 Jan 2018 08:55:09 +0000 Received: by mail-qt0-f194.google.com with SMTP id c2so21630620qtn.9 for ; Wed, 17 Jan 2018 00:55:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=HJTIM7RcRdGFiVsGpT1nznRsB86VzvttOhrNOamDfrU=; b=AC+nBxPKPlYuZLBAL/0IDXcNNS1fRSeybjKjrGxXZ5Y4F7+f+0aQZvJDOkbRGOZ0rS UhPafESoDqZ3KahOSBTAwSM5l3kjJ8YM2lz6cBIb8aj6l7IXwOBV/76/PXBZfQqmgEqG Fh/mET9rQXDMGTMZnTBxk+JQt90kqf3kRLnm1IetuokZbBldBs2MB9rB5DGMjMULCjJ4 rVlsOveIcXF8AyxnuBAvIFQs18bUrvJr1I6na3NsS+WoAaCSmLvmgG6F/Yb4wApprdFK LTv5VPcALXyXMRuYWCi9DEthjogP3XH+sKwCQ3kcINnWMECVEqAuoOr87osCh44cUGTw VnFw== X-Gm-Message-State: AKwxyteIYMq7mb+Zk6+eoC2e47Oh24mIW6J26xDRTn4sB8V5ZAtHTxJl QYdoPqfu9lea8aeW3LMA6hRgKMuVOUVfm6lIheo= X-Google-Smtp-Source: ACJfBoux3nh17fRegVKfYxVzcFahFIUiJUS3MZk2GGF+VVO3IWMBThTvFFtkFvgoYH4f53effPqLsq4jfx/ct2X5BJc= X-Received: by 10.200.57.74 with SMTP id t10mr29227002qtb.22.1516179307875; Wed, 17 Jan 2018 00:55:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.152.176 with HTTP; Wed, 17 Jan 2018 00:55:07 -0800 (PST) In-Reply-To: References: <1509636764-46111-1-git-send-email-weimin.pan@oracle.com> <6eadd01b-098c-ca82-b41a-4303f0f6aa0a@oracle.com> <867eshg231.fsf@gmail.com> From: Yao Qi Date: Wed, 17 Jan 2018 08:57:00 -0000 Message-ID: Subject: Re: [PING][PATCH PR gdb/18071] TLS variables can't be resolved on aarch64-linux-gnu To: Weimin Pan Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2018-01/txt/msg00329.txt.bz2 On Wed, Jan 17, 2018 at 1:05 AM, Weimin Pan wrote: > > dwarf2_physname() does call dw2_linkage_name(). But since the class membe= r, > i.e. another_thread_local, does not contain either DW_AT_linkage_name or > DW_AT_MIPS_linkage_name attribute, its canonicalized name gets returned. > dwarf2_physname is called twice with the parameter NAME is "another_thread_local". The first is about DW_TAG_member and the second is about DW_TAG_variable. <2><37>: Abbrev Number: 3 (DW_TAG_member) <38> DW_AT_name : (indirect string, offset: 0x6e): another_thread_local <3c> DW_AT_decl_file : 1 <3d> DW_AT_decl_line : 3 <3e> DW_AT_type : <0x44> <42> DW_AT_external : 1 <42> DW_AT_accessibility: 1 (public) <43> DW_AT_declaration : 1 .... <1><68>: Abbrev Number: 6 (DW_TAG_variable) <69> DW_AT_specification: <0x37> <6d> DW_AT_decl_line : 6 <6e> DW_AT_linkage_name: (indirect string, offset: 0x0): _ZN1K20another_thread_localE The second one matters, not the first one. If I set this breakpoint, it will hit twice, (gdb) b dwarf2_physname if strcmp (name, "another_thread_local") =3D=3D 0 in the 2nd breakpoint hit, you can see dwarf2_physname is called by new_symbol_full, (gdb) bt 5 #0 dwarf2_physname (name=3D0x60d0000096fe "another_thread_local", die=3D0x621000156ce0, cu=3D0x612000018340) at gdb/dwarf2read.c:11183 #1 0x00000000008f20a9 in new_symbol_full (die=3D0x621000156ce0, type=3D0x0, cu=3D0x612000018340, space=3D0x0) at gdb/dwarf2read.c:21416 #2 0x00000000008c80a6 in read_variable (die=3D0x621000156ce0, cu=3D0x612000018340) at gdb/dwarf2read.c:14439 it returns "K::another_thread_local", and use it to set symbol name. That symbol is used in lookup_minimal_symbol_and_objfile (SYMBOL_LINKAGE_NAME (sym)) later when you type command "info address K::another_thread_local". --=20 Yao (=E9=BD=90=E5=B0=A7)