[PATCH v2] gdb/csky support .reg2 for kernel 4.x and later
Kevin Buettner
kevinb@redhat.com
Thu Jul 28 17:55:28 GMT 2022
On Wed, 27 Jul 2022 15:29:17 +0800
"jiangshuai_li" <jiangshuai_li@linux.alibaba.com> wrote:
> >> + /* Supply vr0~vr15. */
> >> + for (i = 0; i < 16; i ++)
> >> + {
> >> + if (gdbarch_register_name (gdbarch, (CSKY_VR0_REGNUM + i)))
> >> + {
> >> + offset = 16 * i;
> >> + regcache->raw_supply (CSKY_VR0_REGNUM + i,
> >> + fregs + offset);
> >> + }
> >> + }
> >> + /* Supply fr0~fr15. */
> >> + for (i = 0; i < 16; i ++)
> >> + {
> >> + if (gdbarch_register_name (gdbarch, (CSKY_FR0_REGNUM + i)))
> >> + {
> >> + offset = 16 * i;
> >
> >Are these offsets correct? I.e. do the fr0~fr15 registers use
> >the same offsets as vr0~vr15?
>
> Yes. The bit width of floating-point register is 64bits, and the bit width of vector
> register is 128bit. In fr0~fr15 and vr0~vr15, each FRx is the lower 64 bits of
> the corresponding VRx.
Thanks for the explanation. You might consider adding a comment
about this if one doesn't already exist.
> >Also, not related to this patch, but while trying to figure this out,
> >I found this line in csky-tdep.h - it looks fishy to me since it's
> >way bigger than CSKY_MAX_REGS:
> >
> > CSKY_FR16_REGNUM = 1172,
>
> Actually, the max regs number should be 1187, but if the gdb stub does not send a
> tdesc-xml file to gdb, 253 works.
Again, a comment regarding this fact would be nice...
Kevin
More information about the Gdb-patches
mailing list