This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Set size of long/ptr as well as sp/pc for x32


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]