From: Zewei Yang Date: Thu, 23 Oct 2025 01:45:49 +0000 (+0800) Subject: gdb/testsuite: Add LoongArch case in my-syscalls.S X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f06e09588da76e0f3f017a59daf26bf30c5e525f;p=thirdparty%2Fbinutils-gdb.git gdb/testsuite: Add LoongArch case in my-syscalls.S When running the following command on LoongArch: git clone git://sourceware.org/git/binutils-gdb.git gdb mkdir -p build && cd build && ../gdb/configure && make -j"$(nproc)" make check-gdb TESTS="gdb.threads/step-over-thread-exit-while-stop-all-threads.exp" there exists the following error: gdb/gdb/testsuite/lib/my-syscalls.S:67:3: error: #error "Unsupported architecture" this is because there is no SYSCALL macro for LoongArch, just add it. With this patch, the above test passes on LoongArch. Signed-off-by: Zewei Yang Tested-by: Tiezhu Yang Signed-off-by: Tiezhu Yang --- diff --git a/gdb/testsuite/lib/my-syscalls.S b/gdb/testsuite/lib/my-syscalls.S index c514b32d1f3..f128469b80e 100644 --- a/gdb/testsuite/lib/my-syscalls.S +++ b/gdb/testsuite/lib/my-syscalls.S @@ -63,6 +63,17 @@ NAME: ;\ NAME ## _syscall: ;\ svc #0 +#elif defined(__loongarch64) + +#define SYSCALL(NAME, NR) \ +.global NAME ;\ +NAME: ;\ + li.w $a7, NR ;\ + /* a0, a1 and a2 already contain the right arguments. */ \ +NAME ## _syscall: ;\ + syscall 0 ;\ + ret + #else # error "Unsupported architecture" #endif