public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tiezhu Yang <yangtiezhu@loongson.cn>
To: Xi Ruoyao <xry111@xry111.site>, gdb-patches@sourceware.org
Cc: Xuefeng Li <lixuefeng@loongson.cn>
Subject: Re: [PATCH v2] gdb: LoongArch: add orig_a0 into register set
Date: Tue, 5 Jul 2022 22:38:00 +0800	[thread overview]
Message-ID: <482d74d5-9377-02b4-9866-aec8f5fee32e@loongson.cn> (raw)
In-Reply-To: <95fc996abd9583348184a81cdd9bc5760fba17e1.camel@xry111.site>



On 7/4/22 14:20, Xi Ruoyao wrote:
> Hi Tiezhu,
> 
> Thanks for the review.
> 
> On Mon, 2022-07-04 at 10:50 +0800, Tiezhu Yang wrote:
> 
>> The related code in gdb/loongarch-linux-nat.c also need to be
>> modified.
> 
> Done in v2.
> 
>> Additionally, we know that the LoongArch upstream Linux kernel can not
>> actually be used before efistub, irqchip and pci are merged [0].
>>
>> [0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c6f2f3e2c80e
>>
>> So I think we can modify the patch subject and the commit message like
>> this:
> 
> Done in v2, with some modification.
> 
> Patch v2 follows here:
> 
> -- >8 --
> 
> 
> The basic support for LoongArch has been merged into the upstream Linux
> kernel since 5.19-rc1 on June 5, 2022.  This commit adds orig_a0 which
> is added into struct user_pt_regs [1] to match the upstream kernel, and
> then the upstream GDB will work with the upstream kernel.
> 
> Note that orig_a0 was added into struct user_pt_regs in the development
> cycle for merging LoongArch port into the upstream Linux kernel, so
> earlier kernels (notably, the product kernel with version 4.19 used in
> distros like UOS and Loongnix) don't have it.  Inspect
> arch/loongarch/include/uapi/asm/ptrace.h in the kernel tree to make sure.
> To build upstream GDB for a kernel lacking orig_a0, it's necessary to
> revert this commit locally.
> 
> [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/loongarch/include/uapi/asm/ptrace.h#n24
> 
> Signed-off-by: Xi Ruoyao <xry111@xry111.site>
> ---
>   gdb/features/loongarch/base32.c   | 1 +
>   gdb/features/loongarch/base32.xml | 1 +
>   gdb/features/loongarch/base64.c   | 1 +
>   gdb/features/loongarch/base64.xml | 1 +
>   gdb/loongarch-linux-nat.c         | 2 ++
>   gdb/loongarch-linux-tdep.c        | 8 ++++++++
>   gdb/loongarch-tdep.c              | 1 +
>   gdb/loongarch-tdep.h              | 7 ++++---
>   8 files changed, 19 insertions(+), 3 deletions(-)
> 

Looks good to me, this patch only touches files related with LoongArch,
pushed.

Thanks,
Tiezhu


      reply	other threads:[~2022-07-05 14:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-03  3:58 [PATCH] " Xi Ruoyao
2022-07-04  2:50 ` Tiezhu Yang
2022-07-04  6:20   ` [PATCH v2] " Xi Ruoyao
2022-07-05 14:38     ` Tiezhu Yang [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=482d74d5-9377-02b4-9866-aec8f5fee32e@loongson.cn \
    --to=yangtiezhu@loongson.cn \
    --cc=gdb-patches@sourceware.org \
    --cc=lixuefeng@loongson.cn \
    --cc=xry111@xry111.site \
    /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).