This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC v2][PATCH 15/27] Add Infinity THREAD_SELF macros to sysdeps/sparc/nptl/tls.h
- From: Gary Benson <gbenson at redhat dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: libc-alpha at sourceware dot org
- Date: Wed, 15 Jun 2016 09:50:42 +0100
- Subject: Re: [RFC v2][PATCH 15/27] Add Infinity THREAD_SELF macros to sysdeps/sparc/nptl/tls.h
- Authentication-results: sourceware.org; auth=none
- References: <1465814311-31470-1-git-send-email-gbenson at redhat dot com> <1465814311-31470-16-git-send-email-gbenson at redhat dot com> <mvm37oh489i dot fsf at hawking dot suse dot de> <20160613140530 dot GA3443 at blade dot nx> <mvmfush2kk8 dot fsf at hawking dot suse dot de>
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/