Re: [PATCH] fix: support LoongArch64 in my-syscalls.S to resolve step-over-thread-exit-while-stop-all-threads.exp build failure

Tiezhu Yang
2025-10-22T09:06:49Z

On 2025/10/22 下午4:48, Tiezhu Yang wrote:
> On 2025/10/22 上午3:30, Coder_Y wrote:
>> This patch adds syscall wrappers for LoongArch64 to
>> gdb/testsuite/lib/my-syscalls.S.
>
> It is better to change the patch title to:
> gdb/testsuite: Add LoongArch case in my-syscalls.S
>
>> - Implements the missing `__loongarch64` section
>> - Uses `lu12i.w` + `ori` to load the syscall number into `$a7`
>
> Why not using the instruction "li.w" directly?
>
>> - Triggers system calls via `syscall 0`
>> - Returns to caller using `jr $ra`
>
> You can use the instruction "ret" to make it more readable.
> please see opcodes/loongarch-opc.c file to get more info.
>
>> This change fixes build failures in LoongArch64 when running:
>>    gdb.threads/step-over-thread-exit-while-stop-all-threads.exp
>>
>> Tested on: loongarch64-unknown-linux-gnu
>> Result: expected testcases passed
>
> Did you meet any real problems when debugging?
> If yes, please describe it in the commit message.
>
>> Signed-off-by: Nick Young <zewyang@foxmail.com>
>
> Please use your real name here and make it consistent with 'From'
> instead of abbreviation.

Forgot to say, it should use your company email if you are an
employee of Loongson company (we have signed the FSF copyright
assignment), then I can push the updated patch for you.

Thanks,
Tiezhu