public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Jiangshuai Li <jiangshuai_li@c-sky.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb:csky add support target-descriptions for CSKY arch
Date: Thu, 07 Apr 2022 09:32:21 -0600	[thread overview]
Message-ID: <87ilrkaoze.fsf@tromey.com> (raw)
In-Reply-To: <20220328020338.2360-1-jiangshuai_li@c-sky.com> (Jiangshuai Li's message of "Mon, 28 Mar 2022 10:03:38 +0800")

>>>>> Jiangshuai Li <jiangshuai_li@c-sky.com> writes:

Thank you for the patch.

I don't know anything about csky and so I can't really review any of the
architecture details.  I'll just take your word for that.

> diff --git a/gdb/csky-tdep.c b/gdb/csky-tdep.c
> index 04f558cf14b..447baa1ed58 100644
> --- a/gdb/csky-tdep.c
> +++ b/gdb/csky-tdep.c
> @@ -67,6 +67,424 @@ static struct reggroup *vr_reggroup;
>  static struct reggroup *mmu_reggroup;
>  static struct reggroup *prof_reggroup;
 
> +static char *csky_supported_tdesc_feature_names[] = {
> +  (char *)"org.gnu.csky.abiv2.gpr",

I think the casts here are a red flag, you ought to make the array use
"const char *".

> +struct csky_supported_tdesc_register
> +{
> +  char name[16];

I think "const char *" here is probably better as well, just because
it's more idiomatic.

> +/* Get csky supported registers's count for tdesc xml.  */
> +static int
> +csky_get_supported_tdesc_registers_count()
> +{
> +  int count = 0;
> +  int size = sizeof (struct csky_supported_tdesc_register);
> +  count += sizeof (csky_supported_gpr_regs)/size;
> +  count += sizeof (csky_supported_fpu_regs)/size;

I suggest using the ARRAY_SIZE macro instead.

> +/* Return a supported register according to index.  */
> +static struct csky_supported_tdesc_register *
> +csky_get_supported_register_by_index (int index)
> +{
> +  static struct csky_supported_tdesc_register tdesc_reg;
> +  int count = 0;
> +  int multi, remain;
> +  int size = sizeof (struct csky_supported_tdesc_register);
> +  int count_gpr = sizeof (csky_supported_gpr_regs)/size;

Here too.

> +/* Check whether xml has discribled the essential regs.  */

Typo, "described".

Tom

  reply	other threads:[~2022-04-07 15:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28  2:03 Jiangshuai Li
2022-04-07 15:32 ` Tom Tromey [this message]
2022-05-30  3:31 李江帅

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=87ilrkaoze.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jiangshuai_li@c-sky.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).