Use tprints with literal strings, it may be faster than tprintf
* bjm.c: Replace tprintf("str") with tprints("str"). * block.c: Likewise. * desc.c: Likewise. * file.c: Likewise. * io.c: Likewise. * ipc.c: Likewise. * mem.c: Likewise. * net.c: Likewise. * proc.c: Likewise. * process.c: Likewise. * quota.c: Likewise. * resource.c: Likewise. * scsi.c: Likewise. * signal.c: Likewise. * sock.c: Likewise. * strace.c: Likewise. * stream.c: Likewise. * syscall.c: Likewise. * system.c: Likewise. * term.c: Likewise. * time.c: Likewise. * util.c: Likewise. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
This commit is contained in:
parent
5940e65939
commit
60fe8c139c
8
bjm.c
8
bjm.c
@ -102,9 +102,9 @@ sys_query_module(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printstr(tcp, tcp->u_arg[0], -1);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printxval(which, tcp->u_arg[1], "QM_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
size_t ret;
|
||||
|
||||
@ -126,7 +126,7 @@ sys_query_module(struct tcb *tcp)
|
||||
} else if ((tcp->u_arg[1]==QM_MODULES) ||
|
||||
(tcp->u_arg[1]==QM_DEPS) ||
|
||||
(tcp->u_arg[1]==QM_REFS)) {
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
if (!abbrev(tcp)) {
|
||||
char* data = malloc(tcp->u_arg[3]);
|
||||
char* mod = data;
|
||||
@ -153,7 +153,7 @@ sys_query_module(struct tcb *tcp)
|
||||
tprintf(" /* %Zu entries */ ", ret);
|
||||
tprintf("}, %Zu", ret);
|
||||
} else if (tcp->u_arg[1]==QM_SYMBOLS) {
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
if (!abbrev(tcp)) {
|
||||
char* data = malloc(tcp->u_arg[3]);
|
||||
struct module_symbol* sym = (struct module_symbol*)data;
|
||||
|
4
block.c
4
block.c
@ -93,7 +93,7 @@ print_blkpg_req(struct tcb *tcp, struct blkpg_ioctl_arg *blkpg)
|
||||
{
|
||||
struct blkpg_partition p;
|
||||
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
printxval(blkpg_ops, blkpg->op, "BLKPG_???");
|
||||
|
||||
tprintf(", flags=%d, datalen=%d, ",
|
||||
@ -239,7 +239,7 @@ block_ioctl(struct tcb *tcp, long code, long arg)
|
||||
if (umove(tcp, arg, &blkpg) < 0)
|
||||
tprintf(", %#lx", arg);
|
||||
else {
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
print_blkpg_req(tcp, &blkpg);
|
||||
}
|
||||
}
|
||||
|
122
desc.c
122
desc.c
@ -248,7 +248,7 @@ printflock(struct tcb *tcp, long addr, int getlk)
|
||||
int32_t l_pid; /* pid_t */
|
||||
} fl32;
|
||||
if (umove(tcp, addr, &fl32) < 0) {
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
return;
|
||||
}
|
||||
fl.l_type = fl32.l_type;
|
||||
@ -266,19 +266,19 @@ printflock(struct tcb *tcp, long addr, int getlk)
|
||||
#endif
|
||||
{
|
||||
if (umove(tcp, addr, &fl) < 0) {
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
tprintf("{type=");
|
||||
tprints("{type=");
|
||||
printxval(lockfcmds, fl.l_type, "F_???");
|
||||
tprintf(", whence=");
|
||||
tprints(", whence=");
|
||||
printxval(whence, fl.l_whence, "SEEK_???");
|
||||
tprintf(", start=%ld, len=%ld", fl.l_start, fl.l_len);
|
||||
if (getlk)
|
||||
tprintf(", pid=%lu}", (unsigned long) fl.l_pid);
|
||||
else
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -290,18 +290,18 @@ printflock64(struct tcb *tcp, long addr, int getlk)
|
||||
struct flock64 fl;
|
||||
|
||||
if (umove(tcp, addr, &fl) < 0) {
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
return;
|
||||
}
|
||||
tprintf("{type=");
|
||||
tprints("{type=");
|
||||
printxval(lockfcmds, fl.l_type, "F_???");
|
||||
tprintf(", whence=");
|
||||
tprints(", whence=");
|
||||
printxval(whence, fl.l_whence, "SEEK_???");
|
||||
tprintf(", start=%lld, len=%lld", (long long) fl.l_start, (long long) fl.l_len);
|
||||
if (getlk)
|
||||
tprintf(", pid=%lu}", (unsigned long) fl.l_pid);
|
||||
else
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -310,11 +310,11 @@ sys_fcntl(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printxval(fcntlcmds, tcp->u_arg[1], "F_???");
|
||||
switch (tcp->u_arg[1]) {
|
||||
case F_SETFD:
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(fdflags, tcp->u_arg[2], "FD_???");
|
||||
break;
|
||||
case F_SETOWN: case F_DUPFD:
|
||||
@ -324,14 +324,14 @@ sys_fcntl(struct tcb *tcp)
|
||||
tprintf(", %ld", tcp->u_arg[2]);
|
||||
break;
|
||||
case F_SETFL:
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
tprint_open_modes(tcp->u_arg[2]);
|
||||
break;
|
||||
case F_SETLK: case F_SETLKW:
|
||||
#ifdef F_FREESP
|
||||
case F_FREESP:
|
||||
#endif
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflock(tcp, tcp->u_arg[2], 0);
|
||||
break;
|
||||
#if _LFS64_LARGEFILE
|
||||
@ -346,19 +346,19 @@ sys_fcntl(struct tcb *tcp)
|
||||
#if defined(F_SETLKW64) && F_SETLKW64 + 0 != F_SETLKW
|
||||
case F_SETLKW64:
|
||||
#endif
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflock64(tcp, tcp->u_arg[2], 0);
|
||||
break;
|
||||
#endif
|
||||
#ifdef F_NOTIFY
|
||||
case F_NOTIFY:
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(notifyflags, tcp->u_arg[2], "DN_???");
|
||||
break;
|
||||
#endif
|
||||
#ifdef F_SETLEASE
|
||||
case F_SETLEASE:
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printxval(lockfcmds, tcp->u_arg[2], "F_???");
|
||||
break;
|
||||
#endif
|
||||
@ -391,14 +391,14 @@ sys_fcntl(struct tcb *tcp)
|
||||
tcp->auxstr = sprint_open_modes(tcp->u_rval);
|
||||
return RVAL_HEX|RVAL_STR;
|
||||
case F_GETLK:
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflock(tcp, tcp->u_arg[2], 1);
|
||||
break;
|
||||
#if _LFS64_LARGEFILE
|
||||
#if defined(F_GETLK64) && F_GETLK64+0 != F_GETLK
|
||||
case F_GETLK64:
|
||||
#endif
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflock64(tcp, tcp->u_arg[2], 1);
|
||||
break;
|
||||
#endif
|
||||
@ -424,7 +424,7 @@ sys_flock(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(flockcmds, tcp->u_arg[1], "LOCK_???");
|
||||
}
|
||||
return 0;
|
||||
@ -454,10 +454,10 @@ do_dup2(struct tcb *tcp, int flags_arg)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printfd(tcp, tcp->u_arg[1]);
|
||||
if (flags_arg >= 0) {
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
|
||||
}
|
||||
}
|
||||
@ -505,7 +505,7 @@ decode_select(struct tcb *tcp, long *args, enum bitness_t bitness)
|
||||
for (i = 0; i < 3; i++) {
|
||||
arg = args[i+1];
|
||||
if (arg == 0) {
|
||||
tprintf(", NULL");
|
||||
tprints(", NULL");
|
||||
continue;
|
||||
}
|
||||
if (!verbose(tcp)) {
|
||||
@ -513,10 +513,10 @@ decode_select(struct tcb *tcp, long *args, enum bitness_t bitness)
|
||||
continue;
|
||||
}
|
||||
if (umoven(tcp, arg, fdsize, (char *) fds) < 0) {
|
||||
tprintf(", [?]");
|
||||
tprints(", [?]");
|
||||
continue;
|
||||
}
|
||||
tprintf(", [");
|
||||
tprints(", [");
|
||||
for (j = 0, sep = ""; j < nfds; j++) {
|
||||
if (FD_ISSET(j, fds)) {
|
||||
tprints(sep);
|
||||
@ -524,10 +524,10 @@ decode_select(struct tcb *tcp, long *args, enum bitness_t bitness)
|
||||
sep = " ";
|
||||
}
|
||||
}
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
}
|
||||
free(fds);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printtv_bitness(tcp, args[4], bitness, 0);
|
||||
}
|
||||
else {
|
||||
@ -608,7 +608,7 @@ sys_oldselect(struct tcb *tcp)
|
||||
long args[5];
|
||||
|
||||
if (umoven(tcp, tcp->u_arg[0], sizeof args, (char *) args) < 0) {
|
||||
tprintf("[...]");
|
||||
tprints("[...]");
|
||||
return 0;
|
||||
}
|
||||
return decode_select(tcp, args, BITNESS_CURRENT);
|
||||
@ -696,7 +696,7 @@ sys_epoll_create1(struct tcb *tcp)
|
||||
static void
|
||||
print_epoll_event(struct epoll_event *ev)
|
||||
{
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
printflags(epollevents, ev->events, "EPOLL???");
|
||||
/* We cannot know what format the program uses, so print u32 and u64
|
||||
which will cover every value. */
|
||||
@ -710,13 +710,13 @@ sys_epoll_ctl(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printxval(epollctls, tcp->u_arg[1], "EPOLL_CTL_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printfd(tcp, tcp->u_arg[2]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (tcp->u_arg[3] == 0)
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else {
|
||||
#ifdef HAVE_SYS_EPOLL_H
|
||||
struct epoll_event ev;
|
||||
@ -724,7 +724,7 @@ sys_epoll_ctl(struct tcb *tcp)
|
||||
print_epoll_event(&ev);
|
||||
else
|
||||
#endif
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@ -735,36 +735,36 @@ epoll_wait_common(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
if (syserror(tcp))
|
||||
tprintf("%lx", tcp->u_arg[1]);
|
||||
else if (tcp->u_rval == 0)
|
||||
tprintf("{}");
|
||||
tprints("{}");
|
||||
else {
|
||||
#ifdef HAVE_SYS_EPOLL_H
|
||||
struct epoll_event ev, *start, *cur, *end;
|
||||
int failed = 0;
|
||||
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
start = (struct epoll_event *) tcp->u_arg[1];
|
||||
end = start + tcp->u_rval;
|
||||
for (cur = start; cur < end; ++cur) {
|
||||
if (cur > start)
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (umove(tcp, (long) cur, &ev) == 0)
|
||||
print_epoll_event(&ev);
|
||||
else {
|
||||
tprintf("?");
|
||||
tprints("?");
|
||||
failed = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
if (failed)
|
||||
tprintf(" %#lx", (long) start);
|
||||
#else
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
#endif
|
||||
}
|
||||
tprintf(", %ld, %ld", tcp->u_arg[2], tcp->u_arg[3]);
|
||||
@ -783,7 +783,7 @@ sys_epoll_pwait(struct tcb *tcp)
|
||||
{
|
||||
epoll_wait_common(tcp);
|
||||
if (exiting(tcp)) {
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
print_sigset(tcp, tcp->u_arg[4], 0);
|
||||
}
|
||||
return 0;
|
||||
@ -802,7 +802,7 @@ sys_io_setup(struct tcb *tcp)
|
||||
if (umove(tcp, tcp->u_arg[1], &user_id) == 0)
|
||||
tprintf("{%lu}", user_id);
|
||||
else
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@ -875,7 +875,7 @@ sys_io_submit(struct tcb *tcp)
|
||||
nr = tcp->u_arg[1];
|
||||
/* and if nr is negative? */
|
||||
if (nr == 0)
|
||||
tprintf("{}");
|
||||
tprints("{}");
|
||||
else {
|
||||
#ifdef HAVE_LIBAIO_H
|
||||
long i;
|
||||
@ -885,16 +885,16 @@ sys_io_submit(struct tcb *tcp)
|
||||
enum iocb_sub sub;
|
||||
struct iocb iocb;
|
||||
if (i == 0)
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
else
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
|
||||
if (umove(tcp, (unsigned long)iocbs, &iocbp) ||
|
||||
umove(tcp, (unsigned long)iocbp, &iocb)) {
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
continue;
|
||||
}
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
if (iocb.data)
|
||||
tprintf("data:%p, ", iocb.data);
|
||||
if (iocb.key)
|
||||
@ -906,7 +906,7 @@ sys_io_submit(struct tcb *tcp)
|
||||
switch (sub) {
|
||||
case SUB_COMMON:
|
||||
if (iocb.aio_lio_opcode == IO_CMD_PWRITE) {
|
||||
tprintf(", str:");
|
||||
tprints(", str:");
|
||||
printstr(tcp, (unsigned long)iocb.u.c.buf,
|
||||
iocb.u.c.nbytes);
|
||||
} else {
|
||||
@ -930,10 +930,10 @@ sys_io_submit(struct tcb *tcp)
|
||||
case SUB_NONE:
|
||||
break;
|
||||
}
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
if (i)
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
#else
|
||||
#warning "libaio-devel is not available => no io_submit decoding"
|
||||
tprintf("%#lx", tcp->u_arg[2]);
|
||||
@ -959,10 +959,10 @@ sys_io_cancel(struct tcb *tcp)
|
||||
iocb.aio_reqprio, iocb.aio_fildes);
|
||||
} else
|
||||
#endif
|
||||
tprintf("{...}, ");
|
||||
tprints("{...}, ");
|
||||
} else {
|
||||
if (tcp->u_rval < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
else {
|
||||
#ifdef HAVE_LIBAIO_H
|
||||
struct io_event event;
|
||||
@ -972,7 +972,7 @@ sys_io_cancel(struct tcb *tcp)
|
||||
event.res, event.res2);
|
||||
else
|
||||
#endif
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@ -986,7 +986,7 @@ sys_io_getevents(struct tcb *tcp)
|
||||
tcp->u_arg[2]);
|
||||
} else {
|
||||
if (tcp->u_rval == 0) {
|
||||
tprintf("{}");
|
||||
tprints("{}");
|
||||
} else {
|
||||
#ifdef HAVE_LIBAIO_H
|
||||
struct io_event *events = (void *)tcp->u_arg[3];
|
||||
@ -996,20 +996,20 @@ sys_io_getevents(struct tcb *tcp)
|
||||
struct io_event event;
|
||||
|
||||
if (i == 0)
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
else
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
|
||||
if (umove(tcp, (unsigned long)events, &event) != 0) {
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
continue;
|
||||
}
|
||||
tprintf("{%p, %p, %ld, %ld}", event.data,
|
||||
event.obj, event.res, event.res2);
|
||||
}
|
||||
tprintf("}, ");
|
||||
tprints("}, ");
|
||||
#else
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1038,7 +1038,7 @@ sys_pselect6(struct tcb *tcp)
|
||||
if (umove(tcp, tcp->u_arg[5], &data) < 0)
|
||||
tprintf(", %#lx", tcp->u_arg[5]);
|
||||
else {
|
||||
tprintf(", {");
|
||||
tprints(", {");
|
||||
if (data.len < sizeof(long))
|
||||
tprintf("%#lx", (long)data.ss);
|
||||
else
|
||||
@ -1055,7 +1055,7 @@ do_eventfd(struct tcb *tcp, int flags_arg)
|
||||
if (entering(tcp)) {
|
||||
tprintf("%lu", tcp->u_arg[0]);
|
||||
if (flags_arg >= 0) {
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
|
||||
}
|
||||
}
|
||||
|
224
file.c
224
file.c
@ -334,10 +334,10 @@ static void
|
||||
print_dirfd(struct tcb *tcp, int fd)
|
||||
{
|
||||
if (fd == AT_FDCWD)
|
||||
tprintf("AT_FDCWD, ");
|
||||
tprints("AT_FDCWD, ");
|
||||
else {
|
||||
printfd(tcp, fd);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -394,7 +394,7 @@ decode_open(struct tcb *tcp, int offset)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[offset]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
/* flags */
|
||||
tprint_open_modes(tcp->u_arg[offset + 1]);
|
||||
if (tcp->u_arg[offset + 1] & O_CREAT) {
|
||||
@ -445,7 +445,7 @@ solaris_open(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
/* flags */
|
||||
printflags(openmodessol, tcp->u_arg[1] + 1, "O_???");
|
||||
if (tcp->u_arg[1] & 0x100) {
|
||||
@ -487,7 +487,7 @@ decode_access(struct tcb *tcp, int offset)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[offset]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(access_flags, tcp->u_arg[offset + 1], "?_OK");
|
||||
}
|
||||
return 0;
|
||||
@ -535,7 +535,7 @@ sys_lseek(struct tcb *tcp)
|
||||
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
offset = tcp->ext_arg[1];
|
||||
_whence = tcp->u_arg[2];
|
||||
if (_whence == SEEK_SET)
|
||||
@ -555,7 +555,7 @@ sys_lseek(struct tcb *tcp)
|
||||
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
offset = tcp->u_arg[1];
|
||||
_whence = tcp->u_arg[2];
|
||||
if (_whence == SEEK_SET)
|
||||
@ -606,7 +606,7 @@ sys_readahead(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
int argn;
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
argn = printllval(tcp, "%lld", 1);
|
||||
tprintf(", %ld", tcp->u_arg[argn]);
|
||||
}
|
||||
@ -621,7 +621,7 @@ sys_lseek64(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
int argn;
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (tcp->u_arg[3] == SEEK_SET)
|
||||
argn = printllval(tcp, "%llu, ", 1);
|
||||
else
|
||||
@ -674,7 +674,7 @@ sys_ftruncate64(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printllval(tcp, "%llu", 1);
|
||||
}
|
||||
return 0;
|
||||
@ -771,7 +771,7 @@ printstatsol(struct tcb *tcp, long addr)
|
||||
struct solstat statbuf;
|
||||
|
||||
if (umove(tcp, addr, &statbuf) < 0) {
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
return;
|
||||
}
|
||||
if (!abbrev(tcp)) {
|
||||
@ -805,7 +805,7 @@ printstatsol(struct tcb *tcp, long addr)
|
||||
tprintf("st_ctime=%s}", sprinttime(statbuf.st_ctime.tv_sec));
|
||||
}
|
||||
else
|
||||
tprintf("...}");
|
||||
tprints("...}");
|
||||
}
|
||||
|
||||
#if defined (SPARC64)
|
||||
@ -815,7 +815,7 @@ printstat_sparc64(struct tcb *tcp, long addr)
|
||||
struct stat_sparc64 statbuf;
|
||||
|
||||
if (umove(tcp, addr, &statbuf) < 0) {
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -850,10 +850,10 @@ printstat_sparc64(struct tcb *tcp, long addr)
|
||||
tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime));
|
||||
tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime));
|
||||
tprintf("st_ctime=%s", sprinttime(statbuf.st_ctime));
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
else
|
||||
tprintf("...}");
|
||||
tprints("...}");
|
||||
}
|
||||
#endif /* SPARC64 */
|
||||
#endif /* LINUXSPARC */
|
||||
@ -886,7 +886,7 @@ printstat_powerpc32(struct tcb *tcp, long addr)
|
||||
struct stat_powerpc32 statbuf;
|
||||
|
||||
if (umove(tcp, addr, &statbuf) < 0) {
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -916,10 +916,10 @@ printstat_powerpc32(struct tcb *tcp, long addr)
|
||||
tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime));
|
||||
tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime));
|
||||
tprintf("st_ctime=%s", sprinttime(statbuf.st_ctime));
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
else
|
||||
tprintf("...}");
|
||||
tprints("...}");
|
||||
}
|
||||
#endif /* LINUX && POWERPC64 */
|
||||
|
||||
@ -951,7 +951,7 @@ sys_chflags(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(fileflags, tcp->u_arg[1], "UF_???");
|
||||
}
|
||||
return 0;
|
||||
@ -1012,7 +1012,7 @@ realprintstat(struct tcb *tcp, struct stat *statbuf)
|
||||
tprintf("st_mtime=%s, ", sprinttime(statbuf->st_mtime));
|
||||
tprintf("st_ctime=%s", sprinttime(statbuf->st_ctime));
|
||||
#if HAVE_STRUCT_STAT_ST_FLAGS
|
||||
tprintf(", st_flags=");
|
||||
tprints(", st_flags=");
|
||||
printflags(fileflags, statbuf->st_flags, "UF_???");
|
||||
#endif
|
||||
#if HAVE_STRUCT_STAT_ST_ACLCNT
|
||||
@ -1028,10 +1028,10 @@ realprintstat(struct tcb *tcp, struct stat *statbuf)
|
||||
#if HAVE_STRUCT_STAT_ST_GEN
|
||||
tprintf(", st_gen=%u", statbuf->st_gen);
|
||||
#endif
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
else
|
||||
tprintf("...}");
|
||||
tprints("...}");
|
||||
}
|
||||
|
||||
|
||||
@ -1041,7 +1041,7 @@ printstat(struct tcb *tcp, long addr)
|
||||
struct stat statbuf;
|
||||
|
||||
if (!addr) {
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
return;
|
||||
}
|
||||
if (syserror(tcp) || !verbose(tcp)) {
|
||||
@ -1070,7 +1070,7 @@ printstat(struct tcb *tcp, long addr)
|
||||
#endif
|
||||
|
||||
if (umove(tcp, addr, &statbuf) < 0) {
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1121,7 +1121,7 @@ printstat64(struct tcb *tcp, long addr)
|
||||
#endif
|
||||
|
||||
if (!addr) {
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
return;
|
||||
}
|
||||
if (syserror(tcp) || !verbose(tcp)) {
|
||||
@ -1150,7 +1150,7 @@ printstat64(struct tcb *tcp, long addr)
|
||||
#endif
|
||||
|
||||
if (umove(tcp, addr, &statbuf) < 0) {
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1207,7 +1207,7 @@ printstat64(struct tcb *tcp, long addr)
|
||||
tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime));
|
||||
tprintf("st_ctime=%s", sprinttime(statbuf.st_ctime));
|
||||
#if HAVE_STRUCT_STAT_ST_FLAGS
|
||||
tprintf(", st_flags=");
|
||||
tprints(", st_flags=");
|
||||
printflags(fileflags, statbuf.st_flags, "UF_???");
|
||||
#endif
|
||||
#if HAVE_STRUCT_STAT_ST_ACLCNT
|
||||
@ -1223,10 +1223,10 @@ printstat64(struct tcb *tcp, long addr)
|
||||
#if HAVE_STRUCT_STAT_ST_GEN
|
||||
tprintf(", st_gen=%u", statbuf.st_gen);
|
||||
#endif
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
else
|
||||
tprintf("...}");
|
||||
tprints("...}");
|
||||
}
|
||||
#endif /* HAVE_STAT64 */
|
||||
|
||||
@ -1257,7 +1257,7 @@ printoldstat(struct tcb *tcp, long addr)
|
||||
struct stat newstatbuf;
|
||||
|
||||
if (!addr) {
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
return;
|
||||
}
|
||||
if (syserror(tcp) || !verbose(tcp)) {
|
||||
@ -1273,7 +1273,7 @@ printoldstat(struct tcb *tcp, long addr)
|
||||
#endif /* LINUXSPARC */
|
||||
|
||||
if (umove(tcp, addr, &statbuf) < 0) {
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1288,7 +1288,7 @@ sys_stat(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
printstat(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
@ -1302,7 +1302,7 @@ sys_stat64(struct tcb *tcp)
|
||||
#ifdef HAVE_STAT64
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
printstat64(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
@ -1328,7 +1328,7 @@ sys_newfstatat(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
print_dirfd(tcp, tcp->u_arg[0]);
|
||||
printpath(tcp, tcp->u_arg[1]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
#ifdef POWERPC64
|
||||
if (current_personality == 0)
|
||||
@ -1340,7 +1340,7 @@ sys_newfstatat(struct tcb *tcp)
|
||||
#else
|
||||
printstat(tcp, tcp->u_arg[2]);
|
||||
#endif
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(fstatatflags, tcp->u_arg[3], "AT_???");
|
||||
}
|
||||
return 0;
|
||||
@ -1353,7 +1353,7 @@ sys_oldstat(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
printoldstat(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
@ -1367,7 +1367,7 @@ sys_fstat(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
printstat(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
@ -1381,7 +1381,7 @@ sys_fstat64(struct tcb *tcp)
|
||||
#ifdef HAVE_STAT64
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
printstat64(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
@ -1397,7 +1397,7 @@ sys_oldfstat(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
printoldstat(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
@ -1411,7 +1411,7 @@ sys_lstat(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
printstat(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
@ -1425,7 +1425,7 @@ sys_lstat64(struct tcb *tcp)
|
||||
#ifdef HAVE_STAT64
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
printstat64(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
@ -1441,7 +1441,7 @@ sys_oldlstat(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
printoldstat(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
@ -1458,7 +1458,7 @@ sys_xstat(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
tprintf("%ld, ", tcp->u_arg[0]);
|
||||
printpath(tcp, tcp->u_arg[1]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
#ifdef _STAT64_VER
|
||||
if (tcp->u_arg[0] == _STAT64_VER)
|
||||
@ -1492,7 +1492,7 @@ sys_lxstat(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
tprintf("%ld, ", tcp->u_arg[0]);
|
||||
printpath(tcp, tcp->u_arg[1]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
#ifdef _STAT64_VER
|
||||
if (tcp->u_arg[0] == _STAT64_VER)
|
||||
@ -1563,7 +1563,7 @@ sys_acl(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printxval(aclcmds, tcp->u_arg[1], "???ACL???");
|
||||
tprintf(", %ld", tcp->u_arg[2]);
|
||||
/*
|
||||
@ -1573,7 +1573,7 @@ sys_acl(struct tcb *tcp)
|
||||
if (tcp->u_arg[3])
|
||||
tprintf(", %#lx", tcp->u_arg[3]);
|
||||
else
|
||||
tprintf(", NULL");
|
||||
tprints(", NULL");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -1593,7 +1593,7 @@ sys_facl(struct tcb *tcp)
|
||||
if (tcp->u_arg[3])
|
||||
tprintf(", %#lx", tcp->u_arg[3]);
|
||||
else
|
||||
tprintf(", NULL");
|
||||
tprints(", NULL");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -1628,7 +1628,7 @@ sys_aclipc(struct tcb *tcp)
|
||||
if (tcp->u_arg[4])
|
||||
tprintf(", %#lx", tcp->u_arg[4]);
|
||||
else
|
||||
tprintf(", NULL");
|
||||
tprints(", NULL");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -1703,7 +1703,7 @@ printstatfs(struct tcb *tcp, long addr)
|
||||
return;
|
||||
}
|
||||
if (umove(tcp, addr, &statbuf) < 0) {
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
return;
|
||||
}
|
||||
#ifdef ALPHA
|
||||
@ -1733,7 +1733,7 @@ printstatfs(struct tcb *tcp, long addr)
|
||||
#ifdef _STATFS_F_FRSIZE
|
||||
tprintf(", f_frsize=%lu", (unsigned long)statbuf.f_frsize);
|
||||
#endif
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
|
||||
int
|
||||
@ -1741,7 +1741,7 @@ sys_statfs(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
printstatfs(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
@ -1753,7 +1753,7 @@ sys_fstatfs(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
printstatfs(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
@ -1771,7 +1771,7 @@ printstatfs64(struct tcb *tcp, long addr)
|
||||
return;
|
||||
}
|
||||
if (umove(tcp, addr, &statbuf) < 0) {
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
return;
|
||||
}
|
||||
tprintf("{f_type=%s, f_bsize=%llu, f_blocks=%llu, f_bfree=%llu, ",
|
||||
@ -1788,7 +1788,7 @@ printstatfs64(struct tcb *tcp, long addr)
|
||||
#ifdef _STATFS_F_FRSIZE
|
||||
tprintf(", f_frsize=%llu", (unsigned long long)statbuf.f_frsize);
|
||||
#endif
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
|
||||
int
|
||||
@ -1801,7 +1801,7 @@ sys_statfs64(struct tcb *tcp)
|
||||
if (tcp->u_arg[1] == sizeof(struct statfs64))
|
||||
printstatfs64(tcp, tcp->u_arg[2]);
|
||||
else
|
||||
tprintf("{???}");
|
||||
tprints("{???}");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -1816,7 +1816,7 @@ sys_fstatfs64(struct tcb *tcp)
|
||||
if (tcp->u_arg[1] == sizeof(struct statfs64))
|
||||
printstatfs64(tcp, tcp->u_arg[2]);
|
||||
else
|
||||
tprintf("{???}");
|
||||
tprints("{???}");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -1829,7 +1829,7 @@ osf_statfs(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
printstatfs(tcp, tcp->u_arg[1]);
|
||||
tprintf(", %lu", tcp->u_arg[2]);
|
||||
@ -1867,7 +1867,7 @@ sys_ustat(struct tcb *tcp)
|
||||
if (syserror(tcp) || !verbose(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[1]);
|
||||
else if (umove(tcp, tcp->u_arg[1], &statbuf) < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
else {
|
||||
tprintf("{f_tfree=%lu, f_tinode=%lu, ",
|
||||
statbuf.f_tfree, statbuf.f_tinode);
|
||||
@ -1888,7 +1888,7 @@ sys_pivotroot(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printpath(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
return 0;
|
||||
@ -1974,7 +1974,7 @@ sys_link(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printpath(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
return 0;
|
||||
@ -1987,10 +1987,10 @@ sys_linkat(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
print_dirfd(tcp, tcp->u_arg[0]);
|
||||
printpath(tcp, tcp->u_arg[1]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
print_dirfd(tcp, tcp->u_arg[2]);
|
||||
printpath(tcp, tcp->u_arg[3]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printfd(tcp, tcp->u_arg[4]);
|
||||
}
|
||||
return 0;
|
||||
@ -2021,7 +2021,7 @@ sys_unlinkat(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
print_dirfd(tcp, tcp->u_arg[0]);
|
||||
printpath(tcp, tcp->u_arg[1]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(unlinkatflags, tcp->u_arg[2], "AT_???");
|
||||
}
|
||||
return 0;
|
||||
@ -2033,7 +2033,7 @@ sys_symlink(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printpath(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
return 0;
|
||||
@ -2045,7 +2045,7 @@ sys_symlinkat(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
print_dirfd(tcp, tcp->u_arg[1]);
|
||||
printpath(tcp, tcp->u_arg[2]);
|
||||
}
|
||||
@ -2058,7 +2058,7 @@ decode_readlink(struct tcb *tcp, int offset)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[offset]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[offset + 1]);
|
||||
@ -2090,7 +2090,7 @@ sys_rename(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printpath(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
return 0;
|
||||
@ -2103,7 +2103,7 @@ sys_renameat(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
print_dirfd(tcp, tcp->u_arg[0]);
|
||||
printpath(tcp, tcp->u_arg[1]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
print_dirfd(tcp, tcp->u_arg[2]);
|
||||
printpath(tcp, tcp->u_arg[3]);
|
||||
}
|
||||
@ -2131,7 +2131,7 @@ sys_fchownat(struct tcb *tcp)
|
||||
printpath(tcp, tcp->u_arg[1]);
|
||||
printuid(", ", tcp->u_arg[2]);
|
||||
printuid(", ", tcp->u_arg[3]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(fstatatflags, tcp->u_arg[4], "AT_???");
|
||||
}
|
||||
return 0;
|
||||
@ -2191,7 +2191,7 @@ sys_osf_utimes(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32, 0);
|
||||
}
|
||||
return 0;
|
||||
@ -2203,18 +2203,18 @@ decode_utimes(struct tcb *tcp, int offset, int special)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[offset]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (tcp->u_arg[offset + 1] == 0)
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else {
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
printtv_bitness(tcp, tcp->u_arg[offset + 1],
|
||||
BITNESS_CURRENT, special);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printtv_bitness(tcp, tcp->u_arg[offset + 1]
|
||||
+ sizeof(struct timeval),
|
||||
BITNESS_CURRENT, special);
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@ -2241,7 +2241,7 @@ sys_utimensat(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
print_dirfd(tcp, tcp->u_arg[0]);
|
||||
decode_utimes(tcp, 1, 1);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(utimensatflags, tcp->u_arg[3], "AT_???");
|
||||
}
|
||||
return 0;
|
||||
@ -2258,15 +2258,15 @@ sys_utime(struct tcb *tcp)
|
||||
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (!tcp->u_arg[1])
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (!verbose(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[1]);
|
||||
else if (umoven(tcp, tcp->u_arg[1],
|
||||
2 * personality_wordsize[current_personality],
|
||||
(char *) &u) < 0)
|
||||
tprintf("[?, ?]");
|
||||
tprints("[?, ?]");
|
||||
else if (personality_wordsize[current_personality]
|
||||
== sizeof u.utl[0]) {
|
||||
tprintf("[%s,", sprinttime(u.utl[0]));
|
||||
@ -2360,13 +2360,13 @@ printdir(struct tcb *tcp, long addr)
|
||||
return;
|
||||
}
|
||||
if (umove(tcp, addr, &d) < 0) {
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
return;
|
||||
}
|
||||
tprintf("{d_ino=%ld, ", (unsigned long) d.d_ino);
|
||||
tprintf("d_name=");
|
||||
tprints("d_name=");
|
||||
printpathn(tcp, (long) ((struct dirent *) addr)->d_name, d.d_reclen);
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
|
||||
int
|
||||
@ -2374,7 +2374,7 @@ sys_readdir(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
if (syserror(tcp) || tcp->u_rval == 0 || !verbose(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[1]);
|
||||
@ -2413,7 +2413,7 @@ sys_getdents(struct tcb *tcp)
|
||||
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
return 0;
|
||||
}
|
||||
if (syserror(tcp) || !verbose(tcp)) {
|
||||
@ -2430,7 +2430,7 @@ sys_getdents(struct tcb *tcp)
|
||||
return 0;
|
||||
}
|
||||
if (!abbrev(tcp))
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
for (i = 0; i < len;) {
|
||||
struct kernel_dirent *d = (struct kernel_dirent *) &buf[i];
|
||||
#ifdef LINUX
|
||||
@ -2470,14 +2470,14 @@ sys_getdents(struct tcb *tcp)
|
||||
}
|
||||
#endif /* FREEBSD */
|
||||
if (!d->d_reclen) {
|
||||
tprintf("/* d_reclen == 0, problem here */");
|
||||
tprints("/* d_reclen == 0, problem here */");
|
||||
break;
|
||||
}
|
||||
i += d->d_reclen;
|
||||
dents++;
|
||||
}
|
||||
if (!abbrev(tcp))
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
else
|
||||
tprintf("/* %u entries */", dents);
|
||||
tprintf(", %lu", tcp->u_arg[2]);
|
||||
@ -2495,7 +2495,7 @@ sys_getdents64(struct tcb *tcp)
|
||||
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
return 0;
|
||||
}
|
||||
if (syserror(tcp) || !verbose(tcp)) {
|
||||
@ -2512,7 +2512,7 @@ sys_getdents64(struct tcb *tcp)
|
||||
return 0;
|
||||
}
|
||||
if (!abbrev(tcp))
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
for (i = 0; i < len;) {
|
||||
struct dirent64 *d = (struct dirent64 *) &buf[i];
|
||||
#if defined(LINUX) || defined(SVR4)
|
||||
@ -2522,9 +2522,9 @@ sys_getdents64(struct tcb *tcp)
|
||||
d->d_ino,
|
||||
d->d_off);
|
||||
#ifdef LINUX
|
||||
tprintf("d_type=");
|
||||
tprints("d_type=");
|
||||
printxval(direnttypes, d->d_type, "DT_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
#endif
|
||||
tprintf("d_reclen=%u, d_name=\"%s\"}",
|
||||
d->d_reclen, d->d_name);
|
||||
@ -2540,14 +2540,14 @@ sys_getdents64(struct tcb *tcp)
|
||||
}
|
||||
#endif /* SUNOS4 */
|
||||
if (!d->d_reclen) {
|
||||
tprintf("/* d_reclen == 0, problem here */");
|
||||
tprints("/* d_reclen == 0, problem here */");
|
||||
break;
|
||||
}
|
||||
i += d->d_reclen;
|
||||
dents++;
|
||||
}
|
||||
if (!abbrev(tcp))
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
else
|
||||
tprintf("/* %u entries */", dents);
|
||||
tprintf(", %lu", tcp->u_arg[2]);
|
||||
@ -2566,7 +2566,7 @@ sys_getdirentries(struct tcb *tcp)
|
||||
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
return 0;
|
||||
}
|
||||
if (syserror(tcp) || !verbose(tcp)) {
|
||||
@ -2583,7 +2583,7 @@ sys_getdirentries(struct tcb *tcp)
|
||||
return 0;
|
||||
}
|
||||
if (!abbrev(tcp))
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
for (i = 0; i < len;) {
|
||||
struct kernel_dirent *d = (struct kernel_dirent *) &buf[i];
|
||||
if (!abbrev(tcp)) {
|
||||
@ -2594,14 +2594,14 @@ sys_getdirentries(struct tcb *tcp)
|
||||
d->d_namlen, d->d_namlen, d->d_name);
|
||||
}
|
||||
if (!d->d_reclen) {
|
||||
tprintf("/* d_reclen == 0, problem here */");
|
||||
tprints("/* d_reclen == 0, problem here */");
|
||||
break;
|
||||
}
|
||||
i += d->d_reclen;
|
||||
dents++;
|
||||
}
|
||||
if (!abbrev(tcp))
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
else
|
||||
tprintf("/* %u entries */", dents);
|
||||
free(buf);
|
||||
@ -2683,7 +2683,7 @@ sys_aiowrite(struct tcb *tcp)
|
||||
}
|
||||
else {
|
||||
if (tcp->u_arg[5] == 0)
|
||||
tprintf(", NULL");
|
||||
tprints(", NULL");
|
||||
else if (syserror(tcp)
|
||||
|| umove(tcp, tcp->u_arg[5], &res) < 0)
|
||||
tprintf(", %#lx", tcp->u_arg[5]);
|
||||
@ -2709,7 +2709,7 @@ sys_aiocancel(struct tcb *tcp)
|
||||
|
||||
if (exiting(tcp)) {
|
||||
if (tcp->u_arg[0] == 0)
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (syserror(tcp)
|
||||
|| umove(tcp, tcp->u_arg[0], &res) < 0)
|
||||
tprintf("%#lx", tcp->u_arg[0]);
|
||||
@ -2775,10 +2775,10 @@ sys_setxattr(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printstr(tcp, tcp->u_arg[1], -1);
|
||||
print_xattr_val(tcp, 0, tcp->u_arg[2], tcp->u_arg[3], tcp->u_arg[3]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(xattrflags, tcp->u_arg[4], "XATTR_???");
|
||||
}
|
||||
return 0;
|
||||
@ -2789,10 +2789,10 @@ sys_fsetxattr(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printstr(tcp, tcp->u_arg[1], -1);
|
||||
print_xattr_val(tcp, 0, tcp->u_arg[2], tcp->u_arg[3], tcp->u_arg[3]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(xattrflags, tcp->u_arg[4], "XATTR_???");
|
||||
}
|
||||
return 0;
|
||||
@ -2803,7 +2803,7 @@ sys_getxattr(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printstr(tcp, tcp->u_arg[1], -1);
|
||||
} else {
|
||||
print_xattr_val(tcp, syserror(tcp), tcp->u_arg[2], tcp->u_arg[3],
|
||||
@ -2817,7 +2817,7 @@ sys_fgetxattr(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printstr(tcp, tcp->u_arg[1], -1);
|
||||
} else {
|
||||
print_xattr_val(tcp, syserror(tcp), tcp->u_arg[2], tcp->u_arg[3],
|
||||
@ -2855,7 +2855,7 @@ sys_removexattr(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printstr(tcp, tcp->u_arg[1], -1);
|
||||
}
|
||||
return 0;
|
||||
@ -2866,7 +2866,7 @@ sys_fremovexattr(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printstr(tcp, tcp->u_arg[1], -1);
|
||||
}
|
||||
return 0;
|
||||
@ -2891,7 +2891,7 @@ sys_fadvise64(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
int argn;
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
argn = printllval(tcp, "%lld", 1);
|
||||
tprintf(", %ld, ", tcp->u_arg[argn++]);
|
||||
printxval(advise, tcp->u_arg[argn], "POSIX_FADV_???");
|
||||
@ -2907,7 +2907,7 @@ sys_fadvise64_64(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
int argn;
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
#if defined ARM || defined POWERPC
|
||||
argn = printllval(tcp, "%lld, ", 2);
|
||||
#else
|
||||
@ -2959,9 +2959,9 @@ sys_inotify_add_watch(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printpath(tcp, tcp->u_arg[1]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(inotify_modes, tcp->u_arg[2], "IN_???");
|
||||
}
|
||||
return 0;
|
||||
@ -2991,7 +2991,7 @@ sys_fallocate(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
int argn;
|
||||
printfd(tcp, tcp->u_arg[0]); /* fd */
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
tprintf("%#lo, ", tcp->u_arg[1]); /* mode */
|
||||
argn = printllval(tcp, "%llu, ", 2); /* offset */
|
||||
printllval(tcp, "%llu", argn); /* len */
|
||||
|
60
io.c
60
io.c
@ -51,7 +51,7 @@ sys_read(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[1]);
|
||||
@ -67,7 +67,7 @@ sys_write(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
|
||||
tprintf(", %lu", tcp->u_arg[2]);
|
||||
}
|
||||
@ -102,7 +102,7 @@ tprint_iov(struct tcb *tcp, unsigned long len, unsigned long addr, int decode_io
|
||||
int failed = 0;
|
||||
|
||||
if (!len) {
|
||||
tprintf("[]");
|
||||
tprints("[]");
|
||||
return;
|
||||
}
|
||||
size = len * sizeof_iov;
|
||||
@ -118,27 +118,27 @@ tprint_iov(struct tcb *tcp, unsigned long len, unsigned long addr, int decode_io
|
||||
} else {
|
||||
abbrev_end = end;
|
||||
}
|
||||
tprintf("[");
|
||||
tprints("[");
|
||||
for (cur = addr; cur < end; cur += sizeof_iov) {
|
||||
if (cur > addr)
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (cur >= abbrev_end) {
|
||||
tprintf("...");
|
||||
tprints("...");
|
||||
break;
|
||||
}
|
||||
if (umoven(tcp, cur, sizeof_iov, (char *) &iov) < 0) {
|
||||
tprintf("?");
|
||||
tprints("?");
|
||||
failed = 1;
|
||||
break;
|
||||
}
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
if (decode_iov)
|
||||
printstr(tcp, (long) iov_iov_base, iov_iov_len);
|
||||
else
|
||||
tprintf("%#lx", (long) iov_iov_base);
|
||||
tprintf(", %lu}", (unsigned long)iov_iov_len);
|
||||
}
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
if (failed)
|
||||
tprintf(" %#lx", addr);
|
||||
#undef sizeof_iov
|
||||
@ -151,7 +151,7 @@ sys_readv(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
if (syserror(tcp)) {
|
||||
tprintf("%#lx, %lu",
|
||||
@ -169,7 +169,7 @@ sys_writev(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
|
||||
tprintf(", %lu", tcp->u_arg[2]);
|
||||
}
|
||||
@ -184,7 +184,7 @@ sys_pread(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[1]);
|
||||
@ -206,7 +206,7 @@ sys_pwrite(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
|
||||
#if UNIXWARE
|
||||
/* off_t is signed int */
|
||||
@ -229,7 +229,7 @@ sys_sendfile(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printfd(tcp, tcp->u_arg[1]);
|
||||
tprintf(", %llu, %lu",
|
||||
LONG_LONG(tcp->u_arg[2], tcp->u_arg[3]),
|
||||
@ -238,14 +238,14 @@ sys_sendfile(struct tcb *tcp)
|
||||
off_t offset;
|
||||
|
||||
if (!tcp->u_arg[5])
|
||||
tprintf(", NULL");
|
||||
tprints(", NULL");
|
||||
else {
|
||||
struct sf_hdtr hdtr;
|
||||
|
||||
if (umove(tcp, tcp->u_arg[5], &hdtr) < 0)
|
||||
tprintf(", %#lx", tcp->u_arg[5]);
|
||||
else {
|
||||
tprintf(", { ");
|
||||
tprints(", { ");
|
||||
tprint_iov(tcp, hdtr.hdr_cnt, hdtr.headers, 1);
|
||||
tprintf(", %u, ", hdtr.hdr_cnt);
|
||||
tprint_iov(tcp, hdtr.trl_cnt, hdtr.trailers, 1);
|
||||
@ -253,7 +253,7 @@ sys_sendfile(struct tcb *tcp)
|
||||
}
|
||||
}
|
||||
if (!tcp->u_arg[6])
|
||||
tprintf(", NULL");
|
||||
tprints(", NULL");
|
||||
else if (umove(tcp, tcp->u_arg[6], &offset) < 0)
|
||||
tprintf(", %#lx", tcp->u_arg[6]);
|
||||
else
|
||||
@ -282,7 +282,7 @@ sys_pread(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[1]);
|
||||
@ -299,7 +299,7 @@ sys_pwrite(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
|
||||
tprintf(", %lu, ", tcp->u_arg[2]);
|
||||
printllval(tcp, "%llu", PREAD_OFFSET_ARG);
|
||||
@ -313,7 +313,7 @@ sys_preadv(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
if (syserror(tcp)) {
|
||||
tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
|
||||
@ -331,7 +331,7 @@ sys_pwritev(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
|
||||
tprintf(", %lu, ", tcp->u_arg[2]);
|
||||
printllval(tcp, "%llu", PREAD_OFFSET_ARG);
|
||||
@ -347,11 +347,11 @@ sys_sendfile(struct tcb *tcp)
|
||||
off_t offset;
|
||||
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printfd(tcp, tcp->u_arg[1]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (!tcp->u_arg[2])
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (umove(tcp, tcp->u_arg[2], &offset) < 0)
|
||||
tprintf("%#lx", tcp->u_arg[2]);
|
||||
else
|
||||
@ -368,11 +368,11 @@ sys_sendfile64(struct tcb *tcp)
|
||||
loff_t offset;
|
||||
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printfd(tcp, tcp->u_arg[1]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (!tcp->u_arg[2])
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (umove(tcp, tcp->u_arg[2], &offset) < 0)
|
||||
tprintf("%#lx", tcp->u_arg[2]);
|
||||
else
|
||||
@ -390,7 +390,7 @@ sys_pread64(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[1]);
|
||||
@ -407,7 +407,7 @@ sys_pwrite64(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
|
||||
tprintf(", %lu, ", tcp->u_arg[2]);
|
||||
printllval(tcp, "%#llx", 3);
|
||||
@ -423,7 +423,7 @@ sys_ioctl(struct tcb *tcp)
|
||||
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
iop = ioctl_lookup(tcp->u_arg[1]);
|
||||
if (iop) {
|
||||
tprints(iop->symbol);
|
||||
|
54
ipc.c
54
ipc.c
@ -164,10 +164,10 @@ int sys_msgget(struct tcb *tcp)
|
||||
if (tcp->u_arg[0])
|
||||
tprintf("%#lx", tcp->u_arg[0]);
|
||||
else
|
||||
tprintf("IPC_PRIVATE");
|
||||
tprintf(", ");
|
||||
tprints("IPC_PRIVATE");
|
||||
tprints(", ");
|
||||
if (printflags(resource_flags, tcp->u_arg[1] & ~0777, NULL) != 0)
|
||||
tprintf("|");
|
||||
tprints("|");
|
||||
tprintf("%#lo", tcp->u_arg[1] & 0777);
|
||||
}
|
||||
return 0;
|
||||
@ -175,7 +175,7 @@ int sys_msgget(struct tcb *tcp)
|
||||
|
||||
#ifdef IPC_64
|
||||
# define PRINTCTL(flagset, arg, dflt) \
|
||||
if ((arg) & IPC_64) tprintf("IPC_64|"); \
|
||||
if ((arg) & IPC_64) tprints("IPC_64|"); \
|
||||
printxval((flagset), (arg) &~ IPC_64, dflt)
|
||||
#else
|
||||
# define PRINTCTL printxval
|
||||
@ -219,7 +219,7 @@ tprint_msgsnd(struct tcb *tcp, long addr, unsigned long count,
|
||||
} else {
|
||||
tprintf("{%lu, ", mtype);
|
||||
printstr(tcp, addr + sizeof(mtype), count);
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
tprintf(", %lu, ", count);
|
||||
printflags(msg_flags, flags, "MSG_???");
|
||||
@ -250,7 +250,7 @@ tprint_msgrcv(struct tcb *tcp, long addr, unsigned long count, long msgtyp)
|
||||
} else {
|
||||
tprintf("{%lu, ", mtype);
|
||||
printstr(tcp, addr + sizeof(mtype), count);
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
tprintf(", %lu, %ld, ", count, msgtyp);
|
||||
}
|
||||
@ -301,10 +301,10 @@ tprint_sembuf(struct tcb *tcp, long addr, unsigned long count)
|
||||
for (i = 0; i < max_count; ++i) {
|
||||
struct sembuf sb;
|
||||
if (i)
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (umove(tcp, addr + i * sizeof(struct sembuf), &sb) < 0) {
|
||||
if (i) {
|
||||
tprintf("{???}");
|
||||
tprints("{???}");
|
||||
break;
|
||||
} else {
|
||||
tprintf("%#lx, %lu", addr, count);
|
||||
@ -312,15 +312,15 @@ tprint_sembuf(struct tcb *tcp, long addr, unsigned long count)
|
||||
}
|
||||
} else {
|
||||
if (!i)
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
tprintf("{%u, %d, ", sb.sem_num, sb.sem_op);
|
||||
printflags(semop_flags, sb.sem_flg, "SEM_???");
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
}
|
||||
|
||||
if (i < max_count || max_count < count)
|
||||
tprintf(", ...");
|
||||
tprints(", ...");
|
||||
|
||||
tprintf("}, %lu", count);
|
||||
}
|
||||
@ -345,11 +345,11 @@ int sys_semtimedop(struct tcb *tcp)
|
||||
tprintf("%lu, ", tcp->u_arg[0]);
|
||||
if (indirect_ipccall(tcp)) {
|
||||
tprint_sembuf(tcp, tcp->u_arg[3], tcp->u_arg[1]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printtv(tcp, tcp->u_arg[5]);
|
||||
} else {
|
||||
tprint_sembuf(tcp, tcp->u_arg[1], tcp->u_arg[2]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printtv(tcp, tcp->u_arg[3]);
|
||||
}
|
||||
}
|
||||
@ -363,11 +363,11 @@ int sys_semget(struct tcb *tcp)
|
||||
if (tcp->u_arg[0])
|
||||
tprintf("%#lx", tcp->u_arg[0]);
|
||||
else
|
||||
tprintf("IPC_PRIVATE");
|
||||
tprints("IPC_PRIVATE");
|
||||
tprintf(", %lu", tcp->u_arg[1]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (printflags(resource_flags, tcp->u_arg[2] & ~0777, NULL) != 0)
|
||||
tprintf("|");
|
||||
tprints("|");
|
||||
tprintf("%#lo", tcp->u_arg[2] & 0777);
|
||||
}
|
||||
return 0;
|
||||
@ -390,11 +390,11 @@ int sys_shmget(struct tcb *tcp)
|
||||
if (tcp->u_arg[0])
|
||||
tprintf("%#lx", tcp->u_arg[0]);
|
||||
else
|
||||
tprintf("IPC_PRIVATE");
|
||||
tprints("IPC_PRIVATE");
|
||||
tprintf(", %lu", tcp->u_arg[1]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (printflags(shm_resource_flags, tcp->u_arg[2] & ~0777, NULL) != 0)
|
||||
tprintf("|");
|
||||
tprints("|");
|
||||
tprintf("%#lo", tcp->u_arg[2] & 0777);
|
||||
}
|
||||
return 0;
|
||||
@ -424,11 +424,11 @@ int sys_shmat(struct tcb *tcp)
|
||||
tprintf("%lu", tcp->u_arg[0]);
|
||||
if (indirect_ipccall(tcp)) {
|
||||
tprintf(", %#lx", tcp->u_arg[3]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(shm_flags, tcp->u_arg[1], "SHM_???");
|
||||
} else {
|
||||
tprintf(", %#lx", tcp->u_arg[1]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(shm_flags, tcp->u_arg[2], "SHM_???");
|
||||
}
|
||||
if (syserror(tcp))
|
||||
@ -464,7 +464,7 @@ sys_mq_open(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
/* flags */
|
||||
tprint_open_modes(tcp->u_arg[1]);
|
||||
if (tcp->u_arg[1] & O_CREAT) {
|
||||
@ -475,7 +475,7 @@ sys_mq_open(struct tcb *tcp)
|
||||
/* mode */
|
||||
tprintf(", %#lo, ", tcp->u_arg[2]);
|
||||
if (umove(tcp, tcp->u_arg[3], &attr) < 0)
|
||||
tprintf("{ ??? }");
|
||||
tprints("{ ??? }");
|
||||
else
|
||||
tprintf("{mq_maxmsg=%ld, mq_msgsize=%ld}",
|
||||
attr.mq_maxmsg, attr.mq_msgsize);
|
||||
@ -524,17 +524,17 @@ static void
|
||||
printmqattr(struct tcb *tcp, long addr)
|
||||
{
|
||||
if (addr == 0)
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else {
|
||||
# ifndef HAVE_MQUEUE_H
|
||||
tprintf("%#lx", addr);
|
||||
# else
|
||||
struct mq_attr attr;
|
||||
if (umove(tcp, addr, &attr) < 0) {
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
return;
|
||||
}
|
||||
tprintf("{mq_flags=");
|
||||
tprints("{mq_flags=");
|
||||
tprint_open_modes(attr.mq_flags);
|
||||
tprintf(", mq_maxmsg=%ld, mq_msgsize=%ld, mq_curmsg=%ld}",
|
||||
attr.mq_maxmsg, attr.mq_msgsize, attr.mq_curmsgs);
|
||||
@ -548,7 +548,7 @@ sys_mq_getsetattr(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
tprintf("%ld, ", tcp->u_arg[0]);
|
||||
printmqattr(tcp, tcp->u_arg[1]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else
|
||||
printmqattr(tcp, tcp->u_arg[2]);
|
||||
return 0;
|
||||
|
96
mem.c
96
mem.c
@ -204,19 +204,19 @@ addtileflags(long flags)
|
||||
if (flags & _MAP_CACHE_INCOHERENT) {
|
||||
flags &= ~_MAP_CACHE_INCOHERENT;
|
||||
if (home == MAP_CACHE_HOME_NONE) {
|
||||
tprintf("|MAP_CACHE_INCOHERENT");
|
||||
tprints("|MAP_CACHE_INCOHERENT");
|
||||
return flags;
|
||||
}
|
||||
tprintf("|_MAP_CACHE_INCOHERENT");
|
||||
tprints("|_MAP_CACHE_INCOHERENT");
|
||||
}
|
||||
|
||||
switch (home) {
|
||||
case 0: break;
|
||||
case MAP_CACHE_HOME_HERE: tprintf("|MAP_CACHE_HOME_HERE"); break;
|
||||
case MAP_CACHE_HOME_NONE: tprintf("|MAP_CACHE_HOME_NONE"); break;
|
||||
case MAP_CACHE_HOME_SINGLE: tprintf("|MAP_CACHE_HOME_SINGLE"); break;
|
||||
case MAP_CACHE_HOME_TASK: tprintf("|MAP_CACHE_HOME_TASK"); break;
|
||||
case MAP_CACHE_HOME_HASH: tprintf("|MAP_CACHE_HOME_HASH"); break;
|
||||
case MAP_CACHE_HOME_HERE: tprints("|MAP_CACHE_HOME_HERE"); break;
|
||||
case MAP_CACHE_HOME_NONE: tprints("|MAP_CACHE_HOME_NONE"); break;
|
||||
case MAP_CACHE_HOME_SINGLE: tprints("|MAP_CACHE_HOME_SINGLE"); break;
|
||||
case MAP_CACHE_HOME_TASK: tprints("|MAP_CACHE_HOME_TASK"); break;
|
||||
case MAP_CACHE_HOME_HASH: tprints("|MAP_CACHE_HOME_HASH"); break;
|
||||
default:
|
||||
tprintf("|MAP_CACHE_HOME(%d)",
|
||||
(home >> _MAP_CACHE_HOME_SHIFT) );
|
||||
@ -234,14 +234,14 @@ print_mmap(struct tcb *tcp, long *u_arg, long long offset)
|
||||
if (entering(tcp)) {
|
||||
/* addr */
|
||||
if (!u_arg[0])
|
||||
tprintf("NULL, ");
|
||||
tprints("NULL, ");
|
||||
else
|
||||
tprintf("%#lx, ", u_arg[0]);
|
||||
/* len */
|
||||
tprintf("%lu, ", u_arg[1]);
|
||||
/* prot */
|
||||
printflags(mmap_prot, u_arg[2], "PROT_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
/* flags */
|
||||
#ifdef MAP_TYPE
|
||||
printxval(mmap_flags, u_arg[3] & MAP_TYPE, "MAP_???");
|
||||
@ -254,7 +254,7 @@ print_mmap(struct tcb *tcp, long *u_arg, long long offset)
|
||||
printflags(mmap_flags, u_arg[3], "MAP_???");
|
||||
#endif
|
||||
/* fd */
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printfd(tcp, u_arg[4]);
|
||||
/* offset */
|
||||
tprintf(", %#llx", offset);
|
||||
@ -357,7 +357,7 @@ sys_mmap64(struct tcb *tcp)
|
||||
tprintf("%lu, ", u_arg[1]);
|
||||
/* prot */
|
||||
printflags(mmap_prot, u_arg[2], "PROT_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
/* flags */
|
||||
#ifdef MAP_TYPE
|
||||
printxval(mmap_flags, u_arg[3] & MAP_TYPE, "MAP_???");
|
||||
@ -366,7 +366,7 @@ sys_mmap64(struct tcb *tcp)
|
||||
printflags(mmap_flags, u_arg[3], "MAP_???");
|
||||
#endif
|
||||
/* fd */
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printfd(tcp, u_arg[4]);
|
||||
/* offset */
|
||||
#if !defined(LINUX) || defined(ALPHA)
|
||||
@ -543,7 +543,7 @@ sys_mctl(struct tcb *tcp)
|
||||
printflags(mctl_funcs, function, "MC_???");
|
||||
/* arg */
|
||||
arg = tcp->u_arg[3];
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
switch (function) {
|
||||
case MC_SYNC:
|
||||
printflags(mctl_sync, arg, "MS_???");
|
||||
@ -576,15 +576,15 @@ sys_mincore(struct tcb *tcp)
|
||||
umoven(tcp, tcp->u_arg[2], len, vec) < 0)
|
||||
tprintf("%#lx", tcp->u_arg[2]);
|
||||
else {
|
||||
tprintf("[");
|
||||
tprints("[");
|
||||
for (i = 0; i < len; i++) {
|
||||
if (abbrev(tcp) && i >= max_strlen) {
|
||||
tprintf("...");
|
||||
tprints("...");
|
||||
break;
|
||||
}
|
||||
tprintf((vec[i] & 1) ? "1" : "0");
|
||||
tprints((vec[i] & 1) ? "1" : "0");
|
||||
}
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
}
|
||||
free(vec);
|
||||
}
|
||||
@ -636,7 +636,7 @@ sys_modify_ldt(struct tcb *tcp)
|
||||
else {
|
||||
tprintf(", {entry_number:%d, ", copy.entry_number);
|
||||
if (!verbose(tcp))
|
||||
tprintf("...}");
|
||||
tprints("...}");
|
||||
else {
|
||||
print_ldt_entry(©);
|
||||
}
|
||||
@ -656,13 +656,13 @@ sys_set_thread_area(struct tcb *tcp)
|
||||
tprintf("{entry_number:%d -> ",
|
||||
copy.entry_number);
|
||||
else
|
||||
tprintf("{entry_number:");
|
||||
tprints("{entry_number:");
|
||||
}
|
||||
} else {
|
||||
if (umove(tcp, tcp->u_arg[0], ©) != -1) {
|
||||
tprintf("%d, ", copy.entry_number);
|
||||
if (!verbose(tcp))
|
||||
tprintf("...}");
|
||||
tprints("...}");
|
||||
else {
|
||||
print_ldt_entry(©);
|
||||
}
|
||||
@ -682,7 +682,7 @@ sys_get_thread_area(struct tcb *tcp)
|
||||
if (umove(tcp, tcp->u_arg[0], ©) != -1) {
|
||||
tprintf("{entry_number:%d, ", copy.entry_number);
|
||||
if (!verbose(tcp))
|
||||
tprintf("...}");
|
||||
tprints("...}");
|
||||
else {
|
||||
print_ldt_entry(©);
|
||||
}
|
||||
@ -793,22 +793,22 @@ get_nodes(struct tcb *tcp, unsigned long ptr, unsigned long maxnodes, int err)
|
||||
} else {
|
||||
abbrev_end = end;
|
||||
}
|
||||
tprintf(", {");
|
||||
tprints(", {");
|
||||
for (cur = ptr; cur < end; cur += sizeof(long)) {
|
||||
if (cur > ptr)
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (cur >= abbrev_end) {
|
||||
tprintf("...");
|
||||
tprints("...");
|
||||
break;
|
||||
}
|
||||
if (umoven(tcp, cur, sizeof(n), (char *) &n) < 0) {
|
||||
tprintf("?");
|
||||
tprints("?");
|
||||
failed = 1;
|
||||
break;
|
||||
}
|
||||
tprintf("%#0*lx", (int) sizeof(long) * 2 + 2, n);
|
||||
}
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
if (failed)
|
||||
tprintf(" %#lx", ptr);
|
||||
} else
|
||||
@ -823,7 +823,7 @@ sys_mbind(struct tcb *tcp)
|
||||
tprintf("%#lx, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
|
||||
printxval(policies, tcp->u_arg[2], "MPOL_???");
|
||||
get_nodes(tcp, tcp->u_arg[3], tcp->u_arg[4], 0);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(mbindflags, tcp->u_arg[5], "MPOL_???");
|
||||
}
|
||||
return 0;
|
||||
@ -845,7 +845,7 @@ sys_get_mempolicy(struct tcb *tcp)
|
||||
if (exiting(tcp)) {
|
||||
int pol;
|
||||
if (tcp->u_arg[0] == 0)
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (syserror(tcp) || umove(tcp, tcp->u_arg[0], &pol) < 0)
|
||||
tprintf("%#lx", tcp->u_arg[0]);
|
||||
else
|
||||
@ -864,64 +864,64 @@ sys_move_pages(struct tcb *tcp)
|
||||
unsigned long npages = tcp->u_arg[1];
|
||||
tprintf("%ld, %lu, ", tcp->u_arg[0], npages);
|
||||
if (tcp->u_arg[2] == 0)
|
||||
tprintf("NULL, ");
|
||||
tprints("NULL, ");
|
||||
else {
|
||||
int i;
|
||||
long puser = tcp->u_arg[2];
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
for (i = 0; i < npages; ++i) {
|
||||
void *p;
|
||||
if (i > 0)
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (umove(tcp, puser, &p) < 0) {
|
||||
tprintf("???");
|
||||
tprints("???");
|
||||
break;
|
||||
}
|
||||
tprintf("%p", p);
|
||||
puser += sizeof(void *);
|
||||
}
|
||||
tprintf("}, ");
|
||||
tprints("}, ");
|
||||
}
|
||||
if (tcp->u_arg[3] == 0)
|
||||
tprintf("NULL, ");
|
||||
tprints("NULL, ");
|
||||
else {
|
||||
int i;
|
||||
long nodeuser = tcp->u_arg[3];
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
for (i = 0; i < npages; ++i) {
|
||||
int node;
|
||||
if (i > 0)
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (umove(tcp, nodeuser, &node) < 0) {
|
||||
tprintf("???");
|
||||
tprints("???");
|
||||
break;
|
||||
}
|
||||
tprintf("%#x", node);
|
||||
nodeuser += sizeof(int);
|
||||
}
|
||||
tprintf("}, ");
|
||||
tprints("}, ");
|
||||
}
|
||||
}
|
||||
if (exiting(tcp)) {
|
||||
unsigned long npages = tcp->u_arg[1];
|
||||
if (tcp->u_arg[4] == 0)
|
||||
tprintf("NULL, ");
|
||||
tprints("NULL, ");
|
||||
else {
|
||||
int i;
|
||||
long statususer = tcp->u_arg[4];
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
for (i = 0; i < npages; ++i) {
|
||||
int status;
|
||||
if (i > 0)
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (umove(tcp, statususer, &status) < 0) {
|
||||
tprintf("???");
|
||||
tprints("???");
|
||||
break;
|
||||
}
|
||||
tprintf("%#x", status);
|
||||
statususer += sizeof(int);
|
||||
}
|
||||
tprintf("}, ");
|
||||
tprints("}, ");
|
||||
}
|
||||
printflags(move_pages_flags, tcp->u_arg[5], "MPOL_???");
|
||||
}
|
||||
@ -940,7 +940,7 @@ sys_subpage_prot(struct tcb *tcp)
|
||||
tprintf("%#lx, %#lx, ", tcp->u_arg[0], tcp->u_arg[1]);
|
||||
entries = tcp->u_arg[1] >> 16;
|
||||
if (!entries || !tcp->u_arg[2]) {
|
||||
tprintf("{}");
|
||||
tprints("{}");
|
||||
return 0;
|
||||
}
|
||||
cur = tcp->u_arg[2];
|
||||
@ -956,12 +956,12 @@ sys_subpage_prot(struct tcb *tcp)
|
||||
}
|
||||
else
|
||||
abbrev_end = end;
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
for (; cur < end; cur += sizeof(int)) {
|
||||
if (cur > tcp->u_arg[2])
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (cur >= abbrev_end) {
|
||||
tprintf("...");
|
||||
tprints("...");
|
||||
break;
|
||||
}
|
||||
if (umove(tcp, cur, &entry) < 0) {
|
||||
@ -971,7 +971,7 @@ sys_subpage_prot(struct tcb *tcp)
|
||||
else
|
||||
tprintf("%#08x", entry);
|
||||
}
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
118
net.c
118
net.c
@ -1220,7 +1220,7 @@ printsock(struct tcb *tcp, long addr, int addrlen)
|
||||
char string_addr[100];
|
||||
|
||||
if (addr == 0) {
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
return;
|
||||
}
|
||||
if (!verbose(tcp)) {
|
||||
@ -1233,24 +1233,24 @@ printsock(struct tcb *tcp, long addr, int addrlen)
|
||||
|
||||
memset(&addrbuf, 0, sizeof(addrbuf));
|
||||
if (umoven(tcp, addr, addrlen, addrbuf.pad) < 0) {
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
return;
|
||||
}
|
||||
addrbuf.pad[sizeof(addrbuf.pad) - 1] = '\0';
|
||||
|
||||
tprintf("{sa_family=");
|
||||
tprints("{sa_family=");
|
||||
printxval(addrfams, addrbuf.sa.sa_family, "AF_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
|
||||
switch (addrbuf.sa.sa_family) {
|
||||
case AF_UNIX:
|
||||
if (addrlen == 2) {
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
} else if (addrbuf.sau.sun_path[0]) {
|
||||
tprintf("path=");
|
||||
tprints("path=");
|
||||
printpathn(tcp, addr + 2, strlen(addrbuf.sau.sun_path));
|
||||
} else {
|
||||
tprintf("path=@");
|
||||
tprints("path=@");
|
||||
printpathn(tcp, addr + 3, strlen(addrbuf.sau.sun_path + 1));
|
||||
}
|
||||
break;
|
||||
@ -1331,12 +1331,12 @@ printsock(struct tcb *tcp, long addr, int addrlen)
|
||||
AF_X25 AF_ROSE etc. still need to be done */
|
||||
|
||||
default:
|
||||
tprintf("sa_data=");
|
||||
tprints("sa_data=");
|
||||
printstr(tcp, (long) &((struct sockaddr *) addr)->sa_data,
|
||||
sizeof addrbuf.sa.sa_data);
|
||||
break;
|
||||
}
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
|
||||
#if HAVE_SENDMSG
|
||||
@ -1363,7 +1363,7 @@ printcmsghdr(struct tcb *tcp, unsigned long addr, unsigned long len)
|
||||
|
||||
tprintf(", {cmsg_len=%u, cmsg_level=", (unsigned) cmsg->cmsg_len);
|
||||
printxval(socketlayers, cmsg->cmsg_level, "SOL_???");
|
||||
tprintf(", cmsg_type=");
|
||||
tprints(", cmsg_type=");
|
||||
|
||||
if (cmsg->cmsg_level == SOL_SOCKET) {
|
||||
unsigned long cmsg_len;
|
||||
@ -1376,14 +1376,14 @@ printcmsghdr(struct tcb *tcp, unsigned long addr, unsigned long len)
|
||||
int *fds = (int *) CMSG_DATA(cmsg);
|
||||
int first = 1;
|
||||
|
||||
tprintf(", {");
|
||||
tprints(", {");
|
||||
while ((char *) fds < ((char *) cmsg + cmsg_len)) {
|
||||
if (!first)
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
tprintf("%d", *fds++);
|
||||
first = 0;
|
||||
}
|
||||
tprintf("}}");
|
||||
tprints("}}");
|
||||
free(cmsg);
|
||||
return;
|
||||
}
|
||||
@ -1398,7 +1398,7 @@ printcmsghdr(struct tcb *tcp, unsigned long addr, unsigned long len)
|
||||
}
|
||||
}
|
||||
free(cmsg);
|
||||
tprintf(", ...}");
|
||||
tprints(", ...}");
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1416,13 +1416,13 @@ do_msghdr(struct tcb *tcp, struct msghdr *msg)
|
||||
if (msg->msg_controllen)
|
||||
printcmsghdr(tcp, (unsigned long) msg->msg_control,
|
||||
msg->msg_controllen);
|
||||
tprintf(", msg_flags=");
|
||||
tprints(", msg_flags=");
|
||||
printflags(msg_flags, msg->msg_flags, "MSG_???");
|
||||
#else /* !HAVE_STRUCT_MSGHDR_MSG_CONTROL */
|
||||
tprintf("msg_accrights=%#lx, msg_accrightslen=%u",
|
||||
(unsigned long) msg->msg_accrights, msg->msg_accrightslen);
|
||||
#endif /* !HAVE_STRUCT_MSGHDR_MSG_CONTROL */
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1450,7 +1450,7 @@ printmmsghdr(struct tcb *tcp, long addr)
|
||||
tprintf("%#lx", addr);
|
||||
return;
|
||||
}
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
do_msghdr(tcp, &mmsg.msg_hdr);
|
||||
tprintf(", %u}", mmsg.msg_len);
|
||||
}
|
||||
@ -1472,7 +1472,7 @@ tprint_sock_type(struct tcb *tcp, int flags)
|
||||
flags &= ~SOCK_TYPE_MASK;
|
||||
if (!flags)
|
||||
return;
|
||||
tprintf("|");
|
||||
tprints("|");
|
||||
}
|
||||
printflags(sock_type_flags, flags, "SOCK_???");
|
||||
}
|
||||
@ -1482,9 +1482,9 @@ sys_socket(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printxval(domains, tcp->u_arg[0], "PF_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
tprint_sock_type(tcp, tcp->u_arg[1]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
switch (tcp->u_arg[0]) {
|
||||
case PF_INET:
|
||||
#ifdef PF_INET6
|
||||
@ -1495,9 +1495,9 @@ sys_socket(struct tcb *tcp)
|
||||
#ifdef PF_IPX
|
||||
case PF_IPX:
|
||||
/* BTW: I don't believe this.. */
|
||||
tprintf("[");
|
||||
tprints("[");
|
||||
printxval(domains, tcp->u_arg[2], "PF_???");
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
break;
|
||||
#endif /* PF_IPX */
|
||||
default:
|
||||
@ -1578,11 +1578,11 @@ do_accept(struct tcb *tcp, int flags_arg)
|
||||
} else {
|
||||
printsock(tcp, tcp->u_arg[1], len);
|
||||
}
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printnum_int(tcp, tcp->u_arg[2], "%u");
|
||||
}
|
||||
if (flags_arg >= 0) {
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(sock_type_flags, tcp->u_arg[flags_arg],
|
||||
"SOCK_???");
|
||||
}
|
||||
@ -1626,7 +1626,7 @@ sys_sendto(struct tcb *tcp)
|
||||
/* flags */
|
||||
printflags(msg_flags, tcp->u_arg[3], "MSG_???");
|
||||
/* to address */
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printsock(tcp, tcp->u_arg[4], tcp->u_arg[5]);
|
||||
/* to length */
|
||||
tprintf(", %lu", tcp->u_arg[5]);
|
||||
@ -1643,7 +1643,7 @@ sys_sendmsg(struct tcb *tcp)
|
||||
tprintf("%ld, ", tcp->u_arg[0]);
|
||||
printmsghdr(tcp, tcp->u_arg[1]);
|
||||
/* flags */
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(msg_flags, tcp->u_arg[2], "MSG_???");
|
||||
}
|
||||
return 0;
|
||||
@ -1691,20 +1691,20 @@ sys_recvfrom(struct tcb *tcp)
|
||||
/* from address, len */
|
||||
if (!tcp->u_arg[4] || !tcp->u_arg[5]) {
|
||||
if (tcp->u_arg[4] == 0)
|
||||
tprintf(", NULL");
|
||||
tprints(", NULL");
|
||||
else
|
||||
tprintf(", %#lx", tcp->u_arg[4]);
|
||||
if (tcp->u_arg[5] == 0)
|
||||
tprintf(", NULL");
|
||||
tprints(", NULL");
|
||||
else
|
||||
tprintf(", %#lx", tcp->u_arg[5]);
|
||||
return 0;
|
||||
}
|
||||
if (umove(tcp, tcp->u_arg[5], &fromlen) < 0) {
|
||||
tprintf(", {...}, [?]");
|
||||
tprints(", {...}, [?]");
|
||||
return 0;
|
||||
}
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printsock(tcp, tcp->u_arg[4], tcp->u_arg[5]);
|
||||
/* from length */
|
||||
tprintf(", [%u]", fromlen);
|
||||
@ -1725,7 +1725,7 @@ sys_recvmsg(struct tcb *tcp)
|
||||
else
|
||||
printmsghdr(tcp, tcp->u_arg[1]);
|
||||
/* flags */
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(msg_flags, tcp->u_arg[2], "MSG_???");
|
||||
}
|
||||
return 0;
|
||||
@ -1745,7 +1745,7 @@ sys_recvmmsg(struct tcb *tcp)
|
||||
} else {
|
||||
tprintf("%#lx, %ld, ", tcp->u_arg[1], tcp->u_arg[2]);
|
||||
printflags(msg_flags, tcp->u_arg[3], "MSG_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
print_timespec(tcp, tcp->u_arg[4]);
|
||||
}
|
||||
return 0;
|
||||
@ -1822,7 +1822,7 @@ do_pipe(struct tcb *tcp, int flags_arg)
|
||||
int fds[2];
|
||||
|
||||
if (umoven(tcp, tcp->u_arg[0], sizeof fds, (char *) fds) < 0)
|
||||
tprintf("[...]");
|
||||
tprints("[...]");
|
||||
else
|
||||
tprintf("[%u, %u]", fds[0], fds[1]);
|
||||
#elif defined(SPARC) || defined(SPARC64) || defined(SH) || defined(SVR4) || defined(FREEBSD) || defined(IA64)
|
||||
@ -1832,7 +1832,7 @@ do_pipe(struct tcb *tcp, int flags_arg)
|
||||
#endif
|
||||
}
|
||||
if (flags_arg >= 0) {
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
|
||||
}
|
||||
}
|
||||
@ -1862,9 +1862,9 @@ sys_socketpair(struct tcb *tcp)
|
||||
|
||||
if (entering(tcp)) {
|
||||
printxval(domains, tcp->u_arg[0], "PF_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
tprint_sock_type(tcp, tcp->u_arg[1]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
switch (tcp->u_arg[0]) {
|
||||
case PF_INET:
|
||||
printxval(protocols, tcp->u_arg[2], "IPPROTO_???");
|
||||
@ -1872,9 +1872,9 @@ sys_socketpair(struct tcb *tcp)
|
||||
#ifdef PF_IPX
|
||||
case PF_IPX:
|
||||
/* BTW: I don't believe this.. */
|
||||
tprintf("[");
|
||||
tprints("[");
|
||||
printxval(domains, tcp->u_arg[2], "PF_???");
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
break;
|
||||
#endif /* PF_IPX */
|
||||
default:
|
||||
@ -1888,7 +1888,7 @@ sys_socketpair(struct tcb *tcp)
|
||||
}
|
||||
#ifdef LINUX
|
||||
if (umoven(tcp, tcp->u_arg[3], sizeof fds, (char *) fds) < 0)
|
||||
tprintf(", [...]");
|
||||
tprints(", [...]");
|
||||
else
|
||||
tprintf(", [%u, %u]", fds[0], fds[1]);
|
||||
#endif /* LINUX */
|
||||
@ -1905,7 +1905,7 @@ sys_getsockopt(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
tprintf("%ld, ", tcp->u_arg[0]);
|
||||
printxval(socketlayers, tcp->u_arg[1], "SOL_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
switch (tcp->u_arg[1]) {
|
||||
case SOL_SOCKET:
|
||||
printxval(sockoptions, tcp->u_arg[2], "SO_???");
|
||||
@ -1947,7 +1947,7 @@ sys_getsockopt(struct tcb *tcp)
|
||||
tprintf("%lu", tcp->u_arg[2]);
|
||||
break;
|
||||
}
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
int len;
|
||||
if (syserror(tcp) || umove(tcp, tcp->u_arg[4], &len) < 0) {
|
||||
@ -2036,7 +2036,7 @@ static void printicmpfilter(struct tcb *tcp, long addr)
|
||||
struct icmp_filter filter;
|
||||
|
||||
if (!addr) {
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
return;
|
||||
}
|
||||
if (syserror(tcp) || !verbose(tcp)) {
|
||||
@ -2044,13 +2044,13 @@ static void printicmpfilter(struct tcb *tcp, long addr)
|
||||
return;
|
||||
}
|
||||
if (umove(tcp, addr, &filter) < 0) {
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
return;
|
||||
}
|
||||
|
||||
tprintf("~(");
|
||||
tprints("~(");
|
||||
printflags(icmpfilterflags, ~filter.data, "ICMP_???");
|
||||
tprintf(")");
|
||||
tprints(")");
|
||||
}
|
||||
#endif /* ICMP_FILTER */
|
||||
|
||||
@ -2058,7 +2058,7 @@ static int
|
||||
printsockopt(struct tcb *tcp, int level, int name, long addr, int len)
|
||||
{
|
||||
printxval(socketlayers, level, "SOL_??");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
switch (level) {
|
||||
case SOL_SOCKET:
|
||||
printxval(sockoptions, name, "SO_???");
|
||||
@ -2137,7 +2137,7 @@ printsockopt(struct tcb *tcp, int level, int name, long addr, int len)
|
||||
switch (name) {
|
||||
#if defined(ICMP_FILTER)
|
||||
case ICMP_FILTER:
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printicmpfilter(tcp, addr);
|
||||
return 0;
|
||||
#endif
|
||||
@ -2154,7 +2154,7 @@ printsockopt(struct tcb *tcp, int level, int name, long addr, int len)
|
||||
|
||||
/* default arg printing */
|
||||
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
|
||||
if (len == sizeof(int)) {
|
||||
printnum_int(tcp, addr, "%d");
|
||||
@ -2177,12 +2177,12 @@ print_sock_optmgmt(struct tcb *tcp, long addr, int len)
|
||||
while (len >= (int) sizeof hdr) {
|
||||
if (umove(tcp, addr, &hdr) < 0) break;
|
||||
if (c++) {
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
}
|
||||
else if (len > hdr.len + sizeof hdr) {
|
||||
tprintf("[");
|
||||
tprints("[");
|
||||
}
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
addr += sizeof hdr;
|
||||
len -= sizeof hdr;
|
||||
printsockopt(tcp, hdr.level, hdr.name, addr, hdr.len);
|
||||
@ -2190,13 +2190,13 @@ print_sock_optmgmt(struct tcb *tcp, long addr, int len)
|
||||
addr += hdr.len;
|
||||
len -= hdr.len;
|
||||
}
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
if (len > 0) {
|
||||
if (c++) tprintf(", ");
|
||||
if (c++) tprints(", ");
|
||||
printstr(tcp, addr, len);
|
||||
}
|
||||
if (c > 1) tprintf("]");
|
||||
if (c > 1) tprints("]");
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -2232,7 +2232,7 @@ netlib_call(struct tcb *tcp, int (*func)())
|
||||
if (entering(tcp)) {
|
||||
int i;
|
||||
printxval(sock_version, tcp->u_arg[0], "__NETLIB_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
--tcp->u_nargs;
|
||||
for (i = 0; i < tcp->u_nargs; i++)
|
||||
tcp->u_arg[i] = tcp->u_arg[i + 1];
|
||||
@ -2295,12 +2295,12 @@ sys_xgetsockaddr(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printxval(sock_version, tcp->u_arg[0], "__NETLIB_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (tcp->u_arg[1] == 0) {
|
||||
tprintf("LOCALNAME, ");
|
||||
tprints("LOCALNAME, ");
|
||||
}
|
||||
else if (tcp->u_arg[1] == 1) {
|
||||
tprintf("REMOTENAME, ");
|
||||
tprints("REMOTENAME, ");
|
||||
}
|
||||
else {
|
||||
tprintf("%ld, ", tcp->u_arg[1]);
|
||||
@ -2313,7 +2313,7 @@ sys_xgetsockaddr(struct tcb *tcp)
|
||||
} else {
|
||||
printsock(tcp, tcp->u_arg[3], tcp->u_arg[4]);
|
||||
}
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printnum(tcp, tcp->u_arg[4], "%lu");
|
||||
}
|
||||
|
||||
|
50
proc.c
50
proc.c
@ -101,23 +101,23 @@ proc_ioctl(struct tcb *tcp, int code, int arg)
|
||||
case PIOCSTOP:
|
||||
case PIOCWSTOP:
|
||||
if (arg == 0)
|
||||
tprintf(", NULL");
|
||||
tprints(", NULL");
|
||||
else if (syserror(tcp))
|
||||
tprintf(", %#x", arg);
|
||||
else if (umove(tcp, arg, &status) < 0)
|
||||
tprintf(", {...}");
|
||||
tprints(", {...}");
|
||||
else {
|
||||
tprintf(", {pr_flags=");
|
||||
tprints(", {pr_flags=");
|
||||
printflags(proc_status_flags, status.pr_flags, "PR_???");
|
||||
if (status.pr_why) {
|
||||
tprintf(", pr_why=");
|
||||
tprints(", pr_why=");
|
||||
printxval(proc_status_why, status.pr_why,
|
||||
"PR_???");
|
||||
}
|
||||
switch (status.pr_why) {
|
||||
case PR_SIGNALLED:
|
||||
case PR_JOBCONTROL:
|
||||
tprintf(", pr_what=");
|
||||
tprints(", pr_what=");
|
||||
printsignal(status.pr_what);
|
||||
break;
|
||||
case PR_FAULTED:
|
||||
@ -129,29 +129,29 @@ proc_ioctl(struct tcb *tcp, int code, int arg)
|
||||
sysent[status.pr_what].sys_name);
|
||||
break;
|
||||
}
|
||||
tprintf(", ...}");
|
||||
tprints(", ...}");
|
||||
}
|
||||
return 1;
|
||||
case PIOCRUN:
|
||||
if (arg == 0)
|
||||
tprintf(", NULL");
|
||||
tprints(", NULL");
|
||||
else if (umove(tcp, arg, &run) < 0)
|
||||
tprintf(", {...}");
|
||||
tprints(", {...}");
|
||||
else {
|
||||
tprintf(", {pr_flags=");
|
||||
tprints(", {pr_flags=");
|
||||
printflags(proc_run_flags, run.pr_flags, "PR???");
|
||||
tprintf(", ...}");
|
||||
tprints(", ...}");
|
||||
}
|
||||
return 1;
|
||||
#ifdef PIOCSET
|
||||
case PIOCSET:
|
||||
case PIOCRESET:
|
||||
if (umove(tcp, arg, &val) < 0)
|
||||
tprintf(", [?]");
|
||||
tprints(", [?]");
|
||||
else {
|
||||
tprintf(", [");
|
||||
tprints(", [");
|
||||
printflags(proc_status_flags, val, "PR_???");
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
}
|
||||
return 1;
|
||||
#endif /* PIOCSET */
|
||||
@ -159,11 +159,11 @@ proc_ioctl(struct tcb *tcp, int code, int arg)
|
||||
case PIOCUNKILL:
|
||||
/* takes a pointer to a signal */
|
||||
if (umove(tcp, arg, &val) < 0)
|
||||
tprintf(", [?]");
|
||||
tprints(", [?]");
|
||||
else {
|
||||
tprintf(", [");
|
||||
tprints(", [");
|
||||
printsignal(val);
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
}
|
||||
return 1;
|
||||
case PIOCSFORK:
|
||||
@ -213,39 +213,39 @@ proc_ioctl(struct tcb *tcp, int code, int arg)
|
||||
case PIOCSTATUS:
|
||||
case PIOCWAIT:
|
||||
if (arg == 0)
|
||||
tprintf(", NULL");
|
||||
tprints(", NULL");
|
||||
else if (syserror(tcp))
|
||||
tprintf(", %x", arg);
|
||||
else if (umove(tcp, arg, &status) < 0)
|
||||
tprintf(", {...}");
|
||||
tprints(", {...}");
|
||||
else {
|
||||
tprintf(", {state=%d, flags=", status.state);
|
||||
printflags(proc_status_flags, status.flags, "PF_???");
|
||||
tprintf(", events=");
|
||||
tprints(", events=");
|
||||
printflags(proc_status_why, status.events, "S_???");
|
||||
tprintf(", why=");
|
||||
tprints(", why=");
|
||||
printxval(proc_status_why, status.why, "S_???");
|
||||
tprintf(", val=%lu}", status.val);
|
||||
}
|
||||
return 1;
|
||||
case PIOCBIS:
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(proc_status_why, arg, "S_???");
|
||||
return 1;
|
||||
return 1;
|
||||
case PIOCSFL:
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(proc_status_flags, arg, "PF_???");
|
||||
return 1;
|
||||
case PIOCGFL:
|
||||
if (syserror(tcp))
|
||||
tprintf(", %#x", arg);
|
||||
else if (umove(tcp, arg, &val) < 0)
|
||||
tprintf(", {...}");
|
||||
tprints(", {...}");
|
||||
else {
|
||||
tprintf(", [");
|
||||
tprints(", [");
|
||||
printflags(proc_status_flags, val, "PF_???");
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
}
|
||||
return 1;
|
||||
default:
|
||||
|
140
process.c
140
process.c
@ -430,7 +430,7 @@ sys_exit(struct tcb *tcp)
|
||||
/* special case: we stop tracing this process, finish line now */
|
||||
tprintf("%ld) ", tcp->u_arg[0]);
|
||||
tabto();
|
||||
tprintf("= ?");
|
||||
tprints("= ?");
|
||||
printtrailer();
|
||||
return 0;
|
||||
}
|
||||
@ -597,7 +597,7 @@ sys_clone(struct tcb *tcp)
|
||||
tprintf("stack_size=%#lx, ",
|
||||
tcp->u_arg[ARG_STACKSIZE]);
|
||||
# endif
|
||||
tprintf("flags=");
|
||||
tprints("flags=");
|
||||
if (!printflags(clone_flags, flags &~ CSIGNAL, NULL))
|
||||
sep = "";
|
||||
if ((flags & CSIGNAL) != 0)
|
||||
@ -614,7 +614,7 @@ sys_clone(struct tcb *tcp)
|
||||
tprintf(", {entry_number:%d, ",
|
||||
copy.entry_number);
|
||||
if (!verbose(tcp))
|
||||
tprintf("...}");
|
||||
tprints("...}");
|
||||
else
|
||||
print_ldt_entry(©);
|
||||
}
|
||||
@ -1072,12 +1072,12 @@ sys_setgroups(struct tcb *tcp)
|
||||
len = tcp->u_arg[0];
|
||||
tprintf("%lu, ", len);
|
||||
if (len == 0) {
|
||||
tprintf("[]");
|
||||
tprints("[]");
|
||||
return 0;
|
||||
}
|
||||
start = tcp->u_arg[1];
|
||||
if (start == 0) {
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
return 0;
|
||||
}
|
||||
size = len * sizeof(gid);
|
||||
@ -1093,22 +1093,22 @@ sys_setgroups(struct tcb *tcp)
|
||||
} else {
|
||||
abbrev_end = end;
|
||||
}
|
||||
tprintf("[");
|
||||
tprints("[");
|
||||
for (cur = start; cur < end; cur += sizeof(gid)) {
|
||||
if (cur > start)
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (cur >= abbrev_end) {
|
||||
tprintf("...");
|
||||
tprints("...");
|
||||
break;
|
||||
}
|
||||
if (umoven(tcp, cur, sizeof(gid), (char *) &gid) < 0) {
|
||||
tprintf("?");
|
||||
tprints("?");
|
||||
failed = 1;
|
||||
break;
|
||||
}
|
||||
tprintf("%lu", (unsigned long) gid);
|
||||
}
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
if (failed)
|
||||
tprintf(" %#lx", tcp->u_arg[1]);
|
||||
}
|
||||
@ -1130,12 +1130,12 @@ sys_getgroups(struct tcb *tcp)
|
||||
|
||||
len = tcp->u_rval;
|
||||
if (len == 0) {
|
||||
tprintf("[]");
|
||||
tprints("[]");
|
||||
return 0;
|
||||
}
|
||||
start = tcp->u_arg[1];
|
||||
if (start == 0) {
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
return 0;
|
||||
}
|
||||
if (tcp->u_arg[0] == 0) {
|
||||
@ -1156,22 +1156,22 @@ sys_getgroups(struct tcb *tcp)
|
||||
} else {
|
||||
abbrev_end = end;
|
||||
}
|
||||
tprintf("[");
|
||||
tprints("[");
|
||||
for (cur = start; cur < end; cur += sizeof(gid)) {
|
||||
if (cur > start)
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (cur >= abbrev_end) {
|
||||
tprintf("...");
|
||||
tprints("...");
|
||||
break;
|
||||
}
|
||||
if (umoven(tcp, cur, sizeof(gid), (char *) &gid) < 0) {
|
||||
tprintf("?");
|
||||
tprints("?");
|
||||
failed = 1;
|
||||
break;
|
||||
}
|
||||
tprintf("%lu", (unsigned long) gid);
|
||||
}
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
if (failed)
|
||||
tprintf(" %#lx", tcp->u_arg[1]);
|
||||
}
|
||||
@ -1190,12 +1190,12 @@ sys_setgroups32(struct tcb *tcp)
|
||||
len = tcp->u_arg[0];
|
||||
tprintf("%lu, ", len);
|
||||
if (len == 0) {
|
||||
tprintf("[]");
|
||||
tprints("[]");
|
||||
return 0;
|
||||
}
|
||||
start = tcp->u_arg[1];
|
||||
if (start == 0) {
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
return 0;
|
||||
}
|
||||
size = len * sizeof(gid);
|
||||
@ -1211,22 +1211,22 @@ sys_setgroups32(struct tcb *tcp)
|
||||
} else {
|
||||
abbrev_end = end;
|
||||
}
|
||||
tprintf("[");
|
||||
tprints("[");
|
||||
for (cur = start; cur < end; cur += sizeof(gid)) {
|
||||
if (cur > start)
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (cur >= abbrev_end) {
|
||||
tprintf("...");
|
||||
tprints("...");
|
||||
break;
|
||||
}
|
||||
if (umoven(tcp, cur, sizeof(gid), (char *) &gid) < 0) {
|
||||
tprintf("?");
|
||||
tprints("?");
|
||||
failed = 1;
|
||||
break;
|
||||
}
|
||||
tprintf("%lu", (unsigned long) gid);
|
||||
}
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
if (failed)
|
||||
tprintf(" %#lx", tcp->u_arg[1]);
|
||||
}
|
||||
@ -1248,12 +1248,12 @@ sys_getgroups32(struct tcb *tcp)
|
||||
|
||||
len = tcp->u_rval;
|
||||
if (len == 0) {
|
||||
tprintf("[]");
|
||||
tprints("[]");
|
||||
return 0;
|
||||
}
|
||||
start = tcp->u_arg[1];
|
||||
if (start == 0) {
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
return 0;
|
||||
}
|
||||
size = len * sizeof(gid);
|
||||
@ -1270,22 +1270,22 @@ sys_getgroups32(struct tcb *tcp)
|
||||
} else {
|
||||
abbrev_end = end;
|
||||
}
|
||||
tprintf("[");
|
||||
tprints("[");
|
||||
for (cur = start; cur < end; cur += sizeof(gid)) {
|
||||
if (cur > start)
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (cur >= abbrev_end) {
|
||||
tprintf("...");
|
||||
tprints("...");
|
||||
break;
|
||||
}
|
||||
if (umoven(tcp, cur, sizeof(gid), (char *) &gid) < 0) {
|
||||
tprintf("?");
|
||||
tprints("?");
|
||||
failed = 1;
|
||||
break;
|
||||
}
|
||||
tprintf("%lu", (unsigned long) gid);
|
||||
}
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
if (failed)
|
||||
tprintf(" %#lx", tcp->u_arg[1]);
|
||||
}
|
||||
@ -1424,12 +1424,12 @@ printpriv(struct tcb *tcp, long addr, int len, const struct xlat *opt)
|
||||
return;
|
||||
}
|
||||
|
||||
tprintf("[");
|
||||
tprints("[");
|
||||
|
||||
for (i = 0; i < len; ++i) {
|
||||
const char *t, *p;
|
||||
|
||||
if (i) tprintf(", ");
|
||||
if (i) tprints(", ");
|
||||
|
||||
if ((t = xlookup(procpriv_type, buf[i] & PS_TYPE)) &&
|
||||
(p = xlookup(procpriv_priv, buf[i] & ~PS_TYPE)))
|
||||
@ -1441,9 +1441,9 @@ printpriv(struct tcb *tcp, long addr, int len, const struct xlat *opt)
|
||||
}
|
||||
}
|
||||
|
||||
if (dots) tprintf(" ...");
|
||||
if (dots) tprints(" ...");
|
||||
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
}
|
||||
|
||||
|
||||
@ -1461,7 +1461,7 @@ sys_procpriv(struct tcb *tcp)
|
||||
break;
|
||||
|
||||
default:
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printpriv(tcp, tcp->u_arg[1], tcp->u_arg[2]);
|
||||
tprintf(", %ld", tcp->u_arg[2]);
|
||||
}
|
||||
@ -1471,7 +1471,7 @@ sys_procpriv(struct tcb *tcp)
|
||||
tprintf(", %#lx, %ld", tcp->u_arg[1], tcp->u_arg[2]);
|
||||
}
|
||||
else {
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printpriv(tcp, tcp->u_arg[1], tcp->u_rval);
|
||||
tprintf(", %ld", tcp->u_arg[2]);
|
||||
}
|
||||
@ -1534,9 +1534,9 @@ sys_execv(struct tcb *tcp)
|
||||
if (!verbose(tcp))
|
||||
tprintf(", %#lx", tcp->u_arg[1]);
|
||||
else {
|
||||
tprintf(", [");
|
||||
tprints(", [");
|
||||
printargv(tcp, tcp->u_arg[1]);
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@ -1551,18 +1551,18 @@ sys_execve(struct tcb *tcp)
|
||||
if (!verbose(tcp))
|
||||
tprintf(", %#lx", tcp->u_arg[1]);
|
||||
else {
|
||||
tprintf(", [");
|
||||
tprints(", [");
|
||||
printargv(tcp, tcp->u_arg[1]);
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
}
|
||||
if (!verbose(tcp))
|
||||
tprintf(", %#lx", tcp->u_arg[2]);
|
||||
else if (abbrev(tcp))
|
||||
printargc(", [/* %d var%s */]", tcp, tcp->u_arg[2]);
|
||||
else {
|
||||
tprintf(", [");
|
||||
tprints(", [");
|
||||
printargv(tcp, tcp->u_arg[2]);
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@ -1697,7 +1697,7 @@ printstatus(int status)
|
||||
}
|
||||
|
||||
if (status == 0)
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
else
|
||||
tprintf(" | %#x]", status);
|
||||
|
||||
@ -1734,24 +1734,24 @@ printwaitn(struct tcb *tcp, int n, int bitness)
|
||||
} else {
|
||||
/* status */
|
||||
if (!tcp->u_arg[1])
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (syserror(tcp) || tcp->u_rval == 0)
|
||||
tprintf("%#lx", tcp->u_arg[1]);
|
||||
else if (umove(tcp, tcp->u_arg[1], &status) < 0)
|
||||
tprintf("[?]");
|
||||
tprints("[?]");
|
||||
else
|
||||
#ifdef SUNOS4
|
||||
exited =
|
||||
#endif
|
||||
printstatus(status);
|
||||
/* options */
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(wait4_options, tcp->u_arg[2], "W???");
|
||||
if (n == 4) {
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
/* usage */
|
||||
if (!tcp->u_arg[3])
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
#ifdef LINUX
|
||||
else if (tcp->u_rval > 0) {
|
||||
#ifdef ALPHA
|
||||
@ -1865,21 +1865,21 @@ sys_waitid(struct tcb *tcp)
|
||||
else {
|
||||
/* siginfo */
|
||||
if (!tcp->u_arg[2])
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[2]);
|
||||
else if (umove(tcp, tcp->u_arg[2], &si) < 0)
|
||||
tprintf("{???}");
|
||||
tprints("{???}");
|
||||
else
|
||||
printsiginfo(&si, verbose(tcp));
|
||||
/* options */
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(wait4_options, tcp->u_arg[3], "W???");
|
||||
if (tcp->u_nargs > 4) {
|
||||
/* usage */
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (!tcp->u_arg[4])
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (tcp->u_error)
|
||||
tprintf("%#lx", tcp->u_arg[4]);
|
||||
else
|
||||
@ -1908,7 +1908,7 @@ sys_uname(struct tcb *tcp)
|
||||
if (syserror(tcp) || !verbose(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[0]);
|
||||
else if (umove(tcp, tcp->u_arg[0], &uname) < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
else if (!abbrev(tcp)) {
|
||||
|
||||
tprintf("{sysname=\"%s\", nodename=\"%s\", ",
|
||||
@ -1921,7 +1921,7 @@ sys_uname(struct tcb *tcp)
|
||||
tprintf(", domainname=\"%s\"", uname.domainname);
|
||||
#endif
|
||||
#endif
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
else
|
||||
tprintf("{sys=\"%s\", node=\"%s\", ...}",
|
||||
@ -3061,11 +3061,11 @@ sys_ptrace(struct tcb *tcp)
|
||||
case PTRACE_SETSIGINFO: {
|
||||
siginfo_t si;
|
||||
if (!tcp->u_arg[3])
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[3]);
|
||||
else if (umove(tcp, tcp->u_arg[3], &si) < 0)
|
||||
tprintf("{???}");
|
||||
tprints("{???}");
|
||||
else
|
||||
printsiginfo(&si, verbose(tcp));
|
||||
break;
|
||||
@ -3095,11 +3095,11 @@ sys_ptrace(struct tcb *tcp)
|
||||
case PTRACE_GETSIGINFO: {
|
||||
siginfo_t si;
|
||||
if (!tcp->u_arg[3])
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[3]);
|
||||
else if (umove(tcp, tcp->u_arg[3], &si) < 0)
|
||||
tprintf("{???}");
|
||||
tprints("{???}");
|
||||
else
|
||||
printsiginfo(&si, verbose(tcp));
|
||||
break;
|
||||
@ -3239,10 +3239,10 @@ sys_futex(struct tcb *tcp)
|
||||
if (cmd == FUTEX_WAKE_BITSET)
|
||||
tprintf(", %lx", tcp->u_arg[5]);
|
||||
else if (cmd == FUTEX_WAIT) {
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printtv(tcp, tcp->u_arg[3]);
|
||||
} else if (cmd == FUTEX_WAIT_BITSET) {
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printtv(tcp, tcp->u_arg[3]);
|
||||
tprintf(", %lx", tcp->u_arg[5]);
|
||||
} else if (cmd == FUTEX_REQUEUE)
|
||||
@ -3252,15 +3252,15 @@ sys_futex(struct tcb *tcp)
|
||||
else if (cmd == FUTEX_WAKE_OP) {
|
||||
tprintf(", %ld, %p, {", tcp->u_arg[3], (void *) tcp->u_arg[4]);
|
||||
if ((tcp->u_arg[5] >> 28) & 8)
|
||||
tprintf("FUTEX_OP_OPARG_SHIFT|");
|
||||
tprints("FUTEX_OP_OPARG_SHIFT|");
|
||||
printxval(futexwakeops, (tcp->u_arg[5] >> 28) & 0x7, "FUTEX_OP_???");
|
||||
tprintf(", %ld, ", (tcp->u_arg[5] >> 12) & 0xfff);
|
||||
if ((tcp->u_arg[5] >> 24) & 8)
|
||||
tprintf("FUTEX_OP_OPARG_SHIFT|");
|
||||
tprints("FUTEX_OP_OPARG_SHIFT|");
|
||||
printxval(futexwakecmps, (tcp->u_arg[5] >> 24) & 0x7, "FUTEX_OP_CMP_???");
|
||||
tprintf(", %ld}", tcp->u_arg[5] & 0xfff);
|
||||
} else if (cmd == FUTEX_WAIT_REQUEUE_PI) {
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printtv(tcp, tcp->u_arg[3]);
|
||||
tprintf(", %p", (void *) tcp->u_arg[4]);
|
||||
}
|
||||
@ -3283,9 +3283,9 @@ print_affinitylist(struct tcb *tcp, long list, unsigned int len)
|
||||
if (umove(tcp, list, &w) < 0)
|
||||
break;
|
||||
if (first)
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
else
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
first = 0;
|
||||
tprintf("%lx", w);
|
||||
}
|
||||
@ -3296,7 +3296,7 @@ print_affinitylist(struct tcb *tcp, long list, unsigned int len)
|
||||
tprintf(", %s}", (len >= sizeof(w) && len > min_len ?
|
||||
"???" : "..."));
|
||||
} else {
|
||||
tprintf(first ? "{}" : "}");
|
||||
tprints(first ? "{}" : "}");
|
||||
}
|
||||
}
|
||||
|
||||
@ -3439,13 +3439,13 @@ sys_getcpu(struct tcb *tcp)
|
||||
if (exiting(tcp)) {
|
||||
unsigned u;
|
||||
if (tcp->u_arg[0] == 0)
|
||||
tprintf("NULL, ");
|
||||
tprints("NULL, ");
|
||||
else if (umove(tcp, tcp->u_arg[0], &u) < 0)
|
||||
tprintf("%#lx, ", tcp->u_arg[0]);
|
||||
else
|
||||
tprintf("[%u], ", u);
|
||||
if (tcp->u_arg[1] == 0)
|
||||
tprintf("NULL, ");
|
||||
tprints("NULL, ");
|
||||
else if (umove(tcp, tcp->u_arg[1], &u) < 0)
|
||||
tprintf("%#lx, ", tcp->u_arg[1]);
|
||||
else
|
||||
|
40
quota.c
40
quota.c
@ -353,12 +353,12 @@ decode_cmd_data(struct tcb *tcp, u_int32_t cmd, unsigned long data)
|
||||
if (!abbrev(tcp)) {
|
||||
tprintf("btime=%" PRIu64 ", ", dq.dqb_btime);
|
||||
tprintf("itime=%" PRIu64 ", ", dq.dqb_itime);
|
||||
tprintf("valid=");
|
||||
tprints("valid=");
|
||||
printflags(if_dqblk_valid,
|
||||
dq.dqb_valid, "QIF_???");
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
} else
|
||||
tprintf("...}");
|
||||
tprints("...}");
|
||||
break;
|
||||
}
|
||||
case Q_V1_GETQUOTA:
|
||||
@ -421,7 +421,7 @@ decode_cmd_data(struct tcb *tcp, u_int32_t cmd, unsigned long data)
|
||||
break;
|
||||
}
|
||||
tprintf("{version=%d, ", dq.d_version);
|
||||
tprintf("flags=");
|
||||
tprints("flags=");
|
||||
printflags(xfs_dqblk_flags,
|
||||
dq.d_flags, "XFS_???_QUOTA");
|
||||
tprintf(", fieldmask=%#x, ", dq.d_fieldmask);
|
||||
@ -441,7 +441,7 @@ decode_cmd_data(struct tcb *tcp, u_int32_t cmd, unsigned long data)
|
||||
tprintf("rtbtimer=%d, ", dq.d_rtbtimer);
|
||||
tprintf("rtbwarns=%u}", dq.d_rtbwarns);
|
||||
} else
|
||||
tprintf("...}");
|
||||
tprints("...}");
|
||||
break;
|
||||
}
|
||||
case Q_GETFMT:
|
||||
@ -456,9 +456,9 @@ decode_cmd_data(struct tcb *tcp, u_int32_t cmd, unsigned long data)
|
||||
tprintf("{???} %#lx", data);
|
||||
break;
|
||||
}
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
printxval(quota_formats, fmt, "QFMT_VFS_???");
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
break;
|
||||
}
|
||||
case Q_GETINFO:
|
||||
@ -477,9 +477,9 @@ decode_cmd_data(struct tcb *tcp, u_int32_t cmd, unsigned long data)
|
||||
tprintf("{bgrace=%" PRIu64 ", ", dq.dqi_bgrace);
|
||||
tprintf("igrace=%" PRIu64 ", ", dq.dqi_igrace);
|
||||
tprintf("flags=%#x, ", dq.dqi_flags);
|
||||
tprintf("valid=");
|
||||
tprints("valid=");
|
||||
printflags(if_dqinfo_valid, dq.dqi_valid, "IIF_???");
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
break;
|
||||
}
|
||||
case Q_V2_GETINFO:
|
||||
@ -562,10 +562,10 @@ decode_cmd_data(struct tcb *tcp, u_int32_t cmd, unsigned long data)
|
||||
}
|
||||
tprintf("{version=%d, ", dq.qs_version);
|
||||
if (abbrev(tcp)) {
|
||||
tprintf("...}");
|
||||
tprints("...}");
|
||||
break;
|
||||
}
|
||||
tprintf("flags=");
|
||||
tprints("flags=");
|
||||
printflags(xfs_quota_flags,
|
||||
dq.qs_flags, "XFS_QUOTA_???");
|
||||
tprintf(", incoredqs=%u, ", dq.qs_incoredqs);
|
||||
@ -590,9 +590,9 @@ decode_cmd_data(struct tcb *tcp, u_int32_t cmd, unsigned long data)
|
||||
tprintf("{???} %#lx", data);
|
||||
break;
|
||||
}
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
printflags(xfs_quota_flags, flag, "XFS_QUOTA_???");
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -620,11 +620,11 @@ sys_quotactl(struct tcb *tcp)
|
||||
|
||||
if (entering(tcp)) {
|
||||
printxval(quotacmds, cmd, "Q_???");
|
||||
tprintf("|");
|
||||
tprints("|");
|
||||
printxval(quotatypes, type, "???QUOTA");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printstr(tcp, tcp->u_arg[1], -1);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
switch (cmd) {
|
||||
case Q_V1_QUOTAON:
|
||||
case Q_QUOTAON:
|
||||
@ -647,10 +647,10 @@ sys_quotactl(struct tcb *tcp)
|
||||
tprintf("%#lx", tcp->u_arg[2]);
|
||||
break;
|
||||
}
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
if (!tcp->u_arg[3])
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else
|
||||
decode_cmd_data(tcp, cmd, tcp->u_arg[3]);
|
||||
}
|
||||
@ -691,12 +691,12 @@ sys_quotactl(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
#ifdef SUNOS4
|
||||
printxval(quotacmds, tcp->u_arg[0], "Q_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printstr(tcp, tcp->u_arg[1], -1);
|
||||
#endif
|
||||
#ifdef FREEBSD
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printxval(quotacmds, tcp->u_arg[1], "Q_???");
|
||||
#endif
|
||||
tprintf(", %lu, %#lx", tcp->u_arg[2], tcp->u_arg[3]);
|
||||
|
36
resource.c
36
resource.c
@ -132,7 +132,7 @@ print_rlimit32(struct tcb *tcp)
|
||||
} rlim;
|
||||
|
||||
if (umove(tcp, tcp->u_arg[1], &rlim) < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
else {
|
||||
tprintf("{rlim_cur=%s,",
|
||||
sprintrlim(rlim.rlim_cur == -1 ? RLIM_INFINITY
|
||||
@ -151,7 +151,7 @@ sys_getrlimit(struct tcb *tcp)
|
||||
|
||||
if (entering(tcp)) {
|
||||
printxval(resources, tcp->u_arg[0], "RLIMIT_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
}
|
||||
else {
|
||||
if (syserror(tcp) || !verbose(tcp))
|
||||
@ -161,7 +161,7 @@ sys_getrlimit(struct tcb *tcp)
|
||||
print_rlimit32(tcp);
|
||||
# endif
|
||||
else if (umove(tcp, tcp->u_arg[1], &rlim) < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
else {
|
||||
tprintf("{rlim_cur=%s,", sprintrlim(rlim.rlim_cur));
|
||||
tprintf(" rlim_max=%s}", sprintrlim(rlim.rlim_max));
|
||||
@ -177,7 +177,7 @@ sys_setrlimit(struct tcb *tcp)
|
||||
|
||||
if (entering(tcp)) {
|
||||
printxval(resources, tcp->u_arg[0], "RLIMIT_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (!verbose(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[1]);
|
||||
# if defined LINUX && (defined POWERPC64 || defined X86_64)
|
||||
@ -185,7 +185,7 @@ sys_setrlimit(struct tcb *tcp)
|
||||
print_rlimit32(tcp);
|
||||
# endif
|
||||
else if (umove(tcp, tcp->u_arg[1], &rlim) < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
else {
|
||||
tprintf("{rlim_cur=%s,", sprintrlim(rlim.rlim_cur));
|
||||
tprintf(" rlim_max=%s}", sprintrlim(rlim.rlim_max));
|
||||
@ -217,13 +217,13 @@ sys_getrlimit64(struct tcb *tcp)
|
||||
|
||||
if (entering(tcp)) {
|
||||
printxval(resources, tcp->u_arg[0], "RLIMIT_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
}
|
||||
else {
|
||||
if (syserror(tcp) || !verbose(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[1]);
|
||||
else if (umove(tcp, tcp->u_arg[1], &rlim) < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
else {
|
||||
tprintf("{rlim_cur=%s,", sprintrlim64(rlim.rlim_cur));
|
||||
tprintf(" rlim_max=%s}", sprintrlim64(rlim.rlim_max));
|
||||
@ -239,11 +239,11 @@ sys_setrlimit64(struct tcb *tcp)
|
||||
|
||||
if (entering(tcp)) {
|
||||
printxval(resources, tcp->u_arg[0], "RLIMIT_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (!verbose(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[1]);
|
||||
else if (umove(tcp, tcp->u_arg[1], &rlim) < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
else {
|
||||
tprintf("{rlim_cur=%s,", sprintrlim64(rlim.rlim_cur));
|
||||
tprintf(" rlim_max=%s}", sprintrlim64(rlim.rlim_max));
|
||||
@ -292,11 +292,11 @@ printrusage32(struct tcb *tcp, long addr)
|
||||
} ru;
|
||||
|
||||
if (!addr)
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (syserror(tcp) || !verbose(tcp))
|
||||
tprintf("%#lx", addr);
|
||||
else if (umove(tcp, addr, &ru) < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
else if (!abbrev(tcp)) {
|
||||
tprintf("{ru_utime={%lu, %lu}, ru_stime={%lu, %lu}, ",
|
||||
(long) ru.ru_utime.tv_sec, (long) ru.ru_utime.tv_usec,
|
||||
@ -328,11 +328,11 @@ printrusage(struct tcb *tcp, long addr)
|
||||
struct rusage ru;
|
||||
|
||||
if (!addr)
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (syserror(tcp) || !verbose(tcp))
|
||||
tprintf("%#lx", addr);
|
||||
else if (umove(tcp, addr, &ru) < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
else if (!abbrev(tcp)) {
|
||||
tprintf("{ru_utime={%lu, %lu}, ru_stime={%lu, %lu}, ",
|
||||
(long) ru.ru_utime.tv_sec, (long) ru.ru_utime.tv_usec,
|
||||
@ -362,7 +362,7 @@ sys_getrusage(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printxval(usagewho, tcp->u_arg[0], "RUSAGE_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
}
|
||||
else
|
||||
printrusage(tcp, tcp->u_arg[1]);
|
||||
@ -375,7 +375,7 @@ sys_osf_getrusage(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printxval(usagewho, tcp->u_arg[0], "RUSAGE_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
}
|
||||
else
|
||||
printrusage32(tcp, tcp->u_arg[1]);
|
||||
@ -396,7 +396,7 @@ sys_sysinfo(struct tcb *tcp)
|
||||
if (syserror(tcp) || !verbose(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[0]);
|
||||
else if (umove(tcp, tcp->u_arg[0], &si) < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
else {
|
||||
tprintf("{uptime=%lu, loads=[%lu, %lu, %lu] ",
|
||||
si.uptime, si.loads[0], si.loads[1],
|
||||
@ -458,11 +458,11 @@ sys_times(struct tcb *tcp)
|
||||
|
||||
if (exiting(tcp)) {
|
||||
if (tcp->u_arg[0] == 0)
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[0]);
|
||||
else if (umove(tcp, tcp->u_arg[0], &tbuf) < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
else {
|
||||
tprintf("{tms_utime=%lu, tms_stime=%lu, ",
|
||||
tbuf.tms_utime, tbuf.tms_stime);
|
||||
|
10
scsi.c
10
scsi.c
@ -33,7 +33,7 @@ print_sg_io_buffer(struct tcb *tcp, unsigned char *addr, int len)
|
||||
tprintf(", %02x", buf[i]);
|
||||
free(buf);
|
||||
if (allocated != len)
|
||||
tprintf(", ...");
|
||||
tprints(", ...");
|
||||
}
|
||||
|
||||
static void
|
||||
@ -55,7 +55,7 @@ print_sg_io_req(struct tcb *tcp, struct sg_io_hdr *sg_io)
|
||||
tprintf(", data[%u]=[", sg_io->dxfer_len);
|
||||
printstr(tcp, (unsigned long) sg_io->dxferp,
|
||||
sg_io->dxfer_len);
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ print_sg_io_res(struct tcb *tcp, struct sg_io_hdr *sg_io)
|
||||
tprintf(", data[%u]=[", sg_io->dxfer_len);
|
||||
printstr(tcp, (unsigned long) sg_io->dxferp,
|
||||
sg_io->dxfer_len);
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
}
|
||||
tprintf(", status=%02x, ", sg_io->status);
|
||||
tprintf("masked_status=%02x, ", sg_io->masked_status);
|
||||
@ -91,7 +91,7 @@ scsi_ioctl(struct tcb *tcp, long code, long arg)
|
||||
if (umove(tcp, arg, &sg_io) < 0)
|
||||
tprintf(", %#lx", arg);
|
||||
else {
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
print_sg_io_req(tcp, &sg_io);
|
||||
}
|
||||
}
|
||||
@ -101,7 +101,7 @@ scsi_ioctl(struct tcb *tcp, long code, long arg)
|
||||
if (!syserror(tcp) && umove(tcp, arg, &sg_io) >= 0)
|
||||
print_sg_io_res(tcp, &sg_io);
|
||||
else
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
152
signal.c
152
signal.c
@ -400,7 +400,7 @@ print_sigset(struct tcb *tcp, long addr, int rt)
|
||||
sigset_t ss;
|
||||
|
||||
if (!addr)
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (copy_sigset(tcp, addr, &ss) < 0)
|
||||
tprintf("%#lx", addr);
|
||||
else
|
||||
@ -667,10 +667,10 @@ printsiginfo(siginfo_t *sip, int verbose)
|
||||
const char *code;
|
||||
|
||||
if (sip->si_signo == 0) {
|
||||
tprintf("{}");
|
||||
tprints("{}");
|
||||
return;
|
||||
}
|
||||
tprintf("{si_signo=");
|
||||
tprints("{si_signo=");
|
||||
printsignal(sip->si_signo);
|
||||
code = xlookup(siginfo_codes, sip->si_code);
|
||||
if (!code) {
|
||||
@ -745,7 +745,7 @@ printsiginfo(siginfo_t *sip, int verbose)
|
||||
if (!sip->si_ptr)
|
||||
break;
|
||||
if (!verbose)
|
||||
tprintf(", ...");
|
||||
tprints(", ...");
|
||||
else
|
||||
tprintf(", si_value={int=%u, ptr=%#lx}",
|
||||
sip->si_int,
|
||||
@ -767,7 +767,7 @@ printsiginfo(siginfo_t *sip, int verbose)
|
||||
printsignal(sip->si_status);
|
||||
#if LINUX
|
||||
if (!verbose)
|
||||
tprintf(", ...");
|
||||
tprints(", ...");
|
||||
else
|
||||
tprintf(", si_utime=%lu, si_stime=%lu",
|
||||
sip->si_utime,
|
||||
@ -796,7 +796,7 @@ printsiginfo(siginfo_t *sip, int verbose)
|
||||
if (!sip->si_ptr)
|
||||
break;
|
||||
if (!verbose)
|
||||
tprintf(", ...");
|
||||
tprints(", ...");
|
||||
else {
|
||||
tprintf(", si_value={int=%u, ptr=%#lx}",
|
||||
sip->si_int,
|
||||
@ -807,7 +807,7 @@ printsiginfo(siginfo_t *sip, int verbose)
|
||||
}
|
||||
}
|
||||
}
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
|
||||
#endif /* SVR4 || LINUX */
|
||||
@ -822,38 +822,38 @@ sys_sigvec(struct tcb *tcp)
|
||||
|
||||
if (entering(tcp)) {
|
||||
printsignal(tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
addr = tcp->u_arg[1];
|
||||
} else {
|
||||
addr = tcp->u_arg[2];
|
||||
}
|
||||
if (addr == 0)
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (!verbose(tcp))
|
||||
tprintf("%#lx", addr);
|
||||
else if (umove(tcp, addr, &sv) < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
else {
|
||||
switch ((int) sv.sv_handler) {
|
||||
case (int) SIG_ERR:
|
||||
tprintf("{SIG_ERR}");
|
||||
tprints("{SIG_ERR}");
|
||||
break;
|
||||
case (int) SIG_DFL:
|
||||
tprintf("{SIG_DFL}");
|
||||
tprints("{SIG_DFL}");
|
||||
break;
|
||||
case (int) SIG_IGN:
|
||||
if (tcp->u_arg[0] == SIGTRAP) {
|
||||
tcp->flags |= TCB_SIGTRAPPED;
|
||||
kill(tcp->pid, SIGSTOP);
|
||||
}
|
||||
tprintf("{SIG_IGN}");
|
||||
tprints("{SIG_IGN}");
|
||||
break;
|
||||
case (int) SIG_HOLD:
|
||||
if (tcp->u_arg[0] == SIGTRAP) {
|
||||
tcp->flags |= TCB_SIGTRAPPED;
|
||||
kill(tcp->pid, SIGSTOP);
|
||||
}
|
||||
tprintf("SIG_HOLD");
|
||||
tprints("SIG_HOLD");
|
||||
break;
|
||||
default:
|
||||
if (tcp->u_arg[0] == SIGTRAP) {
|
||||
@ -862,13 +862,13 @@ sys_sigvec(struct tcb *tcp)
|
||||
}
|
||||
tprintf("{%#lx, ", (unsigned long) sv.sv_handler);
|
||||
printsigmask(&sv.sv_mask, 0);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(sigvec_flags, sv.sv_flags, "SV_???");
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
}
|
||||
if (entering(tcp))
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -894,7 +894,7 @@ sys_sigstack(struct tcb *tcp)
|
||||
else
|
||||
addr = tcp->u_arg[1];
|
||||
if (addr == 0)
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (umove(tcp, addr, &ss) < 0)
|
||||
tprintf("%#lx", addr);
|
||||
else {
|
||||
@ -902,7 +902,7 @@ sys_sigstack(struct tcb *tcp)
|
||||
tprintf("ss_onstack %s}", ss.ss_onstack ? "YES" : "NO");
|
||||
}
|
||||
if (entering(tcp))
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -982,16 +982,16 @@ sys_sigaction(struct tcb *tcp)
|
||||
|
||||
if (entering(tcp)) {
|
||||
printsignal(tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
addr = tcp->u_arg[1];
|
||||
} else
|
||||
addr = tcp->u_arg[2];
|
||||
if (addr == 0)
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (!verbose(tcp))
|
||||
tprintf("%#lx", addr);
|
||||
else if (umove(tcp, addr, &sa) < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
else {
|
||||
/* Architectures using function pointers, like
|
||||
* hppa, may need to manipulate the function pointer
|
||||
@ -1002,9 +1002,9 @@ sys_sigaction(struct tcb *tcp)
|
||||
* compiler from generating code to manipulate
|
||||
* SA_HANDLER we cast the function pointers to long. */
|
||||
if ((long)sa.SA_HANDLER == (long)SIG_ERR)
|
||||
tprintf("{SIG_ERR, ");
|
||||
tprints("{SIG_ERR, ");
|
||||
else if ((long)sa.SA_HANDLER == (long)SIG_DFL)
|
||||
tprintf("{SIG_DFL, ");
|
||||
tprints("{SIG_DFL, ");
|
||||
else if ((long)sa.SA_HANDLER == (long)SIG_IGN) {
|
||||
#ifndef USE_PROCFS
|
||||
if (tcp->u_arg[0] == SIGTRAP) {
|
||||
@ -1012,7 +1012,7 @@ sys_sigaction(struct tcb *tcp)
|
||||
kill(tcp->pid, SIGSTOP);
|
||||
}
|
||||
#endif /* !USE_PROCFS */
|
||||
tprintf("{SIG_IGN, ");
|
||||
tprints("{SIG_IGN, ");
|
||||
}
|
||||
else {
|
||||
#ifndef USE_PROCFS
|
||||
@ -1028,17 +1028,17 @@ sys_sigaction(struct tcb *tcp)
|
||||
long_to_sigset(sa.sa_mask, &sigset);
|
||||
printsigmask(&sigset, 0);
|
||||
#endif
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(sigact_flags, sa.sa_flags, "SA_???");
|
||||
#ifdef SA_RESTORER
|
||||
if (sa.sa_flags & SA_RESTORER)
|
||||
tprintf(", %p", sa.sa_restorer);
|
||||
#endif
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
}
|
||||
if (entering(tcp))
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
#ifdef LINUX
|
||||
else
|
||||
tprintf(", %#lx", (unsigned long) sa.sa_restorer);
|
||||
@ -1051,13 +1051,13 @@ sys_signal(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printsignal(tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
switch (tcp->u_arg[1]) {
|
||||
case (long) SIG_ERR:
|
||||
tprintf("SIG_ERR");
|
||||
tprints("SIG_ERR");
|
||||
break;
|
||||
case (long) SIG_DFL:
|
||||
tprintf("SIG_DFL");
|
||||
tprints("SIG_DFL");
|
||||
break;
|
||||
case (long) SIG_IGN:
|
||||
#ifndef USE_PROCFS
|
||||
@ -1066,7 +1066,7 @@ sys_signal(struct tcb *tcp)
|
||||
kill(tcp->pid, SIGSTOP);
|
||||
}
|
||||
#endif /* !USE_PROCFS */
|
||||
tprintf("SIG_IGN");
|
||||
tprints("SIG_IGN");
|
||||
break;
|
||||
default:
|
||||
#ifndef USE_PROCFS
|
||||
@ -1464,7 +1464,7 @@ sys_sigsuspend(struct tcb *tcp)
|
||||
|
||||
if (entering(tcp)) {
|
||||
if (umove(tcp, tcp->u_arg[0], &sigset) < 0)
|
||||
tprintf("[?]");
|
||||
tprints("[?]");
|
||||
else
|
||||
printsigmask(&sigset, 0);
|
||||
}
|
||||
@ -1514,22 +1514,22 @@ static const struct xlat sigaltstack_flags[] = {
|
||||
static void
|
||||
printcontext(struct tcb *tcp, ucontext_t *ucp)
|
||||
{
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
if (!abbrev(tcp)) {
|
||||
tprintf("uc_flags=");
|
||||
tprints("uc_flags=");
|
||||
printflags(ucontext_flags, ucp->uc_flags, "UC_???");
|
||||
tprintf(", uc_link=%#lx, ", (unsigned long) ucp->uc_link);
|
||||
}
|
||||
tprintf("uc_sigmask=");
|
||||
tprints("uc_sigmask=");
|
||||
printsigmask(&ucp->uc_sigmask, 0);
|
||||
if (!abbrev(tcp)) {
|
||||
tprintf(", uc_stack={ss_sp=%#lx, ss_size=%d, ss_flags=",
|
||||
(unsigned long) ucp->uc_stack.ss_sp,
|
||||
ucp->uc_stack.ss_size);
|
||||
printflags(sigaltstack_flags, ucp->uc_stack.ss_flags, "SS_???");
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
tprintf(", ...}");
|
||||
tprints(", ...}");
|
||||
}
|
||||
|
||||
int
|
||||
@ -1541,9 +1541,9 @@ sys_getcontext(struct tcb *tcp)
|
||||
if (tcp->u_error)
|
||||
tprintf("%#lx", tcp->u_arg[0]);
|
||||
else if (!tcp->u_arg[0])
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (umove(tcp, tcp->u_arg[0], &uc) < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
else
|
||||
printcontext(tcp, &uc);
|
||||
}
|
||||
@ -1557,9 +1557,9 @@ sys_setcontext(struct tcb *tcp)
|
||||
|
||||
if (entering(tcp)) {
|
||||
if (!tcp->u_arg[0])
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (umove(tcp, tcp->u_arg[0], &uc) < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
else
|
||||
printcontext(tcp, &uc);
|
||||
}
|
||||
@ -1593,14 +1593,14 @@ sys_sigaltstack(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
if (tcp->u_arg[0] == 0)
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (print_stack_t(tcp, tcp->u_arg[0]) < 0)
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (tcp->u_arg[1] == 0)
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (print_stack_t(tcp, tcp->u_arg[1]) < 0)
|
||||
return -1;
|
||||
}
|
||||
@ -1616,7 +1616,7 @@ sys_sigprocmask(struct tcb *tcp)
|
||||
#ifdef ALPHA
|
||||
if (entering(tcp)) {
|
||||
printxval(sigprocmaskcmds, tcp->u_arg[0], "SIG_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printsigmask(tcp->u_arg[1], 0);
|
||||
}
|
||||
else if (!syserror(tcp)) {
|
||||
@ -1627,17 +1627,17 @@ sys_sigprocmask(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
#ifdef SVR4
|
||||
if (tcp->u_arg[0] == 0)
|
||||
tprintf("0");
|
||||
tprints("0");
|
||||
else
|
||||
#endif /* SVR4 */
|
||||
printxval(sigprocmaskcmds, tcp->u_arg[0], "SIG_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
print_sigset(tcp, tcp->u_arg[1], 0);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
}
|
||||
else {
|
||||
if (!tcp->u_arg[2])
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[2]);
|
||||
else
|
||||
@ -1693,7 +1693,7 @@ sys_sigpending(struct tcb *tcp)
|
||||
if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[0]);
|
||||
else if (copy_sigset(tcp, tcp->u_arg[0], &sigset) < 0)
|
||||
tprintf("[?]");
|
||||
tprints("[?]");
|
||||
else
|
||||
printsigmask(&sigset, 0);
|
||||
}
|
||||
@ -1707,7 +1707,7 @@ int sys_sigwait(struct tcb *tcp)
|
||||
|
||||
if (entering(tcp)) {
|
||||
if (copy_sigset(tcp, tcp->u_arg[0], &sigset) < 0)
|
||||
tprintf("[?]");
|
||||
tprints("[?]");
|
||||
else
|
||||
printsigmask(&sigset, 0);
|
||||
}
|
||||
@ -1731,23 +1731,23 @@ sys_rt_sigprocmask(struct tcb *tcp)
|
||||
/* Note: arg[3] is the length of the sigset. */
|
||||
if (entering(tcp)) {
|
||||
printxval(sigprocmaskcmds, tcp->u_arg[0], "SIG_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (!tcp->u_arg[1])
|
||||
tprintf("NULL, ");
|
||||
tprints("NULL, ");
|
||||
else if (copy_sigset_len(tcp, tcp->u_arg[1], &sigset, tcp->u_arg[3]) < 0)
|
||||
tprintf("%#lx, ", tcp->u_arg[1]);
|
||||
else {
|
||||
printsigmask(&sigset, 1);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!tcp->u_arg[2])
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[2]);
|
||||
else if (copy_sigset_len(tcp, tcp->u_arg[2], &sigset, tcp->u_arg[3]) < 0)
|
||||
tprintf("[?]");
|
||||
tprints("[?]");
|
||||
else
|
||||
printsigmask(&sigset, 1);
|
||||
tprintf(", %lu", tcp->u_arg[3]);
|
||||
@ -1785,13 +1785,13 @@ sys_rt_sigaction(struct tcb *tcp)
|
||||
|
||||
if (entering(tcp)) {
|
||||
printsignal(tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
addr = tcp->u_arg[1];
|
||||
} else
|
||||
addr = tcp->u_arg[2];
|
||||
|
||||
if (addr == 0) {
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
goto after_sa;
|
||||
}
|
||||
if (!verbose(tcp)) {
|
||||
@ -1825,7 +1825,7 @@ sys_rt_sigaction(struct tcb *tcp)
|
||||
r = umove(tcp, addr, &sa);
|
||||
}
|
||||
if (r < 0) {
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
goto after_sa;
|
||||
}
|
||||
/* Architectures using function pointers, like
|
||||
@ -1837,11 +1837,11 @@ sys_rt_sigaction(struct tcb *tcp)
|
||||
* compiler from generating code to manipulate
|
||||
* SA_HANDLER we cast the function pointers to long. */
|
||||
if ((long)sa.__sa_handler == (long)SIG_ERR)
|
||||
tprintf("{SIG_ERR, ");
|
||||
tprints("{SIG_ERR, ");
|
||||
else if ((long)sa.__sa_handler == (long)SIG_DFL)
|
||||
tprintf("{SIG_DFL, ");
|
||||
tprints("{SIG_DFL, ");
|
||||
else if ((long)sa.__sa_handler == (long)SIG_IGN)
|
||||
tprintf("{SIG_IGN, ");
|
||||
tprints("{SIG_IGN, ");
|
||||
else
|
||||
tprintf("{%#lx, ", (long) sa.__sa_handler);
|
||||
/* Questionable code below.
|
||||
@ -1860,17 +1860,17 @@ sys_rt_sigaction(struct tcb *tcp)
|
||||
else
|
||||
memcpy(&sigset, &sa.sa_mask, sizeof(sigset));
|
||||
printsigmask(&sigset, 1);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(sigact_flags, sa.sa_flags, "SA_???");
|
||||
#ifdef SA_RESTORER
|
||||
if (sa.sa_flags & SA_RESTORER)
|
||||
tprintf(", %p", sa.sa_restorer);
|
||||
#endif
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
|
||||
after_sa:
|
||||
if (entering(tcp))
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
else
|
||||
#ifdef LINUXSPARC
|
||||
tprintf(", %#lx, %lu", tcp->u_arg[3], tcp->u_arg[4]);
|
||||
@ -1892,7 +1892,7 @@ sys_rt_sigpending(struct tcb *tcp)
|
||||
tprintf("%#lx", tcp->u_arg[0]);
|
||||
else if (copy_sigset_len(tcp, tcp->u_arg[0],
|
||||
&sigset, tcp->u_arg[1]) < 0)
|
||||
tprintf("[?]");
|
||||
tprints("[?]");
|
||||
else
|
||||
printsigmask(&sigset, 1);
|
||||
}
|
||||
@ -1905,7 +1905,7 @@ sys_rt_sigsuspend(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
sigset_t sigm;
|
||||
if (copy_sigset_len(tcp, tcp->u_arg[0], &sigm, tcp->u_arg[1]) < 0)
|
||||
tprintf("[?]");
|
||||
tprints("[?]");
|
||||
else
|
||||
printsigmask(&sigm, 1);
|
||||
}
|
||||
@ -1919,7 +1919,7 @@ sys_rt_sigqueueinfo(struct tcb *tcp)
|
||||
siginfo_t si;
|
||||
tprintf("%lu, ", tcp->u_arg[0]);
|
||||
printsignal(tcp->u_arg[1]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (umove(tcp, tcp->u_arg[2], &si) < 0)
|
||||
tprintf("%#lx", tcp->u_arg[2]);
|
||||
else
|
||||
@ -1935,15 +1935,15 @@ int sys_rt_sigtimedwait(struct tcb *tcp)
|
||||
|
||||
if (copy_sigset_len(tcp, tcp->u_arg[0],
|
||||
&sigset, tcp->u_arg[3]) < 0)
|
||||
tprintf("[?]");
|
||||
tprints("[?]");
|
||||
else
|
||||
printsigmask(&sigset, 1);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
/* This is the only "return" parameter, */
|
||||
if (tcp->u_arg[1] != 0)
|
||||
return 0;
|
||||
/* ... if it's NULL, can decode all on entry */
|
||||
tprintf("NULL, ");
|
||||
tprints("NULL, ");
|
||||
}
|
||||
else if (tcp->u_arg[1] != 0) {
|
||||
/* syscall exit, and u_arg[1] wasn't NULL */
|
||||
@ -1955,7 +1955,7 @@ int sys_rt_sigtimedwait(struct tcb *tcp)
|
||||
tprintf("%#lx, ", tcp->u_arg[1]);
|
||||
else {
|
||||
printsiginfo(&si, verbose(tcp));
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1972,7 +1972,7 @@ int
|
||||
sys_restart_syscall(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp))
|
||||
tprintf("<... resuming interrupted call ...>");
|
||||
tprints("<... resuming interrupted call ...>");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1981,11 +1981,11 @@ do_signalfd(struct tcb *tcp, int flags_arg)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
print_sigset(tcp, tcp->u_arg[1], 1);
|
||||
tprintf(", %lu", tcp->u_arg[2]);
|
||||
if (flags_arg >= 0) {
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
|
||||
}
|
||||
}
|
||||
|
28
sock.c
28
sock.c
@ -92,7 +92,7 @@ sock_ioctl(struct tcb *tcp, long code, long arg)
|
||||
&& ifc.ifc_buf == NULL)
|
||||
tprintf(", {%d -> ", ifc.ifc_len);
|
||||
else
|
||||
tprintf(", {");
|
||||
tprints(", {");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -188,12 +188,12 @@ sock_ioctl(struct tcb *tcp, long code, long arg)
|
||||
printxval(addrfams,
|
||||
ifr.ifr_addr.sa_family,
|
||||
"AF_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
print_addr(tcp, ((long) tcp->u_arg[2]
|
||||
+ offsetof(struct ifreq,
|
||||
ifr_addr.sa_data)),
|
||||
&ifr);
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
break;
|
||||
case SIOCGIFHWADDR:
|
||||
case SIOCSIFHWADDR:
|
||||
@ -206,7 +206,7 @@ sock_ioctl(struct tcb *tcp, long code, long arg)
|
||||
break;
|
||||
case SIOCGIFFLAGS:
|
||||
case SIOCSIFFLAGS:
|
||||
tprintf("ifr_flags=");
|
||||
tprints("ifr_flags=");
|
||||
printflags(iffflags, ifr.ifr_flags, "IFF_???");
|
||||
break;
|
||||
case SIOCGIFMETRIC:
|
||||
@ -238,19 +238,19 @@ sock_ioctl(struct tcb *tcp, long code, long arg)
|
||||
(unsigned) ifr.ifr_map.port);
|
||||
break;
|
||||
}
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
return 1;
|
||||
case SIOCGIFCONF:
|
||||
if (umove(tcp, tcp->u_arg[2], &ifc) < 0) {
|
||||
tprintf("???}");
|
||||
tprints("???}");
|
||||
return 1;
|
||||
}
|
||||
tprintf("%d, ", ifc.ifc_len);
|
||||
if (syserror(tcp)) {
|
||||
tprintf("%lx", (unsigned long) ifc.ifc_buf);
|
||||
} else if (ifc.ifc_buf == NULL) {
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
} else {
|
||||
int i;
|
||||
unsigned nifra = ifc.ifc_len / sizeof(struct ifreq);
|
||||
@ -261,17 +261,17 @@ sock_ioctl(struct tcb *tcp, long code, long arg)
|
||||
tprintf("%lx}", (unsigned long) ifc.ifc_buf);
|
||||
return 1;
|
||||
}
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
for (i = 0; i < nifra; ++i ) {
|
||||
if (i > 0)
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
tprintf("{\"%s\", {",
|
||||
ifra[i].ifr_name);
|
||||
if (verbose(tcp)) {
|
||||
printxval(addrfams,
|
||||
ifra[i].ifr_addr.sa_family,
|
||||
"AF_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
print_addr(tcp, ((long) tcp->u_arg[2]
|
||||
+ offsetof(struct ifreq,
|
||||
ifr_addr.sa_data)
|
||||
@ -279,12 +279,12 @@ sock_ioctl(struct tcb *tcp, long code, long arg)
|
||||
- (char *) &ifra[0])),
|
||||
&ifra[i]);
|
||||
} else
|
||||
tprintf("...");
|
||||
tprintf("}}");
|
||||
tprints("...");
|
||||
tprints("}}");
|
||||
}
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
return 1;
|
||||
#endif
|
||||
default:
|
||||
|
16
strace.c
16
strace.c
@ -1797,7 +1797,7 @@ cleanup(void)
|
||||
"cleanup: looking at pid %u\n", tcp->pid);
|
||||
if (tcp_last &&
|
||||
(!outfname || followfork < 2 || tcp_last == tcp)) {
|
||||
tprintf(" <unfinished ...>");
|
||||
tprints(" <unfinished ...>");
|
||||
printtrailer();
|
||||
}
|
||||
if (tcp->flags & TCB_ATTACHED)
|
||||
@ -2249,7 +2249,7 @@ trace(void)
|
||||
#ifdef PR_INFO
|
||||
if (tcp->status.PR_INFO.si_signo == what) {
|
||||
printleader(tcp);
|
||||
tprintf(" siginfo=");
|
||||
tprints(" siginfo=");
|
||||
printsiginfo(&tcp->status.PR_INFO, 1);
|
||||
printtrailer();
|
||||
}
|
||||
@ -2565,7 +2565,7 @@ trace()
|
||||
#endif
|
||||
printleader(tcp);
|
||||
if (ptrace(PTRACE_GETSIGINFO, pid, 0, &si) == 0) {
|
||||
tprintf("--- ");
|
||||
tprints("--- ");
|
||||
printsiginfo(&si, verbose(tcp));
|
||||
tprintf(" (%s)" PC_FORMAT_STR " ---",
|
||||
strsignal(WSTOPSIG(status))
|
||||
@ -2606,7 +2606,7 @@ trace()
|
||||
* Finish the line then.
|
||||
*/
|
||||
tcp_last->flags |= TCB_REPRINT;
|
||||
tprintf(" <unfinished ...>");
|
||||
tprints(" <unfinished ...>");
|
||||
printtrailer();
|
||||
}
|
||||
detach(tcp, 0);
|
||||
@ -2669,14 +2669,14 @@ printleader(struct tcb *tcp)
|
||||
if (tcp_last) {
|
||||
if (tcp_last->ptrace_errno) {
|
||||
if (tcp_last->flags & TCB_INSYSCALL) {
|
||||
tprintf(" <unavailable>) ");
|
||||
tprints(" <unavailable>) ");
|
||||
tabto();
|
||||
}
|
||||
tprintf("= ? <unavailable>\n");
|
||||
tprints("= ? <unavailable>\n");
|
||||
tcp_last->ptrace_errno = 0;
|
||||
} else if (!outfname || followfork < 2 || tcp_last == tcp) {
|
||||
tcp_last->flags |= TCB_REPRINT;
|
||||
tprintf(" <unfinished ...>\n");
|
||||
tprints(" <unfinished ...>\n");
|
||||
}
|
||||
}
|
||||
curcol = 0;
|
||||
@ -2725,7 +2725,7 @@ tabto(void)
|
||||
void
|
||||
printtrailer(void)
|
||||
{
|
||||
tprintf("\n");
|
||||
tprints("\n");
|
||||
tcp_last = NULL;
|
||||
}
|
||||
|
||||
|
172
stream.c
172
stream.c
@ -80,14 +80,14 @@ static void
|
||||
printstrbuf(struct tcb *tcp, struct strbuf *sbp, int getting)
|
||||
{
|
||||
if (sbp->maxlen == -1 && getting)
|
||||
tprintf("{maxlen=-1}");
|
||||
tprints("{maxlen=-1}");
|
||||
else {
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
if (getting)
|
||||
tprintf("maxlen=%d, ", sbp->maxlen);
|
||||
tprintf("len=%d, buf=", sbp->len);
|
||||
printstr(tcp, (unsigned long) sbp->buf, sbp->len);
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
}
|
||||
|
||||
@ -97,12 +97,12 @@ printstrbufarg(struct tcb *tcp, int arg, int getting)
|
||||
struct strbuf buf;
|
||||
|
||||
if (arg == 0)
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (umove(tcp, arg, &buf) < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
else
|
||||
printstrbuf(tcp, &buf, getting);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
}
|
||||
|
||||
int
|
||||
@ -142,13 +142,13 @@ sys_getmsg(struct tcb *tcp)
|
||||
printstrbufarg(tcp, tcp->u_arg[i], 1);
|
||||
/* pointer to flags */
|
||||
if (tcp->u_arg[3] == 0)
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (umove(tcp, tcp->u_arg[3], &flags) < 0)
|
||||
tprintf("[?]");
|
||||
tprints("[?]");
|
||||
else {
|
||||
tprintf("[");
|
||||
tprints("[");
|
||||
printflags(msgflags, flags, "RS_???");
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
}
|
||||
/* decode return value */
|
||||
switch (tcp->u_rval) {
|
||||
@ -226,16 +226,16 @@ sys_getpmsg(struct tcb *tcp)
|
||||
printstrbufarg(tcp, tcp->u_arg[i], 1);
|
||||
/* pointer to band */
|
||||
printnum(tcp, tcp->u_arg[3], "%d");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
/* pointer to flags */
|
||||
if (tcp->u_arg[4] == 0)
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (umove(tcp, tcp->u_arg[4], &flags) < 0)
|
||||
tprintf("[?]");
|
||||
tprints("[?]");
|
||||
else {
|
||||
tprintf("[");
|
||||
tprints("[");
|
||||
printflags(pmsgflags, flags, "MSG_???");
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
}
|
||||
/* decode return value */
|
||||
switch (tcp->u_rval) {
|
||||
@ -311,16 +311,16 @@ decode_poll(struct tcb *tcp, long pts)
|
||||
} else {
|
||||
abbrev_end = end;
|
||||
}
|
||||
tprintf("[");
|
||||
tprints("[");
|
||||
for (cur = start; cur < end; cur += sizeof(fds)) {
|
||||
if (cur > start)
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (cur >= abbrev_end) {
|
||||
tprintf("...");
|
||||
tprints("...");
|
||||
break;
|
||||
}
|
||||
if (umoven(tcp, cur, sizeof fds, (char *) &fds) < 0) {
|
||||
tprintf("?");
|
||||
tprints("?");
|
||||
failed = 1;
|
||||
break;
|
||||
}
|
||||
@ -328,13 +328,13 @@ decode_poll(struct tcb *tcp, long pts)
|
||||
tprintf("{fd=%d}", fds.fd);
|
||||
continue;
|
||||
}
|
||||
tprintf("{fd=");
|
||||
tprints("{fd=");
|
||||
printfd(tcp, fds.fd);
|
||||
tprintf(", events=");
|
||||
tprints(", events=");
|
||||
printflags(pollflags, fds.events, "POLL???");
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
if (failed)
|
||||
tprintf(" %#lx", start);
|
||||
tprintf(", %d, ", nfds);
|
||||
@ -426,7 +426,7 @@ sys_poll(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
#ifdef INFTIM
|
||||
if (tcp->u_arg[2] == INFTIM)
|
||||
tprintf("INFTIM");
|
||||
tprints("INFTIM");
|
||||
else
|
||||
#endif
|
||||
tprintf("%ld", tcp->u_arg[2]);
|
||||
@ -441,7 +441,7 @@ sys_ppoll(struct tcb *tcp)
|
||||
int rc = decode_poll(tcp, tcp->u_arg[2]);
|
||||
if (entering(tcp)) {
|
||||
print_timespec(tcp, tcp->u_arg[2]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
print_sigset(tcp, tcp->u_arg[3], 0);
|
||||
tprintf(", %lu", tcp->u_arg[4]);
|
||||
}
|
||||
@ -599,14 +599,14 @@ print_xti_optmgmt(struct tcb *tcp, long addr, int len)
|
||||
while (len >= (int) sizeof hdr) {
|
||||
if (umove(tcp, addr, &hdr) < 0) break;
|
||||
if (c++) {
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
}
|
||||
else if (len > hdr.len + sizeof hdr) {
|
||||
tprintf("[");
|
||||
tprints("[");
|
||||
}
|
||||
tprintf("{level=");
|
||||
tprints("{level=");
|
||||
printxval(xti_level, hdr.level, "???");
|
||||
tprintf(", name=");
|
||||
tprints(", name=");
|
||||
switch (hdr.level) {
|
||||
case XTI_GENERIC:
|
||||
printxval(xti_generic, hdr.name, "XTI_???");
|
||||
@ -615,13 +615,13 @@ print_xti_optmgmt(struct tcb *tcp, long addr, int len)
|
||||
tprintf("%ld", hdr.name);
|
||||
break;
|
||||
}
|
||||
tprintf(", status=");
|
||||
tprints(", status=");
|
||||
printxval(transport_user_flags, hdr.status, "T_???");
|
||||
addr += sizeof hdr;
|
||||
len -= sizeof hdr;
|
||||
if ((hdr.len -= sizeof hdr) > 0) {
|
||||
if (hdr.len > len) break;
|
||||
tprintf(", val=");
|
||||
tprints(", val=");
|
||||
if (len == sizeof(int))
|
||||
printnum(tcp, addr, "%d");
|
||||
else
|
||||
@ -629,13 +629,13 @@ print_xti_optmgmt(struct tcb *tcp, long addr, int len)
|
||||
addr += hdr.len;
|
||||
len -= hdr.len;
|
||||
}
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
if (len > 0) {
|
||||
if (c++) tprintf(", ");
|
||||
if (c++) tprints(", ");
|
||||
printstr(tcp, addr, len);
|
||||
}
|
||||
if (c > 1) tprintf("]");
|
||||
if (c > 1) tprints("]");
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -742,17 +742,17 @@ print_transport_message(struct tcb *tcp, int expect, long addr, int len)
|
||||
#define GET(type, struct) \
|
||||
do { \
|
||||
if (len < sizeof m.struct) goto dump; \
|
||||
if (umove(tcp, addr, &m.struct) < 0) goto dump;\
|
||||
tprintf("{"); \
|
||||
if (umove(tcp, addr, &m.struct) < 0) goto dump; \
|
||||
tprints("{"); \
|
||||
if (expect != type) { \
|
||||
++c; \
|
||||
tprintf(#type); \
|
||||
tprints(#type); \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define COMMA() \
|
||||
do { if (c++) tprintf(", "); } while (0)
|
||||
do { if (c++) tprints(", "); } while (0)
|
||||
|
||||
|
||||
#define STRUCT(struct, elem, print) \
|
||||
@ -767,7 +767,7 @@ print_transport_message(struct tcb *tcp, int expect, long addr, int len)
|
||||
m.struct.elem##_offset); \
|
||||
} \
|
||||
else { \
|
||||
tprintf(#elem "="); \
|
||||
tprints(#elem "="); \
|
||||
print(tcp, \
|
||||
addr + m.struct.elem##_offset, \
|
||||
m.struct.elem##_length); \
|
||||
@ -853,7 +853,7 @@ print_transport_message(struct tcb *tcp, int expect, long addr, int len)
|
||||
case T_OPTMGMT_REQ: /* manage opt req */
|
||||
GET(T_OPTMGMT_REQ, optmgmt_req);
|
||||
COMMA();
|
||||
tprintf("MGMT=");
|
||||
tprints("MGMT=");
|
||||
printflags(transport_user_flags, m.optmgmt_req.MGMT_flags,
|
||||
"T_???");
|
||||
STRUCT(optmgmt_req, OPT, print_optmgmt);
|
||||
@ -912,9 +912,9 @@ print_transport_message(struct tcb *tcp, int expect, long addr, int len)
|
||||
m.info_ack.ADDR_size, m.info_ack.OPT_size,
|
||||
m.info_ack.TIDU_size);
|
||||
printxval(service_type, m.info_ack.SERV_type, "T_???");
|
||||
tprintf(", CURRENT=");
|
||||
tprints(", CURRENT=");
|
||||
printxval(ts_state, m.info_ack.CURRENT_state, "TS_???");
|
||||
tprintf(", PROVIDER=");
|
||||
tprints(", PROVIDER=");
|
||||
printflags(provider_flags, m.info_ack.PROVIDER_flag, "???");
|
||||
break;
|
||||
#endif
|
||||
@ -929,10 +929,10 @@ print_transport_message(struct tcb *tcp, int expect, long addr, int len)
|
||||
case T_ERROR_ACK: /* error ack */
|
||||
GET(T_ERROR_ACK, error_ack);
|
||||
COMMA();
|
||||
tprintf("ERROR=");
|
||||
tprints("ERROR=");
|
||||
printxval(transport_user_options,
|
||||
m.error_ack.ERROR_prim, "TI_???");
|
||||
tprintf(", TLI=");
|
||||
tprints(", TLI=");
|
||||
printxval(tli_errors, m.error_ack.TLI_error, "T???");
|
||||
tprintf("UNIX=%s", strerror(m.error_ack.UNIX_error));
|
||||
break;
|
||||
@ -941,7 +941,7 @@ print_transport_message(struct tcb *tcp, int expect, long addr, int len)
|
||||
case T_OK_ACK: /* ok ack */
|
||||
GET(T_OK_ACK, ok_ack);
|
||||
COMMA();
|
||||
tprintf("CORRECT=");
|
||||
tprints("CORRECT=");
|
||||
printxval(transport_user_options,
|
||||
m.ok_ack.CORRECT_prim, "TI_???");
|
||||
break;
|
||||
@ -965,7 +965,7 @@ print_transport_message(struct tcb *tcp, int expect, long addr, int len)
|
||||
case T_OPTMGMT_ACK: /* manage opt ack */
|
||||
GET(T_OPTMGMT_ACK, optmgmt_ack);
|
||||
COMMA();
|
||||
tprintf("MGMT=");
|
||||
tprints("MGMT=");
|
||||
printflags(transport_user_flags, m.optmgmt_ack.MGMT_flags,
|
||||
"T_???");
|
||||
STRUCT(optmgmt_ack, OPT, print_optmgmt);
|
||||
@ -995,7 +995,7 @@ print_transport_message(struct tcb *tcp, int expect, long addr, int len)
|
||||
break;
|
||||
}
|
||||
|
||||
if (c >= 0) tprintf("}");
|
||||
if (c >= 0) tprints("}");
|
||||
|
||||
#undef ADDR
|
||||
#undef COMMA
|
||||
@ -1022,7 +1022,7 @@ static int internal_stream_ioctl(struct tcb *tcp, int arg)
|
||||
return 0;
|
||||
if (umove(tcp, arg, &si) < 0) {
|
||||
if (entering(tcp))
|
||||
tprintf(", {...}");
|
||||
tprints(", {...}");
|
||||
return 1;
|
||||
}
|
||||
if (entering(tcp)) {
|
||||
@ -1034,7 +1034,7 @@ static int internal_stream_ioctl(struct tcb *tcp, int arg)
|
||||
} else
|
||||
tprintf(", {ic_cmd=%#x", si.ic_cmd);
|
||||
if (si.ic_timout == INFTIM)
|
||||
tprintf(", ic_timout=INFTIM, ");
|
||||
tprints(", ic_timout=INFTIM, ");
|
||||
else
|
||||
tprintf(" ic_timout=%d, ", si.ic_timout);
|
||||
}
|
||||
@ -1048,9 +1048,9 @@ static int internal_stream_ioctl(struct tcb *tcp, int arg)
|
||||
}
|
||||
if (in_and_out) {
|
||||
if (entering(tcp))
|
||||
tprintf("/* in */ ");
|
||||
tprints("/* in */ ");
|
||||
else
|
||||
tprintf(", /* out */ ");
|
||||
tprints(", /* out */ ");
|
||||
}
|
||||
if (in_and_out || entering(tcp))
|
||||
tprintf("ic_len=%d, ic_dp=", si.ic_len);
|
||||
@ -1124,7 +1124,7 @@ static int internal_stream_ioctl(struct tcb *tcp, int arg)
|
||||
if (entering(tcp))
|
||||
break;
|
||||
if (umove(tcp, (int) si.ic_dp, &udata) < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
else {
|
||||
tprintf("{tidusize=%d, addrsize=%d, ",
|
||||
udata.tidusize, udata.addrsize);
|
||||
@ -1133,7 +1133,7 @@ static int internal_stream_ioctl(struct tcb *tcp, int arg)
|
||||
tprintf("servtype=%d, so_state=%d, ",
|
||||
udata.servtype, udata.so_state);
|
||||
tprintf("so_options=%d", udata.so_options);
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
break;
|
||||
#endif /* SI_GETUDATA */
|
||||
@ -1142,7 +1142,7 @@ static int internal_stream_ioctl(struct tcb *tcp, int arg)
|
||||
break;
|
||||
}
|
||||
if (exiting(tcp)) {
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
if (timod && tcp->u_rval && !syserror(tcp)) {
|
||||
tcp->auxstr = xlookup(tli_errors, tcp->u_rval);
|
||||
return RVAL_STR + 1;
|
||||
@ -1180,7 +1180,7 @@ stream_ioctl(struct tcb *tcp, int code, int arg)
|
||||
case I_LOOK:
|
||||
case I_FIND:
|
||||
/* arg is a string */
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printpath(tcp, arg);
|
||||
return 1;
|
||||
case I_POP:
|
||||
@ -1188,56 +1188,56 @@ stream_ioctl(struct tcb *tcp, int code, int arg)
|
||||
return 1;
|
||||
case I_FLUSH:
|
||||
/* argument is an option */
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printxval(stream_flush_options, arg, "FLUSH???");
|
||||
return 1;
|
||||
#ifdef I_FLUSHBAND
|
||||
case I_FLUSHBAND:
|
||||
/* argument is a pointer to a bandinfo struct */
|
||||
if (umove(tcp, arg, &bi) < 0)
|
||||
tprintf(", {...}");
|
||||
tprints(", {...}");
|
||||
else {
|
||||
tprintf(", {bi_pri=%d, bi_flag=", bi.bi_pri);
|
||||
printflags(stream_flush_options, bi.bi_flag, "FLUSH???");
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
return 1;
|
||||
#endif /* I_FLUSHBAND */
|
||||
case I_SETSIG:
|
||||
/* argument is a set of flags */
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(stream_setsig_flags, arg, "S_???");
|
||||
return 1;
|
||||
case I_GETSIG:
|
||||
/* argument is a pointer to a set of flags */
|
||||
if (syserror(tcp))
|
||||
return 0;
|
||||
tprintf(", [");
|
||||
tprints(", [");
|
||||
if (umove(tcp, arg, &val) < 0)
|
||||
tprintf("?");
|
||||
tprints("?");
|
||||
else
|
||||
printflags(stream_setsig_flags, val, "S_???");
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
return 1;
|
||||
case I_PEEK:
|
||||
/* argument is a pointer to a strpeek structure */
|
||||
if (syserror(tcp) || !arg)
|
||||
return 0;
|
||||
if (umove(tcp, arg, &sp) < 0) {
|
||||
tprintf(", {...}");
|
||||
tprints(", {...}");
|
||||
return 1;
|
||||
}
|
||||
tprintf(", {ctlbuf=");
|
||||
tprints(", {ctlbuf=");
|
||||
printstrbuf(tcp, &sp.ctlbuf, 1);
|
||||
tprintf(", databuf=");
|
||||
tprints(", databuf=");
|
||||
printstrbuf(tcp, &sp.databuf, 1);
|
||||
tprintf(", flags=");
|
||||
tprints(", flags=");
|
||||
printflags(msgflags, sp.flags, "RS_???");
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
return 1;
|
||||
case I_SRDOPT:
|
||||
/* argument is an option with flags */
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printxval(stream_read_options, arg & RMODEMASK, "R???");
|
||||
addflags(stream_read_flags, arg & ~RMODEMASK);
|
||||
return 1;
|
||||
@ -1245,15 +1245,15 @@ stream_ioctl(struct tcb *tcp, int code, int arg)
|
||||
/* argument is an pointer to an option with flags */
|
||||
if (syserror(tcp))
|
||||
return 0;
|
||||
tprintf(", [");
|
||||
tprints(", [");
|
||||
if (umove(tcp, arg, &val) < 0)
|
||||
tprintf("?");
|
||||
tprints("?");
|
||||
else {
|
||||
printxval(stream_read_options,
|
||||
arg & RMODEMASK, "R???");
|
||||
addflags(stream_read_flags, arg & ~RMODEMASK);
|
||||
}
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
return 1;
|
||||
case I_NREAD:
|
||||
#ifdef I_GETBAND
|
||||
@ -1268,7 +1268,7 @@ stream_ioctl(struct tcb *tcp, int code, int arg)
|
||||
/* argument is a pointer to a decimal integer */
|
||||
if (syserror(tcp))
|
||||
return 0;
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printnum(tcp, arg, "%d");
|
||||
return 1;
|
||||
case I_FDINSERT:
|
||||
@ -1276,21 +1276,21 @@ stream_ioctl(struct tcb *tcp, int code, int arg)
|
||||
if (syserror(tcp) || !arg)
|
||||
return 0;
|
||||
if (umove(tcp, arg, &sfi) < 0) {
|
||||
tprintf(", {...}");
|
||||
tprints(", {...}");
|
||||
return 1;
|
||||
}
|
||||
tprintf(", {ctlbuf=");
|
||||
tprints(", {ctlbuf=");
|
||||
printstrbuf(tcp, &sfi.ctlbuf, 1);
|
||||
tprintf(", databuf=");
|
||||
tprints(", databuf=");
|
||||
printstrbuf(tcp, &sfi.databuf, 1);
|
||||
tprintf(", flags=");
|
||||
tprints(", flags=");
|
||||
printflags(msgflags, sfi.flags, "RS_???");
|
||||
tprintf(", filedes=%d, offset=%d}", sfi.fildes, sfi.offset);
|
||||
return 1;
|
||||
#ifdef I_SWROPT
|
||||
case I_SWROPT:
|
||||
/* argument is a set of flags */
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(stream_write_flags, arg, "SND???");
|
||||
return 1;
|
||||
#endif /* I_SWROPT */
|
||||
@ -1299,12 +1299,12 @@ stream_ioctl(struct tcb *tcp, int code, int arg)
|
||||
/* argument is an pointer to an option with flags */
|
||||
if (syserror(tcp))
|
||||
return 0;
|
||||
tprintf(", [");
|
||||
tprints(", [");
|
||||
if (umove(tcp, arg, &val) < 0)
|
||||
tprintf("?");
|
||||
tprints("?");
|
||||
else
|
||||
printflags(stream_write_flags, arg, "SND???");
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
return 1;
|
||||
#endif /* I_GWROPT */
|
||||
case I_SENDFD:
|
||||
@ -1326,7 +1326,7 @@ stream_ioctl(struct tcb *tcp, int code, int arg)
|
||||
if (syserror(tcp) || !arg)
|
||||
return 0;
|
||||
if (umove(tcp, arg, &srf) < 0) {
|
||||
tprintf(", {...}");
|
||||
tprints(", {...}");
|
||||
return 1;
|
||||
}
|
||||
tprintf(", {fd=%d, uid=%lu, gid=%lu}", srf.fd,
|
||||
@ -1337,25 +1337,25 @@ stream_ioctl(struct tcb *tcp, int code, int arg)
|
||||
if (syserror(tcp))
|
||||
return 0;
|
||||
if (arg == 0) {
|
||||
tprintf(", NULL");
|
||||
tprints(", NULL");
|
||||
return 1;
|
||||
}
|
||||
if (umove(tcp, arg, &sl) < 0) {
|
||||
tprintf(", {...}");
|
||||
tprints(", {...}");
|
||||
return 1;
|
||||
}
|
||||
tprintf(", {sl_nmods=%d, sl_modlist=[", sl.sl_nmods);
|
||||
for (i = 0; i < tcp->u_rval; i++) {
|
||||
if (i)
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printpath(tcp, (int) sl.sl_modlist[i].l_name);
|
||||
}
|
||||
tprintf("]}");
|
||||
tprints("]}");
|
||||
return 1;
|
||||
#endif /* I_LIST */
|
||||
#ifdef I_ATMARK
|
||||
case I_ATMARK:
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printxval(stream_atmark_options, arg, "???MARK");
|
||||
return 1;
|
||||
#endif /* I_ATMARK */
|
||||
|
16
syscall.c
16
syscall.c
@ -2360,9 +2360,9 @@ trace_syscall_exiting(struct tcb *tcp)
|
||||
}
|
||||
|
||||
if (res != 1) {
|
||||
tprintf(") ");
|
||||
tprints(") ");
|
||||
tabto();
|
||||
tprintf("= ? <unavailable>");
|
||||
tprints("= ? <unavailable>");
|
||||
printtrailer();
|
||||
tcp->flags &= ~TCB_INSYSCALL;
|
||||
return res;
|
||||
@ -2385,7 +2385,7 @@ trace_syscall_exiting(struct tcb *tcp)
|
||||
sys_res = (*sysent[tcp->scno].sys_func)(tcp);
|
||||
}
|
||||
|
||||
tprintf(") ");
|
||||
tprints(") ");
|
||||
tabto();
|
||||
u_error = tcp->u_error;
|
||||
if (!SCNO_IN_RANGE(tcp->scno) ||
|
||||
@ -2399,16 +2399,16 @@ trace_syscall_exiting(struct tcb *tcp)
|
||||
switch (u_error) {
|
||||
#ifdef LINUX
|
||||
case ERESTARTSYS:
|
||||
tprintf("= ? ERESTARTSYS (To be restarted)");
|
||||
tprints("= ? ERESTARTSYS (To be restarted)");
|
||||
break;
|
||||
case ERESTARTNOINTR:
|
||||
tprintf("= ? ERESTARTNOINTR (To be restarted)");
|
||||
tprints("= ? ERESTARTNOINTR (To be restarted)");
|
||||
break;
|
||||
case ERESTARTNOHAND:
|
||||
tprintf("= ? ERESTARTNOHAND (To be restarted)");
|
||||
tprints("= ? ERESTARTNOHAND (To be restarted)");
|
||||
break;
|
||||
case ERESTART_RESTARTBLOCK:
|
||||
tprintf("= ? ERESTART_RESTARTBLOCK (To be restarted)");
|
||||
tprints("= ? ERESTART_RESTARTBLOCK (To be restarted)");
|
||||
break;
|
||||
#endif /* LINUX */
|
||||
default:
|
||||
@ -2427,7 +2427,7 @@ trace_syscall_exiting(struct tcb *tcp)
|
||||
}
|
||||
else {
|
||||
if (sys_res & RVAL_NONE)
|
||||
tprintf("= ?");
|
||||
tprints("= ?");
|
||||
else {
|
||||
switch (sys_res & RVAL_MASK) {
|
||||
case RVAL_HEX:
|
||||
|
166
system.c
166
system.c
@ -136,19 +136,19 @@ sys_mount(struct tcb *tcp)
|
||||
ignore_type = ignore_data = 1;
|
||||
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
|
||||
printpath(tcp, tcp->u_arg[1]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
|
||||
if (ignore_type && tcp->u_arg[2])
|
||||
tprintf("%#lx", tcp->u_arg[2]);
|
||||
else
|
||||
printstr(tcp, tcp->u_arg[2], -1);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
|
||||
printflags(mount_flags, tcp->u_arg[3], "MS_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
|
||||
if (ignore_data && tcp->u_arg[4])
|
||||
tprintf("%#lx", tcp->u_arg[4]);
|
||||
@ -174,7 +174,7 @@ sys_umount2(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printstr(tcp, tcp->u_arg[0], -1);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(umount_flags, tcp->u_arg[1], "MNT_???");
|
||||
}
|
||||
return 0;
|
||||
@ -243,12 +243,12 @@ sys_reboot(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printflags(bootflags1, tcp->u_arg[0], "LINUX_REBOOT_MAGIC_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(bootflags2, tcp->u_arg[1], "LINUX_REBOOT_MAGIC_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(bootflags3, tcp->u_arg[2], "LINUX_REBOOT_CMD_???");
|
||||
if (tcp->u_arg[2] == LINUX_REBOOT_CMD_RESTART2) {
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printstr(tcp, tcp->u_arg[3], -1);
|
||||
}
|
||||
}
|
||||
@ -290,7 +290,7 @@ sys_cacheflush(struct tcb *tcp)
|
||||
tprintf("%#lx, ", tcp->u_arg[0]);
|
||||
/* scope */
|
||||
printxval(cacheflush_scope, tcp->u_arg[1], "FLUSH_SCOPE_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
/* flags */
|
||||
printflags(cacheflush_flags, tcp->u_arg[2], "FLUSH_CACHE_???");
|
||||
/* len */
|
||||
@ -516,9 +516,9 @@ sys_mount(struct tcb *tcp)
|
||||
tprintf("\"%s\", ", type);
|
||||
}
|
||||
printstr(tcp, tcp->u_arg[1], -1);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(mountflags, tcp->u_arg[2] & ~M_NEWTYPE, "M_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
|
||||
if (strcmp(type, "4.2") == 0) {
|
||||
struct ufs_args a;
|
||||
@ -534,9 +534,9 @@ sys_mount(struct tcb *tcp)
|
||||
struct nfs_args a;
|
||||
if (umove(tcp, tcp->u_arg[3], &a) < 0)
|
||||
return 0;
|
||||
tprintf("[");
|
||||
tprints("[");
|
||||
printsock(tcp, (int) a.addr);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(nfsflags, a.flags, "NFSMNT_???");
|
||||
tprintf(", ws:%u,rs:%u,to:%u,re:%u,",
|
||||
a.wsize, a.rsize, a.timeo, a.retrans);
|
||||
@ -550,13 +550,13 @@ sys_mount(struct tcb *tcp)
|
||||
printstr(tcp, (int) a.netname, -1);
|
||||
else
|
||||
tprintf("%#lx", (unsigned long) a.netname);
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
} else if (strcmp(type, "rfs") == 0) {
|
||||
struct rfs_args a;
|
||||
struct token t;
|
||||
if (umove(tcp, tcp->u_arg[3], &a) < 0)
|
||||
return 0;
|
||||
tprintf("[");
|
||||
tprints("[");
|
||||
printstr(tcp, (int)a.rmtfs, -1);
|
||||
if (umove(tcp, (int)a.token, &t) < 0)
|
||||
return 0;
|
||||
@ -613,27 +613,27 @@ sys_exportfs(struct tcb *tcp)
|
||||
}
|
||||
tprintf("{fl:%u, anon:%u, ", e.ex_flags, e.ex_anon);
|
||||
printxval(ex_auth_flags, e.ex_auth, "AUTH_???");
|
||||
tprintf(", roots:[");
|
||||
tprints(", roots:[");
|
||||
if (e.ex_auth == AUTH_UNIX) {
|
||||
for (i = 0; i < e.ex_u.exunix.rootaddrs.naddrs; i++) {
|
||||
printsock(tcp,
|
||||
(int)&e.ex_u.exunix.rootaddrs.addrvec[i]);
|
||||
}
|
||||
tprintf("], writers:[");
|
||||
tprints("], writers:[");
|
||||
for (i = 0; i < e.ex_writeaddrs.naddrs; i++) {
|
||||
printsock(tcp,
|
||||
(int)&e.ex_writeaddrs.addrvec[i]);
|
||||
}
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
} else {
|
||||
for (i = 0; i < e.ex_u.exdes.nnames; i++) {
|
||||
printsock(tcp,
|
||||
(int)&e.ex_u.exdes.rootnames[i]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
}
|
||||
tprintf("], window:%u", e.ex_u.exdes.window);
|
||||
}
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -715,7 +715,7 @@ sys_pathconf(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printstr(tcp, tcp->u_arg[0], -1);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printxval(pathconflimits, tcp->u_arg[1], "_PC_???");
|
||||
}
|
||||
return 0;
|
||||
@ -860,7 +860,7 @@ sys_sysinfo(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printxval(sysinfo_options, tcp->u_arg[0], "SI_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
}
|
||||
else {
|
||||
/* Technically some calls write values. So what. */
|
||||
@ -1316,30 +1316,30 @@ sys_mount(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printpath(tcp, tcp->u_arg[1]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(mount_flags, tcp->u_arg[2], "MS_???");
|
||||
if (tcp->u_arg[2] & (MS_FSS | MS_DATA)) {
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
tprintf("%ld", tcp->u_arg[3]);
|
||||
}
|
||||
if (tcp->u_arg[2] & MS_DATA) {
|
||||
int nfs_type = sysfs(GETFSIND, FSID_NFS);
|
||||
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (tcp->u_arg[3] == nfs_type) {
|
||||
struct nfs_args args;
|
||||
if (umove(tcp, tcp->u_arg[4], &args) < 0)
|
||||
tprintf("%#lx", tcp->u_arg[4]);
|
||||
else {
|
||||
tprintf("addr=");
|
||||
tprints("addr=");
|
||||
printsock(tcp, (int) args.addr);
|
||||
tprintf(", flags=");
|
||||
tprints(", flags=");
|
||||
printflags(nfs_flags, args.flags, "NFSMNT_???");
|
||||
tprintf(", hostname=");
|
||||
tprints(", hostname=");
|
||||
printstr(tcp, (int) args.hostname, -1);
|
||||
tprintf(", ...}");
|
||||
tprints(", ...}");
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1427,9 +1427,9 @@ sys_mount(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
char fstyp[FSTYPSZ];
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printpath(tcp, tcp->u_arg[1]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(mount_flags, tcp->u_arg[2], "MS_???");
|
||||
/* The doc sez that the file system type is given as a
|
||||
fsindex, and we should use sysfs to work out the name.
|
||||
@ -1444,7 +1444,7 @@ sys_mount(struct tcb *tcp)
|
||||
tprintf(", \"%s\"", fstyp);
|
||||
}
|
||||
if (tcp->u_arg[2] & MS_DATA) {
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
#ifdef VX_MS_MASK
|
||||
/* On UW7 they don't give us the defines and structs
|
||||
we need to see what is going on. Bummer. */
|
||||
@ -1453,23 +1453,23 @@ sys_mount(struct tcb *tcp)
|
||||
if (umove(tcp, tcp->u_arg[4], &args) < 0)
|
||||
tprintf("%#lx", tcp->u_arg[4]);
|
||||
else {
|
||||
tprintf("{ flags=");
|
||||
tprints("{ flags=");
|
||||
printflags(vxfs_flags, args.mflags, "VX_MS_???");
|
||||
if (args.mflags & VX_MS_SNAPSHOT) {
|
||||
tprintf(", snapof=");
|
||||
tprints(", snapof=");
|
||||
printstr(tcp,
|
||||
(long) args.primaryspec,
|
||||
-1);
|
||||
if (args.snapsize > 0)
|
||||
tprintf(", snapsize=%ld", args.snapsize);
|
||||
}
|
||||
tprintf(" }");
|
||||
tprints(" }");
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (strcmp(fstyp, "specfs") == 0) {
|
||||
tprintf("dev=");
|
||||
tprints("dev=");
|
||||
printstr(tcp, tcp->u_arg[4], -1);
|
||||
}
|
||||
else
|
||||
@ -1479,18 +1479,18 @@ sys_mount(struct tcb *tcp)
|
||||
tprintf("%#lx", tcp->u_arg[4]);
|
||||
else {
|
||||
struct netbuf addr;
|
||||
tprintf("{ addr=");
|
||||
tprints("{ addr=");
|
||||
if (umove(tcp, (int) args.addr, &addr) < 0) {
|
||||
tprintf("%#lx", (long) args.addr);
|
||||
}
|
||||
else {
|
||||
printsock(tcp, (int) addr.buf, addr.len);
|
||||
}
|
||||
tprintf(", flags=");
|
||||
tprints(", flags=");
|
||||
printflags(nfs_flags, args.flags, "NFSMNT_???");
|
||||
tprintf(", hostname=");
|
||||
tprints(", hostname=");
|
||||
printstr(tcp, (int) args.hostname, -1);
|
||||
tprintf(", ...}");
|
||||
tprints(", ...}");
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1508,9 +1508,9 @@ sys_mount(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printpath(tcp, tcp->u_arg[1]);
|
||||
tprintf(", ...");
|
||||
tprints(", ...");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -1584,29 +1584,29 @@ sys_capget(struct tcb *tcp)
|
||||
|
||||
if (!entering(tcp)) {
|
||||
if (!tcp->u_arg[0])
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (!verbose(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[0]);
|
||||
else if (umoven(tcp, tcp->u_arg[0], sizeof(*arg0), (char *) arg0) < 0)
|
||||
tprintf("???");
|
||||
tprints("???");
|
||||
else {
|
||||
tprintf("%#x, %d", arg0->version, arg0->pid);
|
||||
}
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (!tcp->u_arg[1])
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (!verbose(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[1]);
|
||||
else if (umoven(tcp, tcp->u_arg[1], sizeof(*arg1), (char *) arg1) < 0)
|
||||
tprintf("???");
|
||||
tprints("???");
|
||||
else {
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
printflags(capabilities, arg1->effective, "CAP_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(capabilities, arg1->permitted, "CAP_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(capabilities, arg1->inheritable, "CAP_???");
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@ -1624,29 +1624,29 @@ sys_capset(struct tcb *tcp)
|
||||
|
||||
if (entering(tcp)) {
|
||||
if (!tcp->u_arg[0])
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (!verbose(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[0]);
|
||||
else if (umoven(tcp, tcp->u_arg[0], sizeof(*arg0), (char *) arg0) < 0)
|
||||
tprintf("???");
|
||||
tprints("???");
|
||||
else {
|
||||
tprintf("%#x, %d", arg0->version, arg0->pid);
|
||||
}
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (!tcp->u_arg[1])
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (!verbose(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[1]);
|
||||
else if (umoven(tcp, tcp->u_arg[1], sizeof(*arg1), (char *) arg1) < 0)
|
||||
tprintf("???");
|
||||
tprints("???");
|
||||
else {
|
||||
tprintf("{");
|
||||
tprints("{");
|
||||
printflags(capabilities, arg1->effective, "CAP_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(capabilities, arg1->permitted, "CAP_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(capabilities, arg1->inheritable, "CAP_???");
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@ -1937,7 +1937,7 @@ sys_sysctl(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
int cnt = 0, max_cnt;
|
||||
|
||||
tprintf("{{");
|
||||
tprints("{{");
|
||||
|
||||
if (info.nlen == 0)
|
||||
goto out;
|
||||
@ -1948,17 +1948,17 @@ sys_sysctl(struct tcb *tcp)
|
||||
goto out;
|
||||
switch (name[0]) {
|
||||
case CTL_KERN:
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printxval(sysctl_kern, name[1], "KERN_???");
|
||||
++cnt;
|
||||
break;
|
||||
case CTL_VM:
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printxval(sysctl_vm, name[1], "VM_???");
|
||||
++cnt;
|
||||
break;
|
||||
case CTL_NET:
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printxval(sysctl_net, name[1], "NET_???");
|
||||
++cnt;
|
||||
|
||||
@ -1966,17 +1966,17 @@ sys_sysctl(struct tcb *tcp)
|
||||
goto out;
|
||||
switch (name[1]) {
|
||||
case NET_CORE:
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printxval(sysctl_net_core, name[2],
|
||||
"NET_CORE_???");
|
||||
break;
|
||||
case NET_UNIX:
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printxval(sysctl_net_unix, name[2],
|
||||
"NET_UNIX_???");
|
||||
break;
|
||||
case NET_IPV4:
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printxval(sysctl_net_ipv4, name[2],
|
||||
"NET_IPV4_???");
|
||||
|
||||
@ -1984,13 +1984,13 @@ sys_sysctl(struct tcb *tcp)
|
||||
goto out;
|
||||
switch (name[2]) {
|
||||
case NET_IPV4_ROUTE:
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printxval(sysctl_net_ipv4_route,
|
||||
name[3],
|
||||
"NET_IPV4_ROUTE_???");
|
||||
break;
|
||||
case NET_IPV4_CONF:
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printxval(sysctl_net_ipv4_conf,
|
||||
name[3],
|
||||
"NET_IPV4_CONF_???");
|
||||
@ -2000,7 +2000,7 @@ sys_sysctl(struct tcb *tcp)
|
||||
}
|
||||
break;
|
||||
case NET_IPV6:
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printxval(sysctl_net_ipv6, name[2],
|
||||
"NET_IPV6_???");
|
||||
|
||||
@ -2008,7 +2008,7 @@ sys_sysctl(struct tcb *tcp)
|
||||
goto out;
|
||||
switch (name[2]) {
|
||||
case NET_IPV6_ROUTE:
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printxval(sysctl_net_ipv6_route,
|
||||
name[3],
|
||||
"NET_IPV6_ROUTE_???");
|
||||
@ -2031,7 +2031,7 @@ sys_sysctl(struct tcb *tcp)
|
||||
while (cnt < max_cnt)
|
||||
tprintf(", %x", name[cnt++]);
|
||||
if (cnt < info.nlen)
|
||||
tprintf(", ...");
|
||||
tprints(", ...");
|
||||
tprintf("}, %d, ", info.nlen);
|
||||
} else {
|
||||
size_t oldlen;
|
||||
@ -2050,7 +2050,7 @@ sys_sysctl(struct tcb *tcp)
|
||||
printpath(tcp, (size_t)info.oldval);
|
||||
tprintf(", %Zu, ", oldlen);
|
||||
if (info.newval == 0)
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (syserror(tcp))
|
||||
tprintf("%p", info.newval);
|
||||
else
|
||||
@ -2060,7 +2060,7 @@ sys_sysctl(struct tcb *tcp)
|
||||
tprintf("%p, %Zd, %p, %Zd", info.oldval, oldlen,
|
||||
info.newval, info.newlen);
|
||||
}
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
|
||||
free(name);
|
||||
@ -2087,7 +2087,7 @@ int sys___sysctl(struct tcb *tcp)
|
||||
if (tcp->u_arg[1] < 0 || tcp->u_arg[1] > CTL_MAXNAME ||
|
||||
(umoven(tcp, tcp->u_arg[0], tcp->u_arg[1] * sizeof(int),
|
||||
(char *) (qoid + 2)) < 0))
|
||||
tprintf("[...], ");
|
||||
tprints("[...], ");
|
||||
else {
|
||||
/* Use sysctl to ask the name of the current MIB
|
||||
This uses the undocumented "Staff-functions" used
|
||||
@ -2096,7 +2096,7 @@ int sys___sysctl(struct tcb *tcp)
|
||||
qoid[0] = 0; /* sysctl */
|
||||
qoid[1] = 1; /* name */
|
||||
i = sizeof(ctl);
|
||||
tprintf("[");
|
||||
tprints("[");
|
||||
if (sysctl(qoid, tcp->u_arg[1] + 2, ctl, &i, 0, 0) >= 0) {
|
||||
numeric = !abbrev(tcp);
|
||||
tprintf("%s%s", ctl, numeric ? ", " : "");
|
||||
@ -2106,7 +2106,7 @@ int sys___sysctl(struct tcb *tcp)
|
||||
for (i = 0; i < tcp->u_arg[1]; i++)
|
||||
tprintf("%s%d", i ? "." : "", qoid[i + 2]);
|
||||
}
|
||||
tprintf("], ");
|
||||
tprints("], ");
|
||||
tprintf("%lu, ", tcp->u_arg[1]);
|
||||
}
|
||||
} else {
|
||||
@ -2139,7 +2139,7 @@ sys_getksym(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printstr(tcp, tcp->u_arg[0], -1);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
}
|
||||
else {
|
||||
if (syserror(tcp)) {
|
||||
@ -2149,14 +2149,14 @@ sys_getksym(struct tcb *tcp)
|
||||
else {
|
||||
int val;
|
||||
printnum(tcp, tcp->u_arg[1], "%#lx");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (umove(tcp, tcp->u_arg[2], &val) < 0) {
|
||||
tprintf("%#lx", tcp->u_arg[2]);
|
||||
}
|
||||
else {
|
||||
tprintf("[");
|
||||
tprints("[");
|
||||
printxval(ksym_flags, val, "STT_???");
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2230,7 +2230,7 @@ int sys_ssisys(struct tcb *tcp)
|
||||
tprintf("%#lx, %ld", tcp->u_arg[0], tcp->u_arg[1]);
|
||||
return 0;
|
||||
}
|
||||
tprintf("{id=");
|
||||
tprints("{id=");
|
||||
printxval(ssi_cmd, iov.tio_id.id_cmd, "SSISYS_???");
|
||||
tprintf(":%d", iov.tio_id.id_ver);
|
||||
switch (iov.tio_id.id_cmd) {
|
||||
|
20
term.c
20
term.c
@ -212,15 +212,15 @@ int term_ioctl(struct tcb *tcp, long code, long arg)
|
||||
if (!verbose(tcp) || umove(tcp, arg, &tios) < 0)
|
||||
return 0;
|
||||
if (abbrev(tcp)) {
|
||||
tprintf(", {");
|
||||
tprints(", {");
|
||||
#ifndef FREEBSD
|
||||
printxval(baud_options, tios.c_cflag & CBAUD, "B???");
|
||||
#else
|
||||
printxval(baud_options, tios.c_ispeed, "B???");
|
||||
if (tios.c_ispeed != tios.c_ospeed) {
|
||||
tprintf(" (in)");
|
||||
tprints(" (in)");
|
||||
printxval(baud_options, tios.c_ospeed, "B???");
|
||||
tprintf(" (out)");
|
||||
tprints(" (out)");
|
||||
}
|
||||
#endif
|
||||
tprintf(" %sopost %sisig %sicanon %secho ...}",
|
||||
@ -257,7 +257,7 @@ int term_ioctl(struct tcb *tcp, long code, long arg)
|
||||
if (!verbose(tcp) || umove(tcp, arg, &tio) < 0)
|
||||
return 0;
|
||||
if (abbrev(tcp)) {
|
||||
tprintf(", {");
|
||||
tprints(", {");
|
||||
printxval(baud_options, tio.c_cflag & CBAUD, "B???");
|
||||
tprintf(" %sopost %sisig %sicanon %secho ...}",
|
||||
(tio.c_oflag & OPOST) ? "" : "-",
|
||||
@ -316,13 +316,13 @@ int term_ioctl(struct tcb *tcp, long code, long arg)
|
||||
/* ioctls with a direct decodable arg */
|
||||
#ifdef TCXONC
|
||||
case TCXONC:
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printxval(tcxonc_options, arg, "TC???");
|
||||
return 1;
|
||||
#endif
|
||||
#ifdef TCLFLSH
|
||||
case TCFLSH:
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printxval(tcflsh_options, arg, "TC???");
|
||||
return 1;
|
||||
#endif
|
||||
@ -336,9 +336,9 @@ int term_ioctl(struct tcb *tcp, long code, long arg)
|
||||
case TIOCMSET:
|
||||
if (umove(tcp, arg, &i) < 0)
|
||||
return 0;
|
||||
tprintf(", [");
|
||||
tprints(", [");
|
||||
printflags(modem_flags, i, "TIOCM_???");
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
return 1;
|
||||
#endif /* TIOCMGET */
|
||||
|
||||
@ -410,7 +410,7 @@ int term_ioctl(struct tcb *tcp, long code, long arg)
|
||||
#ifdef TIOCGPTN
|
||||
case TIOCGPTN:
|
||||
#endif
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printnum_int(tcp, arg, "%d");
|
||||
return 1;
|
||||
|
||||
@ -419,7 +419,7 @@ int term_ioctl(struct tcb *tcp, long code, long arg)
|
||||
#ifdef TIOCSTI
|
||||
case TIOCSTI:
|
||||
#endif
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printstr(tcp, arg, 1);
|
||||
return 1;
|
||||
|
||||
|
126
time.c
126
time.c
@ -67,7 +67,7 @@ void
|
||||
printtv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness, int special)
|
||||
{
|
||||
if (addr == 0)
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (!verbose(tcp))
|
||||
tprintf("%#lx", addr);
|
||||
else {
|
||||
@ -85,10 +85,10 @@ printtv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness, int special)
|
||||
if (rc >= 0) {
|
||||
if (special && tv.tv_sec == 0 &&
|
||||
tv.tv_usec == UTIME_NOW)
|
||||
tprintf("UTIME_NOW");
|
||||
tprints("UTIME_NOW");
|
||||
else if (special && tv.tv_sec == 0 &&
|
||||
tv.tv_usec == UTIME_OMIT)
|
||||
tprintf("UTIME_OMIT");
|
||||
tprints("UTIME_OMIT");
|
||||
else
|
||||
tprint_timeval32(tcp, &tv);
|
||||
}
|
||||
@ -99,16 +99,16 @@ printtv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness, int special)
|
||||
if (rc >= 0) {
|
||||
if (special && tv.tv_sec == 0 &&
|
||||
tv.tv_usec == UTIME_NOW)
|
||||
tprintf("UTIME_NOW");
|
||||
tprints("UTIME_NOW");
|
||||
else if (special && tv.tv_sec == 0 &&
|
||||
tv.tv_usec == UTIME_OMIT)
|
||||
tprintf("UTIME_OMIT");
|
||||
tprints("UTIME_OMIT");
|
||||
else
|
||||
tprint_timeval(tcp, &tv);
|
||||
}
|
||||
}
|
||||
if (rc < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
}
|
||||
}
|
||||
|
||||
@ -155,7 +155,7 @@ sprinttv(struct tcb *tcp, long addr, enum bitness_t bitness, char *buf)
|
||||
void print_timespec(struct tcb *tcp, long addr)
|
||||
{
|
||||
if (addr == 0)
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (!verbose(tcp))
|
||||
tprintf("%#lx", addr);
|
||||
else {
|
||||
@ -181,7 +181,7 @@ void print_timespec(struct tcb *tcp, long addr)
|
||||
(unsigned long) ts.tv_nsec);
|
||||
}
|
||||
if (rc < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
}
|
||||
}
|
||||
|
||||
@ -249,7 +249,7 @@ sys_gettimeofday(struct tcb *tcp)
|
||||
}
|
||||
printtv(tcp, tcp->u_arg[0]);
|
||||
#ifndef SVR4
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printtv(tcp, tcp->u_arg[1]);
|
||||
#endif /* !SVR4 */
|
||||
}
|
||||
@ -268,7 +268,7 @@ sys_osf_gettimeofday(struct tcb *tcp)
|
||||
}
|
||||
printtv_bitness(tcp, tcp->u_arg[0], BITNESS_32, 0);
|
||||
#ifndef SVR4
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32, 0);
|
||||
#endif /* !SVR4 */
|
||||
}
|
||||
@ -282,7 +282,7 @@ sys_settimeofday(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
printtv(tcp, tcp->u_arg[0]);
|
||||
#ifndef SVR4
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printtv(tcp, tcp->u_arg[1]);
|
||||
#endif /* !SVR4 */
|
||||
}
|
||||
@ -296,7 +296,7 @@ sys_osf_settimeofday(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
printtv_bitness(tcp, tcp->u_arg[0], BITNESS_32, 0);
|
||||
#ifndef SVR4
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32, 0);
|
||||
#endif /* !SVR4 */
|
||||
}
|
||||
@ -309,7 +309,7 @@ sys_adjtime(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printtv(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[1]);
|
||||
@ -324,7 +324,7 @@ sys_nanosleep(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
print_timespec(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
if (!tcp->u_arg[1] || is_restart_error(tcp))
|
||||
print_timespec(tcp, tcp->u_arg[1]);
|
||||
@ -345,7 +345,7 @@ static void
|
||||
printitv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness)
|
||||
{
|
||||
if (addr == 0)
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (!verbose(tcp))
|
||||
tprintf("%#lx", addr);
|
||||
else {
|
||||
@ -363,26 +363,26 @@ printitv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness)
|
||||
|
||||
rc = umove(tcp, addr, &itv);
|
||||
if (rc >= 0) {
|
||||
tprintf("{it_interval=");
|
||||
tprints("{it_interval=");
|
||||
tprint_timeval32(tcp, &itv.it_interval);
|
||||
tprintf(", it_value=");
|
||||
tprints(", it_value=");
|
||||
tprint_timeval32(tcp, &itv.it_value);
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
} else {
|
||||
struct itimerval itv;
|
||||
|
||||
rc = umove(tcp, addr, &itv);
|
||||
if (rc >= 0) {
|
||||
tprintf("{it_interval=");
|
||||
tprints("{it_interval=");
|
||||
tprint_timeval(tcp, &itv.it_interval);
|
||||
tprintf(", it_value=");
|
||||
tprints(", it_value=");
|
||||
tprint_timeval(tcp, &itv.it_value);
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
}
|
||||
if (rc < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
}
|
||||
}
|
||||
|
||||
@ -394,7 +394,7 @@ sys_getitimer(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printxval(which, tcp->u_arg[0], "ITIMER_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[1]);
|
||||
@ -411,7 +411,7 @@ sys_osf_getitimer(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printxval(which, tcp->u_arg[0], "ITIMER_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[1]);
|
||||
@ -427,9 +427,9 @@ sys_setitimer(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printxval(which, tcp->u_arg[0], "ITIMER_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printitv(tcp, tcp->u_arg[1]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[2]);
|
||||
@ -445,9 +445,9 @@ sys_osf_setitimer(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printxval(which, tcp->u_arg[0], "ITIMER_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printitv_bitness(tcp, tcp->u_arg[1], BITNESS_32);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[2]);
|
||||
@ -583,7 +583,7 @@ tprint_timex32(struct tcb *tcp, long addr)
|
||||
if (umove(tcp, addr, &tx) < 0)
|
||||
return -1;
|
||||
|
||||
tprintf("{modes=");
|
||||
tprints("{modes=");
|
||||
printflags(adjtimex_modes, tx.modes, "ADJ_???");
|
||||
tprintf(", offset=%d, freq=%d, maxerror=%d, ",
|
||||
tx.offset, tx.freq, tx.maxerror);
|
||||
@ -599,7 +599,7 @@ tprint_timex32(struct tcb *tcp, long addr)
|
||||
tx.shift, tx.stabil, tx.jitcnt);
|
||||
tprintf(", calcnt=%d, errcnt=%d, stbcnt=%d",
|
||||
tx.calcnt, tx.errcnt, tx.stbcnt);
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
return 0;
|
||||
}
|
||||
#endif /* SUPPORTED_PERSONALITIES > 1 */
|
||||
@ -626,7 +626,7 @@ tprint_timex(struct tcb *tcp, long addr)
|
||||
tprintf("tolerance=%ld, time=", tx.tolerance);
|
||||
tprint_timeval(tcp, &tx.time);
|
||||
#else
|
||||
tprintf("{modes=");
|
||||
tprints("{modes=");
|
||||
printflags(adjtimex_modes, tx.modes, "ADJ_???");
|
||||
tprintf(", offset=%ld, freq=%ld, maxerror=%ld, ",
|
||||
tx.offset, tx.freq, tx.maxerror);
|
||||
@ -643,7 +643,7 @@ tprint_timex(struct tcb *tcp, long addr)
|
||||
tprintf(", calcnt=%ld, errcnt=%ld, stbcnt=%ld",
|
||||
tx.calcnt, tx.errcnt, tx.stbcnt);
|
||||
#endif
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -652,11 +652,11 @@ sys_adjtimex(struct tcb *tcp)
|
||||
{
|
||||
if (exiting(tcp)) {
|
||||
if (tcp->u_arg[0] == 0)
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
else if (syserror(tcp) || !verbose(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[0]);
|
||||
else if (tprint_timex(tcp, tcp->u_arg[0]) < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
if (syserror(tcp))
|
||||
return 0;
|
||||
tcp->auxstr = xlookup(adjtimex_state, tcp->u_rval);
|
||||
@ -701,7 +701,7 @@ sys_clock_settime(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printxval(clocknames, tcp->u_arg[0], "CLOCK_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printtv(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
return 0;
|
||||
@ -712,7 +712,7 @@ sys_clock_gettime(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printxval(clocknames, tcp->u_arg[0], "CLOCK_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[1]);
|
||||
@ -727,11 +727,11 @@ sys_clock_nanosleep(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printxval(clocknames, tcp->u_arg[0], "CLOCK_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(clockflags, tcp->u_arg[1], "TIMER_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printtv(tcp, tcp->u_arg[2]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[3]);
|
||||
@ -770,7 +770,7 @@ printsigevent32(struct tcb *tcp, long arg)
|
||||
} sev;
|
||||
|
||||
if (umove(tcp, arg, &sev) < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
else {
|
||||
tprintf("{%#x, ", sev.sigev_value);
|
||||
if (sev.sigev_notify == SIGEV_SIGNAL)
|
||||
@ -778,7 +778,7 @@ printsigevent32(struct tcb *tcp, long arg)
|
||||
else
|
||||
tprintf("%u, ", sev.sigev_signo);
|
||||
printxval(sigev_value, sev.sigev_notify + 1, "SIGEV_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (sev.sigev_notify == SIGEV_THREAD_ID)
|
||||
tprintf("{%d}", sev.un.tid);
|
||||
else if (sev.sigev_notify == SIGEV_THREAD)
|
||||
@ -786,8 +786,8 @@ printsigevent32(struct tcb *tcp, long arg)
|
||||
sev.un.thread.function,
|
||||
sev.un.thread.attribute);
|
||||
else
|
||||
tprintf("{...}");
|
||||
tprintf("}");
|
||||
tprints("{...}");
|
||||
tprints("}");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -804,7 +804,7 @@ printsigevent(struct tcb *tcp, long arg)
|
||||
}
|
||||
#endif
|
||||
if (umove(tcp, arg, &sev) < 0)
|
||||
tprintf("{...}");
|
||||
tprints("{...}");
|
||||
else {
|
||||
tprintf("{%p, ", sev.sigev_value.sival_ptr);
|
||||
if (sev.sigev_notify == SIGEV_SIGNAL)
|
||||
@ -812,7 +812,7 @@ printsigevent(struct tcb *tcp, long arg)
|
||||
else
|
||||
tprintf("%u, ", sev.sigev_signo);
|
||||
printxval(sigev_value, sev.sigev_notify+1, "SIGEV_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
if (sev.sigev_notify == SIGEV_THREAD_ID)
|
||||
/* _pad[0] is the _tid field which might not be
|
||||
present in the userlevel definition of the
|
||||
@ -822,8 +822,8 @@ printsigevent(struct tcb *tcp, long arg)
|
||||
tprintf("{%p, %p}", sev.sigev_notify_function,
|
||||
sev.sigev_notify_attributes);
|
||||
else
|
||||
tprintf("{...}");
|
||||
tprintf("}");
|
||||
tprints("{...}");
|
||||
tprints("}");
|
||||
}
|
||||
}
|
||||
|
||||
@ -832,9 +832,9 @@ sys_timer_create(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printxval(clocknames, tcp->u_arg[0], "CLOCK_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printsigevent(tcp, tcp->u_arg[1]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
int timer_id;
|
||||
|
||||
@ -852,9 +852,9 @@ sys_timer_settime(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
tprintf("%#lx, ", tcp->u_arg[0]);
|
||||
printflags(clockflags, tcp->u_arg[1], "TIMER_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printitv(tcp, tcp->u_arg[2]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
} else {
|
||||
if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[3]);
|
||||
@ -889,7 +889,7 @@ print_rtc(struct tcb *tcp, const struct rtc_time *rt)
|
||||
tprintf("tm_wday=%d, tm_yday=%d, tm_isdst=%d}",
|
||||
rt->tm_wday, rt->tm_yday, rt->tm_isdst);
|
||||
else
|
||||
tprintf("...}");
|
||||
tprints("...}");
|
||||
}
|
||||
|
||||
int
|
||||
@ -903,7 +903,7 @@ rtc_ioctl(struct tcb *tcp, long code, long arg)
|
||||
if (umove(tcp, arg, &rt) < 0)
|
||||
tprintf(", %#lx", arg);
|
||||
else {
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
print_rtc(tcp, &rt);
|
||||
}
|
||||
}
|
||||
@ -915,7 +915,7 @@ rtc_ioctl(struct tcb *tcp, long code, long arg)
|
||||
if (syserror(tcp) || umove(tcp, arg, &rt) < 0)
|
||||
tprintf(", %#lx", arg);
|
||||
else {
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
print_rtc(tcp, &rt);
|
||||
}
|
||||
}
|
||||
@ -939,7 +939,7 @@ rtc_ioctl(struct tcb *tcp, long code, long arg)
|
||||
tprintf(", {enabled=%d, pending=%d, ",
|
||||
wk.enabled, wk.pending);
|
||||
print_rtc(tcp, &wk.time);
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -952,7 +952,7 @@ rtc_ioctl(struct tcb *tcp, long code, long arg)
|
||||
tprintf(", {enabled=%d, pending=%d, ",
|
||||
wk.enabled, wk.pending);
|
||||
print_rtc(tcp, &wk.time);
|
||||
tprintf("}");
|
||||
tprints("}");
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -980,9 +980,9 @@ sys_timerfd(struct tcb *tcp)
|
||||
/* It does not matter that the kernel uses itimerspec. */
|
||||
tprintf("%ld, ", tcp->u_arg[0]);
|
||||
printxval(clocknames, tcp->u_arg[1], "CLOCK_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(timerfdflags, tcp->u_arg[2], "TFD_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printitv(tcp, tcp->u_arg[3]);
|
||||
}
|
||||
return 0;
|
||||
@ -993,7 +993,7 @@ sys_timerfd_create(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printxval(clocknames, tcp->u_arg[0], "CLOCK_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(timerfdflags, tcp->u_arg[1], "TFD_???");
|
||||
}
|
||||
return 0;
|
||||
@ -1004,11 +1004,11 @@ sys_timerfd_settime(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printflags(timerfdflags, tcp->u_arg[1], "TFD_???");
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printitv(tcp, tcp->u_arg[2]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printitv(tcp, tcp->u_arg[3]);
|
||||
}
|
||||
return 0;
|
||||
@ -1019,7 +1019,7 @@ sys_timerfd_gettime(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprintf(", ");
|
||||
tprints(", ");
|
||||
printitv(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
return 0;
|
||||
|
32
util.c
32
util.c
@ -366,7 +366,7 @@ printflags(const struct xlat *xlat, int flags, const char *dflt)
|
||||
tprintf(" /* %s */", dflt);
|
||||
} else {
|
||||
if (dflt)
|
||||
tprintf("0");
|
||||
tprints("0");
|
||||
}
|
||||
}
|
||||
|
||||
@ -379,16 +379,16 @@ printnum(struct tcb *tcp, long addr, const char *fmt)
|
||||
long num;
|
||||
|
||||
if (!addr) {
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
return;
|
||||
}
|
||||
if (umove(tcp, addr, &num) < 0) {
|
||||
tprintf("%#lx", addr);
|
||||
return;
|
||||
}
|
||||
tprintf("[");
|
||||
tprints("[");
|
||||
tprintf(fmt, num);
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
}
|
||||
|
||||
void
|
||||
@ -397,16 +397,16 @@ printnum_int(struct tcb *tcp, long addr, const char *fmt)
|
||||
int num;
|
||||
|
||||
if (!addr) {
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
return;
|
||||
}
|
||||
if (umove(tcp, addr, &num) < 0) {
|
||||
tprintf("%#lx", addr);
|
||||
return;
|
||||
}
|
||||
tprintf("[");
|
||||
tprints("[");
|
||||
tprintf(fmt, num);
|
||||
tprintf("]");
|
||||
tprints("]");
|
||||
}
|
||||
|
||||
void
|
||||
@ -566,7 +566,7 @@ void
|
||||
printpathn(struct tcb *tcp, long addr, int n)
|
||||
{
|
||||
if (!addr) {
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -614,7 +614,7 @@ printstr(struct tcb *tcp, long addr, int len)
|
||||
const char *fmt;
|
||||
|
||||
if (!addr) {
|
||||
tprintf("NULL");
|
||||
tprints("NULL");
|
||||
return;
|
||||
}
|
||||
/* Allocate static buffers if they are not allocated yet. */
|
||||
@ -1124,7 +1124,7 @@ printcall(struct tcb *tcp)
|
||||
long pc;
|
||||
|
||||
if (upeek(tcp, 4*PT_PC, &pc) < 0) {
|
||||
tprintf("[????????] ");
|
||||
tprints("[????????] ");
|
||||
return;
|
||||
}
|
||||
tprintf("[%08lx] ", pc);
|
||||
@ -1132,7 +1132,7 @@ printcall(struct tcb *tcp)
|
||||
long pc;
|
||||
|
||||
if (upeek(tcp, REG_PC, &pc) < 0) {
|
||||
tprintf("[????????????????] ");
|
||||
tprints("[????????????????] ");
|
||||
return;
|
||||
}
|
||||
tprintf("[%08lx] ", pc);
|
||||
@ -1151,7 +1151,7 @@ printcall(struct tcb *tcp)
|
||||
long pc;
|
||||
|
||||
if (upeek(tcp, PT_IAOQ0, &pc) < 0) {
|
||||
tprintf("[????????] ");
|
||||
tprints("[????????] ");
|
||||
return;
|
||||
}
|
||||
tprintf("[%08lx] ", pc);
|
||||
@ -1159,7 +1159,7 @@ printcall(struct tcb *tcp)
|
||||
long pc;
|
||||
|
||||
if (upeek(tcp, REG_EPC, &pc) < 0) {
|
||||
tprintf("[????????] ");
|
||||
tprints("[????????] ");
|
||||
return;
|
||||
}
|
||||
tprintf("[%08lx] ", pc);
|
||||
@ -1167,7 +1167,7 @@ printcall(struct tcb *tcp)
|
||||
long pc;
|
||||
|
||||
if (upeek(tcp, 4*REG_PC, &pc) < 0) {
|
||||
tprintf("[????????] ");
|
||||
tprints("[????????] ");
|
||||
return;
|
||||
}
|
||||
tprintf("[%08lx] ", pc);
|
||||
@ -1175,7 +1175,7 @@ printcall(struct tcb *tcp)
|
||||
long pc;
|
||||
|
||||
if (upeek(tcp, REG_PC, &pc) < 0) {
|
||||
tprintf("[????????????????] ");
|
||||
tprints("[????????????????] ");
|
||||
return;
|
||||
}
|
||||
tprintf("[%08lx] ", pc);
|
||||
@ -1191,7 +1191,7 @@ printcall(struct tcb *tcp)
|
||||
long pc;
|
||||
|
||||
if (upeek(tcp, REG_PC, &pc) < 0) {
|
||||
tprintf("[????????] ");
|
||||
tprints("[????????] ");
|
||||
return;
|
||||
}
|
||||
tprintf("[%08lx] ", pc);
|
||||
|
Loading…
Reference in New Issue
Block a user