From patchwork Thu Jul 12 07:24:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 942828 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-94188-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="DYRgY1qx"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41R6s10Y9Gz9ryt for ; Thu, 12 Jul 2018 17:24:51 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:cc:date:message-id :mime-version:content-type; q=dns; s=default; b=yxapLRLnEG4qvVk+ 6aY6tHxpubhHlHg+bUKzdTcZWzAPpiNnk+flqWWaYpM3G5PfIJxtzclbpTmzN4Xe of+UWaKfWtW6BsznkUXSSufrYDewJFgQuQN2CYWigvU474Ic9cLVNmKHvWvRwCqh eO6so/hRnDaLNQjXDoT8oZE/Z8k= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:cc:date:message-id :mime-version:content-type; s=default; bh=4Cu2OAPtcxSWhtSORcW4sY srfpk=; b=DYRgY1qx1BXijApekh6V1mE7CGMDK1VsOp76OIcykQzxLjbR2jz9sj mKL3IpBklUDCa6en/RzD2k/fjn4m6qHGURNLAJkwm9RGkeOl9+5RdXQBCl+sqW8b W+JASC5zTcb9Zgbdl95exGufPungw5Ci391KBEsbRTFjoaYSCoxRI= Received: (qmail 125779 invoked by alias); 12 Jul 2018 07:24:46 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 125770 invoked by uid 89); 12 Jul 2018 07:24:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.suse.de From: Andreas Schwab To: libc-alpha@sourceware.org Subject: [PATCH] RISC-V: Don't use ps_get_thread_area in libthread_db (bug 23402) CC: Palmer Dabbelt , Jim Wilson X-Yow: Yow! Are we laid back yet? Date: Thu, 12 Jul 2018 09:24:36 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Since RISC-V stores the thread pointer in a general register libthread_db can just ask the debugger for the register contents instead of trying to call ps_get_thread_area. This enables thread debugging in gdb. * sysdeps/riscv/nptl/tls.h (DB_THREAD_SELF): Use REGISTER instead of CONST_THREAD_AREA. --- sysdeps/riscv/nptl/tls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/riscv/nptl/tls.h b/sysdeps/riscv/nptl/tls.h index 7745d59044..9fa43f2708 100644 --- a/sysdeps/riscv/nptl/tls.h +++ b/sysdeps/riscv/nptl/tls.h @@ -101,7 +101,7 @@ typedef struct /* Magic for libthread_db to know how to do THREAD_SELF. */ # define DB_THREAD_SELF \ - CONST_THREAD_AREA (32, TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE) + REGISTER (64, 64, 4 * 8, - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE) /* Access to data in the thread descriptor is easy. */ # define THREAD_GETMEM(descr, member) \