public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: 李江帅 <jiangshuai_li@c-sky.com>
To: "Tom Tromey" <tom@tromey.com>
Cc: "gdb-patches" <gdb-patches@sourceware.org>
Subject: Re:[PATCH] gdb/csky complete csky_dwarf_reg_to_regnum
Date: Mon, 18 Jul 2022 10:50:22 +0800	[thread overview]
Message-ID: <772531f3-b91d-48e7-8ec4-3587600d97db.jiangshuai_li@c-sky.com> (raw)

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

>
>> +  if (dw_reg >= CSKY_R0_REGNUM && dw_reg <= (CSKY_R0_REGNUM + 31))
>
>This line and some others have too many parentheses.

This line meens that "if (dw_reg >=0 && dw_reg <= 31)". As i does not define CSKY_R31_REGNUM,
i wrote 31 as (CSKY_R0_REGNUM + 31).

>> +  /* For Float and Vector pseudo registers.  */
>> +  if ((dw_reg >= FV_PSEUDO_REGNO_FIRST)  && (dw_reg <= FV_PSEUDO_REGNO_LAST))
>> +    {
>> +      char name_buf[4];
>> +
>> +      xsnprintf (name_buf, sizeof (name_buf), "s%d",
>> +                 dw_reg - FV_PSEUDO_REGNO_FIRST);
>> +      return user_reg_map_name_to_regnum (gdbarch, name_buf,
>> +                                          strlen (name_buf));
>
>This seems like a very roundabout approach.  Is there a reason it's done
>this way?

I am not sure what you mean, this code mean that:
if (dw_reg >= 74 && dw_reg <= 201),  dw_reg will corresponds to a pseudo register
added for float or vector registers.

Similar code: arm-tdep.c: 4876

>
>Tom

Jiangshuai.

             reply	other threads:[~2022-07-18  2:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-18  2:50 李江帅 [this message]
2022-07-18 16:16 ` Tom Tromey

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=772531f3-b91d-48e7-8ec4-3587600d97db.jiangshuai_li@c-sky.com \
    --to=jiangshuai_li@c-sky.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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).