Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tiezhu Yang <yangtiezhu@loongson.cn>
To: Zewei Yang <yangzewei@loongson.cn>, gdb-patches@sourceware.org
Subject: Re: [PATCH V2] gdb/testsuite: Add LoongArch case in my-syscalls.S
Date: Thu, 30 Oct 2025 22:11:10 +0800	[thread overview]
Message-ID: <7e43ceed-cd49-d880-3a3d-14818f00e8d5@loongson.cn> (raw)
In-Reply-To: <d0a1323a-217f-18ed-5a53-ee7a8d18d008@loongson.cn>

On 10/24/25 10:44, Tiezhu Yang wrote:
> On 2025/10/23 上午9:45, Zewei Yang wrote:
>> This patch adds syscall wrappers for LoongArch64 to 
>> gdb/testsuite/lib/my-syscalls.S.
>>
>> - Implements the missing `__loongarch64` section.
>> - Uses `li.w` to load the syscall number into `$a7`.
>> - Triggers system calls via `syscall 0`.
>> - Returns to the caller using `ret`.
>>
>> This change fixes build errors when running
>> `gdb.threads/step-over-thread-exit-while-stop-all-threads.exp`
>> on LoongArch64 targets caused by the absence of the LoongArch-specific
>> syscall wrappers in `my-syscalls.S`.
>>
>> Tested on: loongarch64-unknown-linux-gnu
>> Result: expected testcases passed.
>>
>> Signed-off-by: Zewei Yang <yangzewei@loongson.cn>
>> ---
>>   gdb/testsuite/lib/my-syscalls.S | 12 ++++++++++++
>>   1 file changed, 12 insertions(+)
>>
>> diff --git a/gdb/testsuite/lib/my-syscalls.S 
>> b/gdb/testsuite/lib/my-syscalls.S
>> index c514b32d..3e2e397d 100644
>> --- a/gdb/testsuite/lib/my-syscalls.S
>> +++ b/gdb/testsuite/lib/my-syscalls.S
>> @@ -63,6 +63,18 @@ NAME:                ;\
>>   NAME ## _syscall:        ;\
>>       svc #0
>> +#elif defined(__loongarch64)
>> +
>> +/* LoongArch 64-bit syscall wrapper */
>> +#define SYSCALL(NAME, NR)       \
>> +.global NAME                    ;\
>> +NAME:                           ;\
>> +        li.w     $a7, NR        ;\
>> +        /* syscall number */ \
>> +NAME ## _syscall:               ;\
>> +        syscall 0                       ;\
>> +        ret
>> +
>>   #else
>>   # error "Unsupported architecture"
>>   #endif
> 
> Looks good to me in general, if there are no more comments or
> objections, I will adjust the commit message and code format,
> then push this patch in the next week, because it is related
> with LoongArch and no side effect for the other archs.

Pushed.

Thanks,
Tiezhu


      reply	other threads:[~2025-10-30 14:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-21 19:30 [PATCH] fix: support LoongArch64 in my-syscalls.S to resolve step-over-thread-exit-while-stop-all-threads.exp build failure Coder_Y
2025-10-22  8:48 ` Tiezhu Yang
2025-10-22  9:06   ` Tiezhu Yang
2025-10-23  1:29     ` yangzewei
2025-10-23  1:45       ` [PATCH V2] gdb/testsuite: Add LoongArch case in my-syscalls.S Zewei Yang
2025-10-24  2:44         ` Tiezhu Yang
2025-10-30 14:11           ` 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=7e43ceed-cd49-d880-3a3d-14818f00e8d5@loongson.cn \
    --to=yangtiezhu@loongson.cn \
    --cc=gdb-patches@sourceware.org \
    --cc=yangzewei@loongson.cn \
    /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