case IOV_DECODE_STR:
if (len > c->data_size)
len = c->data_size;
- c->data_size -= len;
+ if (c->data_size != -1UL)
+ c->data_size -= len;
printstr(tcp, iov[0], len);
break;
case IOV_DECODE_NETLINK:
if (len > c->data_size)
len = c->data_size;
- c->data_size -= len;
+ if (c->data_size != -1UL)
+ c->data_size -= len;
decode_netlink(tcp, iov[0], iov[1]);
break;
default:
{ .decode_iov = decode_iov, .data_size = data_size };
print_array(tcp, addr, len, iov, current_wordsize * 2,
- umoven_or_printaddr, print_iovec, &config);
+ umoven_or_printaddr_ignore_syserror, print_iovec, &config);
}
void
tprint_iov(struct tcb *tcp, unsigned long len, unsigned long addr,
enum iov_decode decode_iov)
{
- tprint_iov_upto(tcp, len, addr, decode_iov, (unsigned long) -1L);
+ tprint_iov_upto(tcp, len, addr, decode_iov, -1UL);
}
SYS_FUNC(readv)
tprints(", ");
} else {
tprint_iov_upto(tcp, tcp->u_arg[2], tcp->u_arg[1],
+ syserror(tcp) ? IOV_DECODE_ADDR :
IOV_DECODE_STR, tcp->u_rval);
tprintf(", %lu", tcp->u_arg[2]);
}
return RVAL_DECODED;
}
-/* The SH4 ABI does allow long longs in odd-numbered registers, but
- does not allow them to be split between registers and memory - and
- there are only four argument registers for normal functions. As a
- result pread takes an extra padding argument before the offset. This
- was changed late in the 2.4 series (around 2.4.20). */
-#if defined(SH)
-#define PREAD_OFFSET_ARG 4
-#else
-#define PREAD_OFFSET_ARG 3
-#endif
-
SYS_FUNC(pread)
{
if (entering(tcp)) {
else
printstr(tcp, tcp->u_arg[1], tcp->u_rval);
tprintf(", %lu, ", tcp->u_arg[2]);
- printllval(tcp, "%lld", PREAD_OFFSET_ARG);
+ printllval(tcp, "%lld", 3);
}
return 0;
}
tprints(", ");
printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
tprintf(", %lu, ", tcp->u_arg[2]);
- printllval(tcp, "%lld", PREAD_OFFSET_ARG);
+ printllval(tcp, "%lld", 3);
return RVAL_DECODED;
}
tprintf("%ld", tcp->u_arg[arg]);
# if SUPPORTED_PERSONALITIES > 1
else
- tprintf("%ld",
- ((unsigned long) tcp->u_arg[arg + 1] << current_wordsize * 8)
- | (unsigned long) tcp->u_arg[arg]);
+ tprintf("%ld", (tcp->u_arg[arg + 1] << current_wordsize * 8)
+ | tcp->u_arg[arg]);
# endif
#elif SIZEOF_LONG > 4
# error Unsupported configuration: SIZEOF_LONG > 4 && SIZEOF_LONG_LONG > SIZEOF_LONG
# if SUPPORTED_PERSONALITIES > 1
if (current_personality == 1) {
tprintf("%lld",
- (widen_to_ull(tcp->u_arg[arg + 1]) << sizeof(long) * 8)
- | widen_to_ull(tcp->u_arg[arg]));
+ (zero_extend_signed_to_ull(tcp->u_arg[arg + 1]) << sizeof(long) * 8)
+ | zero_extend_signed_to_ull(tcp->u_arg[arg]));
} else
# endif
{
}
#else /* SIZEOF_LONG_LONG > SIZEOF_LONG && !HAVE_STRUCT_TCB_EXT_ARG */
tprintf("%lld",
- (widen_to_ull(tcp->u_arg[arg + 1]) << sizeof(long) * 8)
- | widen_to_ull(tcp->u_arg[arg]));
+ (zero_extend_signed_to_ull(tcp->u_arg[arg + 1]) << sizeof(long) * 8)
+ | zero_extend_signed_to_ull(tcp->u_arg[arg]));
#endif
}
printfd(tcp, tcp->u_arg[0]);
tprints(", ");
} else {
- tprint_iov_upto(tcp, tcp->u_arg[2], tcp->u_arg[1], IOV_DECODE_STR,
- tcp->u_rval);
+ tprint_iov_upto(tcp, tcp->u_arg[2], tcp->u_arg[1],
+ syserror(tcp) ? IOV_DECODE_ADDR :
+ IOV_DECODE_STR, tcp->u_rval);
tprintf(", %lu, ", tcp->u_arg[2]);
print_lld_from_low_high_val(tcp, 3);
if (flags_arg >= 0) {