This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Cut memory address width
- From: Jim Blandy <jimb at codesourcery dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 27 Sep 2006 12:24:27 -0700
- Subject: Re: [patch] Cut memory address width
- References: <20060927161501.GA23340@host0.dyn.jankratochvil.net>
Jan Kratochvil <jan.kratochvil@redhat.com> writes:
> `x/x $ebx' on gdb/amd64 debugging inferior/i386 causes Cannot access memory at
> address 0xffffce70 (or so) as $ebx is considered `int' and sign-extended to
> 64-bit while the resulting address 0xffffffffffffce70 fails to be accessed.
>
> $esp does not exhibit this problem as it is `builtin_type_void_data_ptr' not
> `builtin_type_int' as $ebx is. Therefore it gets extended as unsigned.
>
> Simulate the part of paddress(); it is questionable how deep in the functions
> calling stack the address width cut should be.
Just as a sanity check: what does 'show architecture' say when you're
debugging an i386 inferior on gdb/amd64?
I'm guessing that x_command calls value_to_address, which passes the
value of $ebx to to gdbarch_integer_to_address, which is where the
conversion is happening. Is there some code there assuming that host
== target?