]> granicus.if.org Git - strace/commitdiff
Do not shuffle scno inside syscall_name
authorEugene Syromyatnikov <evgsyr@gmail.com>
Thu, 1 Feb 2018 11:50:31 +0000 (12:50 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 10 Feb 2018 00:01:01 +0000 (00:01 +0000)
This makes interface a bit irregular otherwise.

* defs.h (syscall_name): Clarify description.
* syscall.c (syscall_name): Do not call shuffle_scno.
* printsiginfo.c (print_si_info) <case SIGSYS>: Use shuffle_scno.

defs.h
printsiginfo.c
syscall.c

diff --git a/defs.h b/defs.h
index 1a6c789bac417f8430d8ef33d0d5f914fa5d2482..a014ccf9400e72f21b5c9fd5a7417bcb3007209e 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -400,7 +400,7 @@ extern int get_scno(struct tcb *);
 extern kernel_ulong_t get_rt_sigframe_addr(struct tcb *);
 
 /**
- * Convert syscall number to syscall name.
+ * Convert a (shuffled) syscall number to the corresponding syscall name.
  *
  * @param scno Syscall number.
  * @return     String literal corresponding to the syscall number in case latter
index d5ff8757fdd155c412aedca12c8ed1f21f1ff063..e5a80ce4bcfa25161c5bdeda4d45fccbf94cee3a 100644 (file)
@@ -209,8 +209,8 @@ print_si_info(const siginfo_t *sip)
                         *  - Looks like there are no other cases where SIGSYS
                         *    is delivered from the kernel so far.
                         */
-                       const char *scname =
-                               syscall_name((unsigned) sip->si_syscall);
+                       const char *scname = syscall_name(shuffle_scno(
+                               (unsigned) sip->si_syscall));
 
                        tprints(", si_call_addr=");
                        printaddr(ptr_to_kulong(sip->si_call_addr));
index 41353c0a713b3cf7d1bf4962beaa60b9f1d40dfc..81f762cddbad17f5386af3f9aae9bc6c7f25b18d 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -1276,7 +1276,5 @@ get_syscall_result(struct tcb *tcp)
 const char *
 syscall_name(kernel_ulong_t scno)
 {
-       scno = shuffle_scno(scno);
-
        return scno_is_valid(scno) ? sysent[scno].sys_name : NULL;
 }