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 3/3] Support x32 sigtramp


> Date: Thu, 21 Jun 2012 11:20:25 -0700
> From: "H.J. Lu" <hongjiu.lu@intel.com>
> 
> Hi,
> 
> This patch adds x32 sigtramp support.  The only difference from x86-64
> is the value of __NR_rt_sigreturn:
> 
> usr/include/asm/unistd_64.h:#define __NR_rt_sigreturn 15
> 
> and
> 
> /* X32 system call bit.  */
> #define __X32_SYSCALL_BIT	0x40000000
> 
> /usr/include/asm/unistd_x32.h:#define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513)
> 
>             byte  0     1     2      3
> AMD64:      0xf: 0x0f, 0x00, 0x00, 0x00
> X32: 0x40000201: 0x01, 0x02, 0x00, 0x40
> 
> OK to install?
> 
> Thanks.
> 
> H.J.
> ---
> 	* amd64-linux-tdep.c (linux_sigtramp_code): Renamed to ...
> 	(amd64_linux_sigtramp_code): This.
> 	(x32_linux_sigtramp_code): New.
> 	(LINUX_SIGTRAMP_LEN): Updated.
> 	(amd64_linux_sigtramp_start): Check x32 sigtramp.
> 
> ---
>  gdb/amd64-linux-tdep.c |   21 ++++++++++++++++++---
>  1 files changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
> index 0adc22b..4e64e72 100644
> --- a/gdb/amd64-linux-tdep.c
> +++ b/gdb/amd64-linux-tdep.c
> @@ -107,7 +107,7 @@ int amd64_linux_gregset_reg_offset[] =
>  #define LINUX_SIGTRAMP_INSN1	0x0f	/* syscall */
>  #define LINUX_SIGTRAMP_OFFSET1	7
>  
> -static const gdb_byte linux_sigtramp_code[] =
> +static const gdb_byte amd64_linux_sigtramp_code[] =
>  {
>    /* mov $__NR_rt_sigreturn, %rax */
>    LINUX_SIGTRAMP_INSN0, 0xc7, 0xc0, 0x0f, 0x00, 0x00, 0x00,
> @@ -115,7 +115,15 @@ static const gdb_byte linux_sigtramp_code[] =
>    LINUX_SIGTRAMP_INSN1, 0x05
>  };
>  
> -#define LINUX_SIGTRAMP_LEN (sizeof linux_sigtramp_code)
> +static const gdb_byte x32_linux_sigtramp_code[] =

Can you rename that into amd64_x32_linux_sigtramp_code[] for
consistency with the rest of the code?

With that changes, this is ok.


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