Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* PATCH: Set size of long/ptr as well as sp/pc for x32
@ 2012-05-14 18:02 H.J. Lu
  2012-05-14 18:11 ` Joel Brobecker
  0 siblings, 1 reply; 3+ messages in thread
From: H.J. Lu @ 2012-05-14 18:02 UTC (permalink / raw)
  To: GDB

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;
 }
 \f
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH: Set size of long/ptr as well as sp/pc for x32
  2012-05-14 18:02 PATCH: Set size of long/ptr as well as sp/pc for x32 H.J. Lu
@ 2012-05-14 18:11 ` Joel Brobecker
  2012-05-14 18:16   ` H.J. Lu
  0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2012-05-14 18:11 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GDB

>  {
> +  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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH: Set size of long/ptr as well as sp/pc for x32
  2012-05-14 18:11 ` Joel Brobecker
@ 2012-05-14 18:16   ` H.J. Lu
  0 siblings, 0 replies; 3+ messages in thread
From: H.J. Lu @ 2012-05-14 18:16 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: GDB

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-14 18:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-14 18:02 PATCH: Set size of long/ptr as well as sp/pc for x32 H.J. Lu
2012-05-14 18:11 ` Joel Brobecker
2012-05-14 18:16   ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox