This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Fix i386 memory-by-register access on amd64
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: jan dot kratochvil at redhat dot com (Jan Kratochvil)
- Cc: mark dot kettenis at xs4all dot nl (Mark Kettenis), drow at false dot org, tromey at redhat dot com (Tom Tromey), gdb-patches at sourceware dot org
- Date: Mon, 13 Jul 2009 19:08:09 +0200 (CEST)
- Subject: Re: [patch] Fix i386 memory-by-register access on amd64
Jan Kratochvil wrote:
> Therefore fixed linux_xfer_partial. Therefore it no longer needs the fix to
> be present also in inf_ptrace_xfer_partial. I do not know how non-Linux OSes
> handle the debugging of 32bit inferior on 64bit GDB so I have no opinion
> whether the inf_ptrace_xfer_partial patch makes sense, i can drop it.
I think at this point it would probably be better to just to the Linux fix.
I've looked at a couple of ptrace implementations in the Linux kernel, and
it seems this fix should be correct on all bi-arch Linux platforms.
I simply do not know enough how ptrace behaves on other OSes -- until we
get a specific bug report on some other OS, I think we should leave the
behaviour unchanged for now.
> 2009-07-08 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> Fix memory access from signed 32bit inferior registers on 64bit GDB.
> * inf-ptrace.c (inf_ptrace_xfer_partial <TARGET_OBJECT_MEMORY>): New
> variable addr_bit. Mask OFFSET by the ADDR_BIT width.
> * linux-nat.c (linux_xfer_partial <TARGET_OBJECT_MEMORY>): Likewise.
>
> 2009-07-08 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> * gdb.arch/amd64-i386-address.exp, gdb.arch/amd64-i386-address.S: New.
The linux-nat.c change and the test case are OK.
Thanks,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com