From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 79191 invoked by alias); 8 Mar 2019 18:39: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 78646 invoked by uid 89); 8 Mar 2019 18:39:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=Marchi, HX-Languages-Length:1269, marchi, thread-local 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; Fri, 08 Mar 2019 18:39:02 +0000 Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (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 3C68389E10; Fri, 8 Mar 2019 18:39:01 +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 5718085EF0; Fri, 8 Mar 2019 18:39:00 +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 DCDB01906A; Fri, 8 Mar 2019 18:38:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: [PATCH v2 04/11] Add a new gdbarch method to resolve the address of TLS variables. To: Simon Marchi Cc: gdb-patches@sourceware.org References: <4db33aead3f31532b7d4e165d9786df792a4d925.1549672588.git.jhb@FreeBSD.org> <02c8a44b-b1d2-0f0f-9b6f-72a0fb673f83@simark.ca> <2c282f52-0269-d6a8-8533-4c00b1a4ee8d@FreeBSD.org> <4a8bfa95b84386b3a76a37113495b7bc@simark.ca> From: John Baldwin Openpgp: preference=signencrypt Message-ID: Date: Fri, 08 Mar 2019 18:39:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.5.3 MIME-Version: 1.0 In-Reply-To: <4a8bfa95b84386b3a76a37113495b7bc@simark.ca> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5718085EF0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-IsSubscribed: yes X-SW-Source: 2019-03/txt/msg00189.txt.bz2 On 3/7/19 6:55 PM, Simon Marchi wrote: > On 2019-03-07 18:50, John Baldwin wrote: >> Sure. I used a variant of the comment from the target method: >> >> diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh >> index 48fcebd19a..d15b6aa794 100755 >> --- a/gdb/gdbarch.sh >> +++ b/gdb/gdbarch.sh >> @@ -602,6 +602,14 @@ m;int;remote_register_number;int >> regno;regno;;default_remote_register_number;;0 >> >> # Fetch the target specific address used to represent a load module. >> F;CORE_ADDR;fetch_tls_load_module_address;struct objfile >> *objfile;objfile >> + >> +# Return the thread-local address at OFFSET in the thread-local >> +# storage for the thread PTID and the shared library or executable >> +# file given by LM_ADDR. If that block of thread-local storage hasn't >> +# been allocated yet, this function may return an error. LM_ADDR may >> +# be zero for statically linked multithreaded inferiors. > > What does "may return an error" mean? A special CORE_ADDR value, or it > throws an error? Hmm, it throws an error, so maybe "this function may throw an error."? I'll also add a little patch to update the comment for target::get_thread_local_address to match. -- John Baldwin