From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id MHl8B/iLO2KXLQAAWB0awg (envelope-from ) for ; Wed, 23 Mar 2022 17:07:04 -0400 Received: by simark.ca (Postfix, from userid 112) id 1BFE61F3E2; Wed, 23 Mar 2022 17:07:04 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id AA24D1EDF0 for ; Wed, 23 Mar 2022 17:07:03 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5F2E43948A79 for ; Wed, 23 Mar 2022 21:07:03 +0000 (GMT) Received: from mail.baldwin.cx (bigwig.baldwin.cx [66.216.25.90]) by sourceware.org (Postfix) with ESMTPS id 35F6E3888838; Wed, 23 Mar 2022 21:00:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 35F6E3888838 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=FreeBSD.org Received: from ralph.com (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 7B7421A84E65; Wed, 23 Mar 2022 17:00:58 -0400 (EDT) From: John Baldwin To: binutils@sourceware.org, gdb-patches@sourceware.org Subject: [PATCH 07/12] Fetch the NT_ARM_TLS register set for native FreeBSD/arm processes. Date: Wed, 23 Mar 2022 14:00:46 -0700 Message-Id: <20220323210048.25525-8-jhb@FreeBSD.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220323210048.25525-1-jhb@FreeBSD.org> References: <20220323210048.25525-1-jhb@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (mail.baldwin.cx [0.0.0.0]); Wed, 23 Mar 2022 17:00:58 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.103.1 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" This permits resolving TLS variables. --- gdb/arm-fbsd-nat.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gdb/arm-fbsd-nat.c b/gdb/arm-fbsd-nat.c index c32924de735..6b5befc3a05 100644 --- a/gdb/arm-fbsd-nat.c +++ b/gdb/arm-fbsd-nat.c @@ -18,8 +18,11 @@ along with this program. If not, see . */ #include "defs.h" +#include "inferior.h" #include "target.h" +#include "elf/common.h" + #include #include #include @@ -49,6 +52,9 @@ arm_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) fetch_register_set (regcache, regnum, PT_GETVFPREGS, &arm_fbsd_vfpregset); #endif +#ifdef PT_GETREGSET + fetch_regset (regcache, regnum, NT_ARM_TLS, &arm_fbsd_tlsregset); +#endif } /* Store register REGNUM back into the inferior. If REGNUM is -1, do @@ -63,6 +69,9 @@ arm_fbsd_nat_target::store_registers (struct regcache *regcache, int regnum) store_register_set (regcache, regnum, PT_GETVFPREGS, PT_SETVFPREGS, &arm_fbsd_vfpregset); #endif +#ifdef PT_GETREGSET + store_regset (regcache, regnum, NT_ARM_TLS, &arm_fbsd_tlsregset); +#endif } /* Implement the to_read_description method. */ @@ -71,8 +80,12 @@ const struct target_desc * arm_fbsd_nat_target::read_description () { const struct target_desc *desc; + bool tls = false; - desc = arm_fbsd_read_description_auxv (this, false); +#ifdef PT_GETREGSET + tls = have_regset (inferior_ptid, NT_ARM_TLS) != 0; +#endif + desc = arm_fbsd_read_description_auxv (this, tls); if (desc == NULL) desc = this->beneath ()->read_description (); return desc; -- 2.34.1