From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119678 invoked by alias); 5 Feb 2019 22:33:23 -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 119670 invoked by uid 89); 5 Feb 2019 22:33:23 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=BAYES_00,KAM_STOCKGEN,SPF_PASS autolearn=no version=3.3.2 spammy=H*c:windows-1252, HContent-Transfer-Encoding:8bit X-HELO: mx2.freebsd.org Received: from mx2.freebsd.org (HELO mx2.freebsd.org) (8.8.178.116) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 05 Feb 2019 22:33:22 +0000 Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 272969A776; Tue, 5 Feb 2019 22:33:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6ABBB6D931; Tue, 5 Feb 2019 22:33:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id DE71E101CA; Tue, 5 Feb 2019 22:33:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: [PATCH 3/9] Handle TLS variable lookups when using separate debug object files. From: John Baldwin To: Simon Marchi Cc: gdb-patches@sourceware.org References: <6f24b813adb0155b499d6e2265a6f15a2db4e6ca.1548180889.git.jhb@FreeBSD.org> <27bfe45d3ccba5f52d2e3632da417000@polymtl.ca> Openpgp: preference=signencrypt Message-ID: <10dfaac6-0119-4f9f-666d-89fe7d8fb6cb@FreeBSD.org> Date: Tue, 05 Feb 2019 22:33:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6ABBB6D931 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-IsSubscribed: yes X-SW-Source: 2019-02/txt/msg00031.txt.bz2 On 2/5/19 2:21 PM, John Baldwin wrote: > So it seems that the OP_VAR_VALUE path calls down into the dwarf bits that > get the "original" objfile to pass to target_translate_tls_address, whereas > the OP_VAR_MSYM_VALUE case ends up using a separate object file. This might > in fact be due to bugs in the RISCV GCC backend as the TLS symbols for RISCV > don't seem quite right. I have to cast TLS variables to their types for > example: > > (gdb) p __je_tsd_initialized > '__je_tsd_initialized` has unknown type; cast it to its declared type > (gdb) p (bool)__je_tsd_initialized > $2 = 1 '\001' > > Also, for me TLS variables in the main executable did not work for me on > RISCV, only TLS variables in shared libraries, unlike on other architectures > I tested where TLS variables in both the executable and shared libraries > worked. I should have said: I think this means I probably need to rework the commit message a bit to explain that this doesn't always happen with separate debug files, but it can, and if so this fix is needed. -- John Baldwin