This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] TLS access support in cross- Linux GDB
- From: Gary Benson <gbenson at redhat dot com>
- To: Djordje Todorovic <djordje dot todorovic at rt-rk dot com>
- Cc: gdb-patches at sourceware dot org, nemanja dot popov at rt-rk dot com, nikola dot prica at rt-rk dot com, petar dot jovanovic at rt-rk dot com, asowda at cisco dot com, ibaev at cisco dot com
- Date: Thu, 8 Jun 2017 11:20:03 +0100
- Subject: Re: [PATCH] TLS access support in cross- Linux GDB
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=gbenson at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 2C897C0467D9
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2C897C0467D9
- References: <593529D1.7040206@rt-rk.com>
Hi Djordje,
Djordje Todorovic wrote:
> TLS variable was not propagating from core dump file to GDB and
> this patch implements that behavior for multiarch GDB.
First, let me say I've been working on a system that fixes this issue
(and a number of others) for nearly two years now, so you could say I
have a conflict of interest :) That said, I have had my head in this
code for quite a while now, so...
> This approach includes linux-thread-db.c to be compiled for
> multiarch GDB, where appropriate functions for getting TLS addresses
> are used. If the program being debugged is built for host
> architecture, we keep the old way of calculating TLS. For target
> architectures modified libthread_db functions (td_ta_new(),
> td_thr_tls_get_addr(), td_thr_tlsbase()) are used, which can work
> with any version of glibc. Also, additional functions are copied
> from glibc in order to satisfy missing dependencies.
I really don't think this approach is right for mainline GDB. It's
embedding glibc implementation details into GDB, things like alignment
and structure offsets which may change at any time. I'm mainly
looking at the code in init_target_dep_constants, but there's other
stuff e.g. the definition of TLS_PRE_TCB_SIZE in tls.h. You're
relying on *so* much stuff not changing, but glibc makes no such
guarantees.
I'm sorry I can't bring happier news :/
Thanks,
Gary
--
https://gbenson.net/