This check had been done by print_array inside tprint_iov anyway.

* process_vm.c (SYS_FUNC(process_vm_readv)): Use tprint_iov_upto for
printing local_iov; do not check for syserror, provide decode_iov
parameter to tprint_iov{,_upto} based on its value instead.
---
 process_vm.c |   17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/process_vm.c b/process_vm.c
index 3227036..0538f7d 100644
--- a/process_vm.c
+++ b/process_vm.c
@@ -39,21 +39,14 @@ SYS_FUNC(process_vm_readv)
                unsigned long long flags = getarg_ull(tcp, 5);
 
                /* arg 2: local iov */
-               if (syserror(tcp)) {
-                       printaddr(tcp->u_arg[1]);
-               } else {
-                       tprint_iov(tcp, local_iovcnt, tcp->u_arg[1],
-                                  IOV_DECODE_STR);
-               }
+               tprint_iov_upto(tcp, local_iovcnt, tcp->u_arg[1],
+                          syserror(tcp) ? IOV_DECODE_ADDR : IOV_DECODE_STR,
+                          tcp->u_rval);
                /* arg 3: local iovcnt */
                tprintf(", %llu, ", local_iovcnt);
                /* arg 4: remote iov */
-               if (syserror(tcp)) {
-                       printaddr(tcp->u_arg[3]);
-               } else {
-                       tprint_iov(tcp, remote_iovcnt, tcp->u_arg[3],
-                                  IOV_DECODE_ADDR);
-               }
+               tprint_iov(tcp, remote_iovcnt, tcp->u_arg[3],
+                          IOV_DECODE_ADDR);
                /* arg 5: remote iovcnt */
                /* arg 6: flags */
                tprintf(", %llu, %llu", remote_iovcnt, flags);
-- 
1.7.10.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to