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: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: uweigand at de dot ibm dot com
- Cc: jan dot kratochvil at redhat dot com, drow at false dot org, tromey at redhat dot com, mark dot kettenis at xs4all dot nl, gdb-patches at sourceware dot org
- Date: Tue, 7 Jul 2009 19:59:43 +0200 (CEST)
- Subject: Re: [patch] Fix i386 memory-by-register access on amd64
- References: <200907071624.n67GO6bj015890@d12av02.megacenter.de.ibm.com>
> Date: Tue, 7 Jul 2009 18:24:06 +0200 (CEST)
> From: "Ulrich Weigand" <uweigand@de.ibm.com>
>
> Jan Kratochvil wrote:
>
> > Updated the patch to do on 64bit hosts exactly the same what 32bit hosts do.
> > 32bit hosts do all the CORE_ADDR calculations 64bit, just the final ptrace
> > call strips the width to 32bits.
>
> Hmm, I'm wondering how this would affect platforms where addresses are
> generally treated as signed integers (MIPS ?). Dan, do you know if the
> kernel expects the ptrace address argument to be sign-extended on MIPS?
Yes, I expect that to be the case for targets that do an ILP32 ABI on
a 64-bit CPU where there's a "hole" in the moddle of the 64-bit
virtual adddress space.
> This should be done inside the TARGET_OBJECT_MEMORY case; there is no reason
> why the same truncation should be performed for other object types.
But then I don't understand Jan's diff at all. Linux has its own
implementation for TARGET_OBJECT_MEMORY in linux-nat.c. Why isn't
that one used?