This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] TLS access support in cross- Linux GDB


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]