This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfa/gdbserver] Fix ppc64 bi-arch TLS bug
- From: Daniel Jacobowitz <drow at false dot org>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 28 May 2008 15:31:25 -0400
- Subject: Re: [rfa/gdbserver] Fix ppc64 bi-arch TLS bug
- References: <200805281829.m4SITpgT028177@d12av02.megacenter.de.ibm.com>
On Wed, May 28, 2008 at 08:29:51PM +0200, Ulrich Weigand wrote:
> Hello,
>
> this fixes another bug in ppc64 bi-arch gdbserver support: the
> ppc_collect_ptrace_register did not zero out the register buffer
> (in the case of a 4-byte inferior register on a 64-bit host).
>
> This doesn't matter for the main user of this function
> (usr_store_inferior_registers in linux-low.c) which always
> zeros the buffer itself before passing it in.
>
> However, there is a second caller, ps_lgetregs in proc-service.c
> (via the ppc_fill_gregset function) which does *not* zero the
> buffer. This could cause TLS access to fail in some instances
> of 64->32 bit bi-arch debugging.
>
> Fixed by simply always clearing the register buffer.
>
> Tested on powerpc64-linux (-m64/-m32) and powerpc-linux using
> local gdbserver.
>
> OK for mainline?
OK.
--
Daniel Jacobowitz
CodeSourcery