[PATCH 2/5] backends: Add set_initial_registers_tid callback for LoongArch

Mark Wielaard mark@klomp.org
Mon May 8 19:57:44 GMT 2023


Him

On Fri, Apr 07, 2023 at 10:59:25AM +0800, Youling Tang wrote:
> This patch implements the set_initial_registers_tid hook for LoongArch.

Looks good, but one question:

> +  /* Floating-point registers (only 64bits are used).  */
> +  struct user_fp_struct fregs;
> +  iovec.iov_base = &fregs;
> +  iovec.iov_len = sizeof (fregs);
> +  if (ptrace (PTRACE_GETREGSET, tid, NT_FPREGSET, &iovec) != 0)
> +    return false;
> +
> +  Dwarf_Word dwarf_fregs[32];
> +  for (int r = 0; r < 32; r++)
> +    dwarf_fregs[r] = fregs.fpr[r] & 0xFFFFFFFF;

The comment says 64bits, but the mask is for 32bits.
I assume the comment is wrong and the masking is deliberate?

Cheers,

Mark


More information about the Elfutils-devel mailing list