From 6331fd4b32bd5d5028f6183137d0cf98f7ae8337 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sat, 30 Apr 2016 17:15:04 +0000 Subject: [PATCH] nsyscalls.test: add mips o32 support Out-of-range syscalls looks differently on mips o32. * tests/nsyscalls.c (main): Handle LINUX_MIPSO32. * tests/nsyscalls.test: Trace syscall called "syscall" on mips. --- tests/nsyscalls.c | 6 ++++++ tests/nsyscalls.test | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/nsyscalls.c b/tests/nsyscalls.c index 81a90aa5..25f0719f 100644 --- a/tests/nsyscalls.c +++ b/tests/nsyscalls.c @@ -71,9 +71,15 @@ main(void) }; long rc = syscall(nr, a[0], a[1], a[2], a[3], a[4], a[5]); +#ifdef LINUX_MIPSO32 + printf("syscall(%#lx, %#lx, %#lx, %#lx, %#lx, %#lx, %#lx)" + " = %ld ENOSYS (%m)\n", nr, + a[0], a[1], a[2], a[3], a[4], a[5], rc); +#else printf("syscall_%lu(%#lx, %#lx, %#lx, %#lx, %#lx, %#lx)" " = %ld (errno %d)\n", nr & (~SYSCALL_BIT), a[0], a[1], a[2], a[3], a[4], a[5], rc, errno); +#endif puts("+++ exited with 0 +++"); return 0; diff --git a/tests/nsyscalls.test b/tests/nsyscalls.test index 46f9b0a0..3760831e 100755 --- a/tests/nsyscalls.test +++ b/tests/nsyscalls.test @@ -3,4 +3,10 @@ # Check decoding of out-of-range syscalls. . "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=none + +case "$STRACE_ARCH" in + mips) syscall=syscall ;; + *) syscall=none ;; +esac + +run_strace_match_diff -e trace=$syscall -- 2.40.0