This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: PATCH: Set size of long/ptr as well as sp/pc for x32
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: GDB <gdb-patches at sourceware dot org>
- Date: Mon, 14 May 2012 11:16:36 -0700
- Subject: Re: PATCH: Set size of long/ptr as well as sp/pc for x32
- References: <20120514180146.GA18462@intel.com> <20120514181113.GN10253@adacore.com>
On Mon, May 14, 2012 at 11:11 AM, Joel Brobecker <brobecker@adacore.com> wrote:
>> ?{
>> + ?struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
>> ? ?amd64_linux_init_abi (info, gdbarch, tdesc_x32_linux,
>
> I cannot approve the patch, but I noticed that you forgot to add
> an empty line after the last local variable declaration.
>
> --
> Joel
Here is the updated patch. Thanks.
--
H.J.
--
* amd64-linux-tdep.c (amd64_ilp32_linux_init_abi): Set long and
ptr to 32 bits. Set sp_regnum_from_eax to AMD64_RSP_REGNUM and
pc_regnum_from_eax to AMD64_RIP_REGNUM.
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index d0c6f8f..0348cde 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -1572,8 +1572,14 @@ static void
amd64_ilp32_linux_init_abi (struct gdbarch_info info,
struct gdbarch *gdbarch)
{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
amd64_linux_init_abi (info, gdbarch, tdesc_x32_linux,
svr4_ilp32_fetch_link_map_offsets);
+ set_gdbarch_long_bit (gdbarch, 32);
+ set_gdbarch_ptr_bit (gdbarch, 32);
+ tdep->sp_regnum_from_eax = AMD64_RSP_REGNUM;
+ tdep->pc_regnum_from_eax = AMD64_RIP_REGNUM;
}
--
1.7.6.5