diff options
author | Dmitry V. Levin <ldv@strace.io> | 2021-04-16 08:00:00 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2021-04-16 08:00:00 +0000 |
commit | cefcf50ba87ba894ad7737f483f3fad7fc0fd4f2 (patch) | |
tree | 1d1a8eaf2644182992b19ce976fff2e139c66639 | |
parent | 473f0dec82c33f4d0761ede1244c957106765add (diff) | |
download | strace-cefcf50ba87ba894ad7737f483f3fad7fc0fd4f2.tar.gz |
ipc_semctl: use print_fields.h helpers
* src/ipc_semctl.c (print_semid_ds, print_seminfo, SYS_FUNC(semctl)):
Use tprint_indirect_begin, tprint_indirect_end, tprint_arg_next, and
PRINT_VAL_D.
-rw-r--r-- | src/ipc_semctl.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/ipc_semctl.c b/src/ipc_semctl.c index 6f398f70e..0965b41d5 100644 --- a/src/ipc_semctl.c +++ b/src/ipc_semctl.c @@ -58,10 +58,10 @@ print_semid_ds(struct tcb *const tcp, const kernel_ulong_t addr, if (!tfetch_mem(tcp, addr, sizeof(ds), &ds)) { if (indirect_addr) - tprints("["); + tprint_indirect_begin(); printaddr(addr); if (indirect_addr) - tprints("]"); + tprint_indirect_end(); return; } @@ -88,10 +88,10 @@ print_seminfo(struct tcb *const tcp, const kernel_ulong_t addr, return; if (!tfetch_mem(tcp, addr, sizeof(info), &info)) { if (indirect_addr) - tprints("["); + tprint_indirect_begin(); printaddr(addr); if (indirect_addr) - tprints("]"); + tprint_indirect_end(); return; } @@ -133,9 +133,17 @@ SYS_FUNC(semctl) cmd &= ~IPC_64; if (entering(tcp)) { - tprintf("%d, %d, ", (int) tcp->u_arg[0], (int) tcp->u_arg[1]); + /* semid */ + PRINT_VAL_D((int) tcp->u_arg[0]); + tprint_arg_next(); + + /* semnum */ + PRINT_VAL_D((int) tcp->u_arg[1]); + tprint_arg_next(); + + /* cmd */ PRINTCTL(semctl_flags, tcp->u_arg[2], "SEM_???"); - tprints(", "); + tprint_arg_next(); if (indirect_addr) { semun_ptr_t ptr; @@ -161,10 +169,10 @@ SYS_FUNC(semctl) default: if (indirect_addr) - tprints("["); + tprint_indirect_begin(); printaddr(addr); if (indirect_addr) - tprints("]"); + tprint_indirect_end(); return RVAL_DECODED; } } else { |