This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils 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 4/4] unwinder: s390 and s390x


On Wed, 18 Dec 2013 18:10:16 +0100, Mark Wielaard wrote:
> +2013-12-18  Mark Wielaard  <mjw@redhat.com>
> +
> +	* 390_initreg.c (s390_set_initial_registers_tid): Use union
         ^^ missing 's'

> +	to avoid type-punning when assigning a double to a Dwarf_Word.
> +
>  2013-12-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
>  
>  	unwinder: s390 and s390x
> diff --git a/backends/s390_initreg.c b/backends/s390_initreg.c
> index 62a1531..8fc54bc 100644
> --- a/backends/s390_initreg.c
> +++ b/backends/s390_initreg.c
> @@ -68,8 +68,19 @@ s390_set_initial_registers_tid (pid_t tid __attribute__ ((unused)),
>    eu_static_assert (sizeof user_regs.regs.fp_regs.fprs[0]
>  		    == sizeof dwarf_regs[0]);
>    for (unsigned u = 0; u < 16; u++)
> -    dwarf_regs[u] = *((const __typeof (dwarf_regs[0]) *)
> -		      &user_regs.regs.fp_regs.fprs[u]);
> +    {
> +      // Store the double bits as is in the Dwarf_Word without conversion.
> +      union
> +	{
> +	  double d;
> +	  Dwarf_Word w;
> +	} fpr = { .d = user_regs.regs.fp_regs.fprs[u] };
> +      dwarf_regs[u] = fpr.w;
> +    }
> +   if (! setfunc (16, 16, dwarf_regs, arg))
> +     return false;
> +   dwarf_regs[0] = user_regs.regs.psw.addr;

These are excessive 3 lines.  They weren't there before.


> +
>    if (! setfunc (16, 16, dwarf_regs, arg))
>      return false;
>    dwarf_regs[0] = user_regs.regs.psw.addr;
> -- 
> 1.7.1
> 


Thanks,
Jan

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