process.c: move process_vm_readv and process_vm_writev parsers to a separate file
* 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.
This commit is contained in:
parent
52572b6fdd
commit
db16c52668
@ -56,6 +56,7 @@ strace_SOURCES = \
|
||||
personality.c \
|
||||
printmode.c \
|
||||
process.c \
|
||||
process_vm.c \
|
||||
ptp.c \
|
||||
quota.c \
|
||||
readahead.c \
|
||||
|
53
process.c
53
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;
|
||||
}
|
||||
|
54
process_vm.c
Normal file
54
process_vm.c
Normal file
@ -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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user