[RFC v2][PATCH 15/27] Add Infinity THREAD_SELF macros to sysdeps/sparc/nptl/tls.h
Gary Benson
gbenson@redhat.com
Wed Jun 15 08:50:00 GMT 2016
Andreas Schwab wrote:
> Gary Benson <gbenson@redhat.com> writes:
> > I was trying to make sense of what sparc is doing for libthread_db
> > too. It has:
> >
> > # define DB_THREAD_SELF \
> > REGISTER (32, 32, 10 * 4, 0) \
> > REGISTER (64, __WORDSIZE, (6 * 8) + (__WORDSIZE==64?0:4), 0)
> >
> > Similarly s390 has:
> >
> > # define DB_THREAD_SELF REGISTER (32, 32, 18 * 4, 0) \
> > REGISTER (64, __WORDSIZE, 18 * 8, 0)
> >
> > Could the __WORDSIZE in both of those be replaced with 64?
>
> No, of course not. It is 32 in a 32-bit process.
Ah, I see what's happening now.
What's being passed to libthread_db (and to Infinity in this series)
is a byte offset in bytes into prgregset_t. That doesn't work for
Infinity if the offsets change depending on the wordsize of the
debugger. I'll change these patches to pass a DWARF register number
and let the debugger figure out how to get the value.
Thanks for helping me work this out.
Cheers,
Gary
--
http://gbenson.net/
More information about the Libc-alpha
mailing list