From: Kevin Buettner via Gdb-patches <gdb-patches@sourceware.org>
To: "jiangshuai_li" <jiangshuai_li@linux.alibaba.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2] gdb/csky support .reg2 for kernel 4.x and later
Date: Thu, 28 Jul 2022 10:55:28 -0700 [thread overview]
Message-ID: <20220728105528.7338737f@f35-zws-1> (raw)
In-Reply-To: <a85a9408-e7d7-489f-857e-c4e7494b9a8d.jiangshuai_li@linux.alibaba.com>
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
next prev parent reply other threads:[~2022-07-28 17:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-27 7:29 jiangshuai_li via Gdb-patches
2022-07-28 17:55 ` Kevin Buettner via Gdb-patches [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-07-25 2:44 Jiangshuai Li via Gdb-patches
2022-07-27 0:49 ` Kevin Buettner via Gdb-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220728105528.7338737f@f35-zws-1 \
--to=gdb-patches@sourceware.org \
--cc=jiangshuai_li@linux.alibaba.com \
--cc=kevinb@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox