Add argument to tprint_iov() specifying whether to decode each iovec
* defs.h (tprint_iov): Add decode_iov argument.
* io.c (tprint_iov): Implement new decode_iov argument.
(sys_readv, sys_writev, sys_sendfile, sys_preadv, sys_pwritev): Update
tprint_iov calls.
* net.c (do_msghdr): Likewise.
diff --git a/defs.h b/defs.h
index 2c08635..7ffc3f4 100644
--- a/defs.h
+++ b/defs.h
@@ -584,7 +584,7 @@
extern void printtrailer(void);
extern void tabto(int);
extern void call_summary(FILE *);
-extern void tprint_iov(struct tcb *, unsigned long, unsigned long);
+extern void tprint_iov(struct tcb *, unsigned long, unsigned long, int decode_iov);
extern void tprint_open_modes(mode_t);
extern const char *sprint_open_modes(mode_t);
extern int is_restart_error(struct tcb *);
diff --git a/io.c b/io.c
index d94fb26..7f2f243 100644
--- a/io.c
+++ b/io.c
@@ -76,7 +76,7 @@
#if HAVE_SYS_UIO_H
void
-tprint_iov(struct tcb *tcp, unsigned long len, unsigned long addr)
+tprint_iov(struct tcb *tcp, unsigned long len, unsigned long addr, int decode_iov)
{
#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
union {
@@ -132,7 +132,10 @@
break;
}
tprintf("{");
- printstr(tcp, (long) iov_iov_base, iov_iov_len);
+ 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("]");
@@ -155,7 +158,7 @@
tcp->u_arg[1], tcp->u_arg[2]);
return 0;
}
- tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1]);
+ tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
tprintf(", %lu", tcp->u_arg[2]);
}
return 0;
@@ -167,7 +170,7 @@
if (entering(tcp)) {
printfd(tcp, tcp->u_arg[0]);
tprintf(", ");
- tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1]);
+ tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
tprintf(", %lu", tcp->u_arg[2]);
}
return 0;
@@ -243,9 +246,9 @@
tprintf(", %#lx", tcp->u_arg[5]);
else {
tprintf(", { ");
- tprint_iov(tcp, hdtr.hdr_cnt, hdtr.headers);
+ tprint_iov(tcp, hdtr.hdr_cnt, hdtr.headers, 1);
tprintf(", %u, ", hdtr.hdr_cnt);
- tprint_iov(tcp, hdtr.trl_cnt, hdtr.trailers);
+ tprint_iov(tcp, hdtr.trl_cnt, hdtr.trailers, 1);
tprintf(", %u }", hdtr.hdr_cnt);
}
}
@@ -316,7 +319,7 @@
tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
return 0;
}
- tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1]);
+ tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
tprintf(", %lu, ", tcp->u_arg[2]);
printllval(tcp, "%llu", PREAD_OFFSET_ARG);
}
@@ -329,7 +332,7 @@
if (entering(tcp)) {
printfd(tcp, tcp->u_arg[0]);
tprintf(", ");
- tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1]);
+ tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
tprintf(", %lu, ", tcp->u_arg[2]);
printllval(tcp, "%llu", PREAD_OFFSET_ARG);
}
diff --git a/net.c b/net.c
index 0d8e22d..c9c1847 100644
--- a/net.c
+++ b/net.c
@@ -1409,7 +1409,7 @@
tprintf(", msg_iov(%lu)=", (unsigned long)msg->msg_iovlen);
tprint_iov(tcp, (unsigned long)msg->msg_iovlen,
- (unsigned long)msg->msg_iov);
+ (unsigned long)msg->msg_iov, 1);
#ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL
tprintf(", msg_controllen=%lu", (unsigned long)msg->msg_controllen);