public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Xiao Zeng" <zengxiao@eswincomputing.com>
To: "Andrew Pinski" <pinskia@gmail.com>
Cc: "Andrew Burgess" <aburgess@redhat.com>,
	 "Nelson Chu" <nelson@rivosinc.com>,
	 gdb-patches <gdb-patches@sourceware.org>
Subject: Re: Fwd: [PATCH] RISC-V: Correction of machine registers mapping to dwarf registers
Date: Wed, 7 Dec 2022 10:00:59 +0800	[thread overview]
Message-ID: <202212071000598220751@eswincomputing.com> (raw)
In-Reply-To: <CA+=Sn1kYC4Gmk=LjPMBredoP9wOs3QO1qQ+o8=bvS+cpi7Br2w@mail.gmail.com>

On Wed, Dec 7, 2022 at 09:50:00 AM Andrew Pinski <pinskia@gmail.com> wrote:
>
>On Tue, Dec 6, 2022 at 5:46 PM Xiao Zeng <zengxiao@eswincomputing.com> wrote:
>>
>> On Tue, Dec 6, 2022 at 12:00:00 AM Andrew Burgess <aburgess@redhat.com> wrote:
>> >
>> >Nelson Chu <nelson@rivosinc.com> writes:
>> >
>> >> Forward to gdb mailing list and cc Andrew since it seems under the gdb folder.
>> >>
>>
>> I will mention the gdb patch in the correct mailing list next time,thanks Nelson.
>>
>> >> Thanks
>> >> Nelson
>> >>
>> >> ---------- Forwarded message ---------
>> >> From: Xiao Zeng <zengxiao@eswincomputing.com>
>> >> Date: Tue, Dec 6, 2022 at 1:39 PM
>> >> Subject: [PATCH] RISC-V: Correction of machine registers mapping to
>> >> dwarf registers
>> >> To: <binutils@sourceware.org>
>> >> Cc: <kito.cheng@gmail.com>, <palmer@dabbelt.com>,
>> >> <nelson@rivosinc.com>, Xiao Zeng <zengxiao@eswincomputing.com>
>> >>
>> >>
>> >> According to the riscv psabi, the mapping relationship between the
>> >> dwarf registers and the machine registers are as follows:
>> >>
>> >> DWARF Number | Register Name | Description
>> >> 0 - 31       | x0 - x31      | Integer Registers
>> >> 32 - 63      | f0 - f31      | Floating-point Registers
>> >>
>> >>         * gdb/riscv-tdep.c (riscv_dwarf_reg_to_regnum): Correct mapping
>> >>         boundary register.
>> >
>> >Thanks for catching this.  I went ahead and merged this patch.
>> >
>> >Thanks,
>> >Andrew
>>
>> hi, Andrew
>> I still don't know why gdb has a separate mailing list as a part of bintuils.
>> Can you give me an explanation when you are free?
>
>Because technically they are separate projects with their own release
>schedules. Just happens they share the same repositories; mostly
>because BFD is common between the two.
>
>Thanks,
>Andrew 

I see, thanks Andrew.

Thanks
Xiao
>
>>
>> Thanks
>> Xiao
>>
>> >
>> >> ---
>> >>  gdb/riscv-tdep.c | 4 ++--
>> >>  1 file changed, 2 insertions(+), 2 deletions(-)
>> >>
>> >> diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c
>> >> index 0a050b272ff..a298623b449 100644
>> >> --- a/gdb/riscv-tdep.c
>> >> +++ b/gdb/riscv-tdep.c
>> >> @@ -3623,10 +3623,10 @@ riscv_add_reggroups (struct gdbarch *gdbarch)
>> >>  static int
>> >>  riscv_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg)
>> >>  {
>> >> -  if (reg < RISCV_DWARF_REGNUM_X31)
>> >> +  if (reg <= RISCV_DWARF_REGNUM_X31)
>> >>      return RISCV_ZERO_REGNUM + (reg - RISCV_DWARF_REGNUM_X0);
>> >>
>> >> -  else if (reg < RISCV_DWARF_REGNUM_F31)
>> >> +  else if (reg <= RISCV_DWARF_REGNUM_F31)
>> >>      return RISCV_FIRST_FP_REGNUM + (reg - RISCV_DWARF_REGNUM_F0);
>> >>
>> >>    else if (reg >= RISCV_DWARF_FIRST_CSR && reg <= RISCV_DWARF_LAST_CSR)
>> >> --
>> >> 2.34.1
>>
>>

      reply	other threads:[~2022-12-07  2:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20221206053947.821648-1-zengxiao@eswincomputing.com>
2022-12-06  6:59 ` Nelson Chu
2022-12-06 10:21   ` Andrew Burgess
2022-12-07  1:45     ` Xiao Zeng
2022-12-07  1:50       ` Andrew Pinski
2022-12-07  2:00         ` Xiao Zeng [this message]

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=202212071000598220751@eswincomputing.com \
    --to=zengxiao@eswincomputing.com \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nelson@rivosinc.com \
    --cc=pinskia@gmail.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).