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: 28323 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) \