]> granicus.if.org Git - strace/commitdiff
process.c: move process_vm_readv and process_vm_writev parsers to a separate file
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 11 Dec 2014 19:21:54 +0000 (19:21 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 11 Dec 2014 21:40:23 +0000 (21:40 +0000)
* process_vm.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* process.c (sys_process_vm_readv, sys_process_vm_writev): Move
to process_vm.c.

Makefile.am
process.c
process_vm.c [new file with mode: 0644]

index ef1f1d00a37a93c8eb3d551fcd8082c795c67753..b6503ed958a43990988dfdfb5d037ef75e5318a3 100644 (file)
@@ -56,6 +56,7 @@ strace_SOURCES =      \
        personality.c   \
        printmode.c     \
        process.c       \
+       process_vm.c    \
        ptp.c           \
        quota.c         \
        readahead.c     \
index afb86de91df7d1e7f202987a6400c9681b9bbfc6..ede4224bd6a460f710b184efc207b3446df9d332 100644 (file)
--- a/process.c
+++ b/process.c
@@ -2532,56 +2532,3 @@ sys_getcpu(struct tcb *tcp)
        }
        return 0;
 }
-
-int
-sys_process_vm_readv(struct tcb *tcp)
-{
-       if (entering(tcp)) {
-               /* arg 1: pid */
-               tprintf("%ld, ", tcp->u_arg[0]);
-       } else {
-               /* arg 2: local iov */
-               if (syserror(tcp)) {
-                       tprintf("%#lx", tcp->u_arg[1]);
-               } else {
-                       tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
-               }
-               /* arg 3: local iovcnt */
-               tprintf(", %lu, ", tcp->u_arg[2]);
-               /* arg 4: remote iov */
-               if (syserror(tcp)) {
-                       tprintf("%#lx", tcp->u_arg[3]);
-               } else {
-                       tprint_iov(tcp, tcp->u_arg[4], tcp->u_arg[3], 0);
-               }
-               /* arg 5: remote iovcnt */
-               /* arg 6: flags */
-               tprintf(", %lu, %lu", tcp->u_arg[4], tcp->u_arg[5]);
-       }
-       return 0;
-}
-
-int
-sys_process_vm_writev(struct tcb *tcp)
-{
-       if (entering(tcp)) {
-               /* arg 1: pid */
-               tprintf("%ld, ", tcp->u_arg[0]);
-               /* arg 2: local iov */
-               if (syserror(tcp))
-                       tprintf("%#lx", tcp->u_arg[1]);
-               else
-                       tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
-               /* arg 3: local iovcnt */
-               tprintf(", %lu, ", tcp->u_arg[2]);
-               /* arg 4: remote iov */
-               if (syserror(tcp))
-                       tprintf("%#lx", tcp->u_arg[3]);
-               else
-                       tprint_iov(tcp, tcp->u_arg[4], tcp->u_arg[3], 0);
-               /* arg 5: remote iovcnt */
-               /* arg 6: flags */
-               tprintf(", %lu, %lu", tcp->u_arg[4], tcp->u_arg[5]);
-       }
-       return 0;
-}
diff --git a/process_vm.c b/process_vm.c
new file mode 100644 (file)
index 0000000..9bd85a8
--- /dev/null
@@ -0,0 +1,54 @@
+#include "defs.h"
+
+int
+sys_process_vm_readv(struct tcb *tcp)
+{
+       if (entering(tcp)) {
+               /* arg 1: pid */
+               tprintf("%ld, ", tcp->u_arg[0]);
+       } else {
+               /* arg 2: local iov */
+               if (syserror(tcp)) {
+                       tprintf("%#lx", tcp->u_arg[1]);
+               } else {
+                       tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
+               }
+               /* arg 3: local iovcnt */
+               tprintf(", %lu, ", tcp->u_arg[2]);
+               /* arg 4: remote iov */
+               if (syserror(tcp)) {
+                       tprintf("%#lx", tcp->u_arg[3]);
+               } else {
+                       tprint_iov(tcp, tcp->u_arg[4], tcp->u_arg[3], 0);
+               }
+               /* arg 5: remote iovcnt */
+               /* arg 6: flags */
+               tprintf(", %lu, %lu", tcp->u_arg[4], tcp->u_arg[5]);
+       }
+       return 0;
+}
+
+int
+sys_process_vm_writev(struct tcb *tcp)
+{
+       if (entering(tcp)) {
+               /* arg 1: pid */
+               tprintf("%ld, ", tcp->u_arg[0]);
+               /* arg 2: local iov */
+               if (syserror(tcp))
+                       tprintf("%#lx", tcp->u_arg[1]);
+               else
+                       tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
+               /* arg 3: local iovcnt */
+               tprintf(", %lu, ", tcp->u_arg[2]);
+               /* arg 4: remote iov */
+               if (syserror(tcp))
+                       tprintf("%#lx", tcp->u_arg[3]);
+               else
+                       tprint_iov(tcp, tcp->u_arg[4], tcp->u_arg[3], 0);
+               /* arg 5: remote iovcnt */
+               /* arg 6: flags */
+               tprintf(", %lu, %lu", tcp->u_arg[4], tcp->u_arg[5]);
+       }
+       return 0;
+}