From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122431 invoked by alias); 21 Nov 2017 15:36:37 -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 122421 invoked by uid 89); 21 Nov 2017 15:36:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KB_WAM_FROM_NAME_SINGLEWORD,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=Hx-spam-relays-external:74.125.82.67, H*RU:74.125.82.67, Hx-languages-length:1566, H*r:sk:static. X-HELO: mail-wm0-f67.google.com Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com) (74.125.82.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 Nov 2017 15:36:36 +0000 Received: by mail-wm0-f67.google.com with SMTP id x63so4271645wmf.2 for ; Tue, 21 Nov 2017 07:36:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=b+Lb8qInunUUb//KNBfE5JJ6cFcJga4mVmyKjVkczGQ=; b=q84nbf+jESFph6muzp9D7TohVaCe9c+8dILdNqx8y4rDbTCSGZQFkyeKo7U9KwjTR1 t1PijxcOMn3XerCzXmkF9AHJZr1xPerjovSFykQaiSmBE0XIcAuaTy3lnvbfswVlDKy9 p8GyTjGfARhqmpY7VK1S+4OTBlpeaXKdHcL1W4yZ8nUSvuwrIDkmoDs2JPsRLeZDSC4F GuTrCUa5KkJWO/0CCiJX+ej5dv4xDaF2GTDgHPm2d86XAF9js57bASvggTets4jZ0cL9 CpKOu4wpwXUr302ZJoyXyV2iJo+byNbrshp0FUrN6ybH2tM6iLTa3Ivpobn6WY0nu+bM tcFQ== X-Gm-Message-State: AJaThX6DWmPdPXMAJRwHbjp29irkiXX3DVyWxQFIQpyoe3UZ7Vzw0LEq gcsz6he1285Og4+SBQx/6KU= X-Google-Smtp-Source: AGs4zMYNqPaFXOL5aPr7TQFB0Kv3cXyOyA7Pc0wlBuR+FKz8ZLFzLdVSY7Tnc/hN5qsnpcbnJmxbag== X-Received: by 10.80.244.141 with SMTP id s13mr25820199edm.222.1511278593963; Tue, 21 Nov 2017 07:36:33 -0800 (PST) Received: from 1170ee0b50d5 (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id j27sm10949236eda.59.2017.11.21.07.36.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Nov 2017 07:36:33 -0800 (PST) Date: Tue, 21 Nov 2017 15:36:00 -0000 From: Yao Qi To: Wei-min Pan Cc: gdb-patches@sourceware.org Subject: Re: [PATCH PR gdb/18071] TLS variables can't be resolved on aarch64-linux-gnu Message-ID: <20171121153631.GH318@1170ee0b50d5> References: <1509669516-47946-1-git-send-email-weimin.pan@oracle.com> <868tf6twly.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00434.txt.bz2 On 17-11-16 14:40:18, Wei-min Pan wrote: > > If a TLS does not have a DW_AT_location, it can still be found in the > .tbss section (with flag SEC_THREAD_LOCAL being set) which GLIBC uses > for TLS storage and that's what gdb function info_address_command() > tries to find by calling lookup_minimal_symbol_and_objfile(). > > Problem is, as described in the patch, lookup_minimal_symbol_and_objfile() > only looked up an objfile's minsym ordinary hash table, not its demangled > hash table, and resulted in not finding the C++ name. > > I finally understand what your patches does. It is about finding TLS variables from msymbol instead of full symbol. It is nothing specific to aarch64. We've already had a test case gdb.threads/tls-nodebug.exp, but it is about C, rather than C++. Can you extend this test case for a C++ TLS (which is mangled)? I expect that GDB can't find the mangled TLS without debug info on any architecture, and your patch fixes this issue. Even with your patch applied, there is still one fail in gdb.threads/tls.exp, -Cannot read `a_thread_local' without registers^M -(gdb) PASS: gdb.threads/tls.exp: print a_thread_local +Cannot find thread-local storage for process 0, executable file /home/yao.qi/gnu/build/gdb/testsuite/outputs/gdb.threads/tls/tls:^M +Cannot find thread-local variables on this target^M +(gdb) FAIL: gdb.threads/tls.exp: print a_thread_local Looks GDB error messages in different code patch should be adjusted as well. -- Yao (齐尧)