From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 77879 invoked by alias); 17 Sep 2018 17:11:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 77865 invoked by uid 89); 17 Sep 2018 17:11:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_20,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=Problem, tlscoreexp, tls-core.exp, UD:tls-core.exp X-HELO: mail.baldwin.cx Received: from bigwig.baldwin.cx (HELO mail.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Sep 2018 17:11:25 +0000 Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id BE22A10AFD2; Mon, 17 Sep 2018 13:11:22 -0400 (EDT) Subject: Re: [PATCH] [PR 23660] On FreeBSD platform missing implementation of thread-db support To: Rajendra SY , gdb-patches@sourceware.org References: From: John Baldwin Message-ID: <8b47dccf-0b34-9803-8417-42841dd924a7@FreeBSD.org> Date: Mon, 17 Sep 2018 17:11:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg00589.txt.bz2 On 9/15/18 6:21 AM, Rajendra SY wrote: > Problem: > Missing libthread_db integration with GDB > > Cause: > GDB missing libthread_db integration on FreeBSD target because of this > GDB failed to access TLS variable values. > > Tests failed: > - gdb.threads/tls-shared.exp > - gdb.threads/tls-nodebug-pie.exp > - gdb.threads/tls-so_extern.exp > - gdb.threads/tls-var.exp > - gdb.threads/tls.exp > - gdb.threads/tls-core.exp I'll have to take some time to review this. I had hoped to avoid using libthread_db at all on FreeBSD (it doesn't support AVX or 32-bit processes on 64-bit kernels, etc.). For TLS I was planning on teaching fbsd-tdep.c about the various special variables libthread_db knows from rtld and libthr and using that along with having each FreeBSD architecture provide the thread pointer register to implement TLS. We could instead use libthread_db for now, but if so I'd prefer to only use libthread_db for TLS and not for anything else. This means that in theory much of the proc-service API can be stubs that should never be called. I would also be tempted to not have a separate thread-stratum target at all, but just have the native target in fbsd-nat.c call into fbsd-thread-db as if it was just a library for things like extra thread info (the pthread_t pointer value) and TLS. -- John Baldwin                                                                            Â