[patch 4/4] unwinder: s390 and s390x

Jan Kratochvil jan.kratochvil at redhat.com
Wed Dec 18 16:51:37 UTC 2013


On Wed, 18 Dec 2013 17:06:29 +0100, Mark Wielaard wrote:
> I thought I understood
> the casting, but apparently the compiler (gcc 4.8.2) doesn't...

One has to run the compiler on s390* machine as I forgot first.


> --- a/backends/s390_initreg.c
> +++ b/backends/s390_initreg.c
> @@ -68,8 +68,15 @@ 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;
> 

Yes, I am fine with the patch, please check it in.


Thanks,
Jan


More information about the elfutils-devel mailing list