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]

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


Hi,

This patch should be applied on top of

http://sourceware.org/ml/gdb-patches/2012-05/msg00460.html
http://sourceware.org/ml/gdb-patches/2012-05/msg00462.html

It sets size of long/ptr as well as sp/pc for x32.  OK to install after
the above patches are approved?

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,13 @@ 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;
 }
 
 


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