From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id KQG0BRD40mhatw8AWB0awg (envelope-from ) for ; Tue, 23 Sep 2025 15:42:08 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=D2tXlhFz; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id F1B881E0BA; Tue, 23 Sep 2025 15:42:07 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 8245F1E04C for ; Tue, 23 Sep 2025 15:42:06 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0A969385841F for ; Tue, 23 Sep 2025 19:42:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A969385841F Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=D2tXlhFz Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id C6F493858D26 for ; Tue, 23 Sep 2025 19:41:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C6F493858D26 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C6F493858D26 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1758656492; cv=none; b=rEDOj295cRqcqmCdV0JeFAt9U2FvYmmXW/YCtX9wbq4ttLCidSnumIWb9oAgnqfX974Vo5JVQDv9bAZtJBToMiMtPwEX9tZw/VZRiR7QSXZrJy7CVYQ4EnMR2nc5zezf9BlET9L0IETqJ/aKkSpPrTcbtwAwJdiMHg7Ae7oC+rg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1758656492; c=relaxed/simple; bh=luvsoqwyo+hDLmo5k3tyKWMeZjYKue7dzHuyQsk+M4U=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=TUFzGBfStmpI9o1/vOitMb8QHyFeZC8gLamMgNg2xY6ZCmqlSi1F7/i4cvhLE+WUBPRIRSNqpNN6+pqe8CMprhaSoXPFoZ9f4bqY1/LWeDcRea5RKcD+0efpPk9RZ2p/DY/rR2P43eK7hODVgeV+o2KBYAhd2jXodIHhMW1Q83k= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C6F493858D26 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v18tH-0000vt-Vp; Tue, 23 Sep 2025 15:41:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=V5yxgKjbDebWhH1uJQP3pDcA8TEp1lKPGV2XXZu93tk=; b=D2tXlhFz26p6 vENwmcWaTWR3C4zSoY/Z9/MldKhZ8iPCVasOSQA2vpruT0ePoDXw7zC1Bayz4CL6ZDYAxiFmw3EyZ 9deVTOjZdpd3C8ieHBXnm5q9qFfSI58dHoi2FZlQiAi5QaizxbzYLsyXWXPSZxYXtq8+jQ1LV0GYz vJITxijkh+I4uvOQS7QRs5uU9vCbcMDwoppm/r9oY4EkSRn6dV3clKeAMqa19qs/1QsMQMGX30vFW qLzqKVz9Xd3RHojCx/7h/+w40SA7iDPssQvVew5Y2ylhWIAXn8RMGDWegSZTRGuekcFnIBBrSLK2h tOBHkgK1BiIcdEFUnn2cxw==; Date: Tue, 23 Sep 2025 22:41:29 +0300 Message-Id: <86ldm5c5xy.fsf@gnu.org> From: Eli Zaretskii To: Andrew Burgess Cc: gdb-patches@sourceware.org In-Reply-To: (message from Andrew Burgess on Tue, 23 Sep 2025 18:31:46 +0100) Subject: Re: [PATCH] gdb: include NT_I386_TLS note in generated core files References: <35c3bcb9e7cd1b7b9192adeda9acd3417525f97d.1756812133.git.aburgess@redhat.com> X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 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 > From: Andrew Burgess > Cc: Andrew Burgess > Date: Tue, 23 Sep 2025 18:31:46 +0100 > > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=15591 > --- > gdb/NEWS | 4 + > gdb/amd64-linux-nat.c | 26 +- > gdb/doc/gdb.texinfo | 11 +- > gdb/features/i386/32bit-linux.c | 7 + > gdb/features/i386/32bit-linux.xml | 5 + > gdb/i386-linux-nat.c | 21 ++ > gdb/i386-linux-tdep.c | 171 +++++++++- > gdb/i386-linux-tdep.h | 15 + > gdb/i386-tdep.h | 5 + > gdb/nat/amd64-linux.h | 29 ++ > gdb/nat/i386-linux.h | 10 + > gdb/nat/x86-linux.c | 44 +++ > gdb/nat/x86-linux.h | 15 + > gdb/testsuite/gdb.arch/i386-linux-tls-regs.c | 74 +++++ > .../gdb.arch/i386-linux-tls-regs.exp | 314 ++++++++++++++++++ > gdb/x86-linux-nat.c | 67 ++++ > gdb/x86-linux-nat.h | 17 + > gdbserver/linux-x86-low.cc | 99 ++++++ > 18 files changed, 928 insertions(+), 6 deletions(-) > create mode 100644 gdb/nat/amd64-linux.h > create mode 100644 gdb/testsuite/gdb.arch/i386-linux-tls-regs.c > create mode 100644 gdb/testsuite/gdb.arch/i386-linux-tls-regs.exp Thanks. > > diff --git a/gdb/NEWS b/gdb/NEWS > index 8be367d2424..b7f99551927 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -87,6 +87,10 @@ single-inf-arg in qSupported > In systems that don't support linker namespaces, or if the inferior hasn't > started yet, these always return the integer 0. > > +* The 'org.gnu.gdb.i386.linux' target description feature can now > + contain three additional registers which provide access to the TLS > + related GDT entries on i386 (and x86-64 when compiling with -m32). > + > * Add record full support for rv64gc architectures This part is okay. > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -50207,8 +50207,15 @@ i386 Features > @samp{ymm0h} through @samp{ymm15h} for amd64 > @end itemize > > -The @samp{org.gnu.gdb.i386.linux} feature is optional. It should > -describe a single register, @samp{orig_eax}. > +The @samp{org.gnu.gdb.i386.linux} feature is optional. If the feature > +is present, then it should describe the 32 bit register, @samp{orig_eax}. > + > +Additionally, the @samp{org.gnu.gdb.i386.linux} feature can optionally > +contain three 128 bit registers called @samp{i386_tls_gdt_0}, > +@samp{i386_tls_gdt_1}, and @samp{i386_tls_gdt_2}. Each of these > +registers contains one 16 byte @samp{struct user_desc} (see @samp{man > +2 get_thread_area}) object which describes one of the three TLS > +related GDT entries. Suggest to use @kbd instead of @samp when showing the man command line. Reviewed-By: Eli Zaretskii