From patchwork Thu Oct 10 02:16:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Buettner X-Patchwork-Id: 98630 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9AD72385E44D for ; Thu, 10 Oct 2024 02:29:29 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 191C5385E45B for ; Thu, 10 Oct 2024 02:26:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 191C5385E45B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 191C5385E45B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728527192; cv=none; b=PCCuCNGWdGvcWWxhaQuTo9mFiaCdEPmDousCvWHrDrwAU66zCL04U5WYNlq/4fZ59P7jbJIbLHtOuMaDzxzHQXdwXf9kOSGklDhLvvzILZEs9gkd+4eJdb54q9XoLtz4ozQ3q7UlhxRttp9C3SwfUDo+W6Ji4PzQ+AgxOh+XAS8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728527192; c=relaxed/simple; bh=Ohi1PaXC9EpoW42bOgM5JgTSVA/5i8VvG5yvDRXUgPM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=vIC65BVQ7igDybyBqPqNTSAU486aVrtlwy6GesNGx54aPpWsTBm+LnYUFLCurDmsnTb7TbOqO3NzlWEN420bDOJVAqpUdN70eqqabmVao/d+axi22NbDqhdFzn0VyDAMfQ7lKyrQo+LFHWPmBDBFLesX+GFMuD6uYEV80P+KoYI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728527189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=us38hLxpAs8jTVUR3s/fvo2NQsjRNADnIAGEvVAzmjg=; b=Ue2tyWhhhXDWNDmQKOACNMc3PrNpC6OYqhzvwvkZM4IAPrP4RSk8YpBLZkk4VSMsLl5blr UcfUsQ3BbwyvY0Ym5BKF2efgarQ755pDXuBK9LsgflND9jxnOJ8jyi5D0KeLBtGJC2Wgz8 f2YRIbO/wZOewDiJbERyG4Zudf4Br0g= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-619-46pjV6VcNDSaqccrQqxr6A-1; Wed, 09 Oct 2024 22:26:28 -0400 X-MC-Unique: 46pjV6VcNDSaqccrQqxr6A-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D2C6B195608B for ; Thu, 10 Oct 2024 02:26:27 +0000 (UTC) Received: from f41-1.lan (unknown [10.22.64.28]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DBD0719560A2; Thu, 10 Oct 2024 02:26:26 +0000 (UTC) From: Kevin Buettner To: gdb-patches@sourceware.org Cc: Kevin Buettner Subject: [PATCH 11/11] Add TLS NEWS entry and document 'set force-internal-tls-address-lookup' command Date: Wed, 9 Oct 2024 19:16:14 -0700 Message-ID: <20241010022552.47637-12-kevinb@redhat.com> In-Reply-To: <20241010022552.47637-1-kevinb@redhat.com> References: <20241010022552.47637-1-kevinb@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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~patchwork=sourceware.org@sourceware.org --- gdb/NEWS | 20 ++++++++++++++++++++ gdb/doc/gdb.texinfo | 17 +++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/gdb/NEWS b/gdb/NEWS index 42668cbc057..dcb24eb5248 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -63,6 +63,26 @@ the return value from the latest "stepOut" command, when appropriate. +* GDB-internal TLS support + + ** Linux targets for the x86_64, aarch64, ppc64, s390x, and riscv + architectures now have GDB-internal support for TLS address + lookup in addition to that traditionally provided by the + libthread_db library. This internal support works for programs + linked against either the GLIBC or MUSL C libraries. For + programs linked against MUSL, this new internal support provides + new debug functionality, allowing access to TLS variables, due to + the fact that MUSL does not implement the libthread_db library. + Internal TLS support is also useful in cross-debugging + situations, debugging statically linked binaries, and debugging + programs linked against GLIBC 2.33 and earlier, but which are not + linked against libpthread. + + ** The command 'set force-internal-tls-address-lookup on' may be + used to force the internal TLS lookup mechanisms to be used. + Otherwise, TLS lookup via libthread_db will still be preferred, + when available. + * New commands set style line-number foreground COLOR diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 46ca62ec0c3..f0f98061a1f 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -4067,6 +4067,23 @@ only on some platforms. @item show libthread-db-search-path Display current libthread_db search path. +@kindex set force-internal-tls-address-lookup +@kindex show force-internal-tls-address-lookup +@cindex internal TLS lookup +Turns on or off forced use of @value{GDBN}-internal TLS (Thread Local +Storage) address lookup code. Use @code{on} to enable and @code{0} to +disable. + +When disabled, @value{GDBN} will attempt to use a helper +@code{libthread_db} library if possible, but will fall back to use of +its own internal TLS address lookup mechanisms if necessary. + +When enabled, @value{GDBN} will only use the @value{GDBN}'s internal +TLS address lookup mechanisms, if they exist. + +This command is only available on targets for which internal TLS +address lookup support exists. + @kindex set debug libthread-db @kindex show debug libthread-db @cindex debugging @code{libthread_db}