Print unfetchable address in poll and ppoll decoders

* poll.c (decode_poll_entering): Replace umove call with
umove_or_printaddr.
(decode_poll_exiting): Print unfetchable address when umove call fails.
This commit is contained in:
Дмитрий Левин 2016-02-16 00:04:37 +00:00
parent ddbede5d9c
commit 8ef9809b63

10
poll.c
View File

@ -82,10 +82,8 @@ decode_poll_entering(struct tcb *tcp)
tprints("...");
break;
}
if (umove(tcp, cur, &fds) < 0) {
tprints("???");
if (umove_or_printaddr(tcp, cur, &fds))
break;
}
print_pollfd(tcp, &fds);
}
@ -134,7 +132,7 @@ decode_poll_exiting(struct tcb *tcp, const long pts)
*outptr++ = '[';
else
outptr = stpcpy(outptr, ", ");
outptr = stpcpy(outptr, "???");
outptr += sprintf(outptr, "%#lx", cur);
break;
}
if (!fds.revents)
@ -154,8 +152,8 @@ decode_poll_exiting(struct tcb *tcp, const long pts)
const char *flagstr = sprintflags("", pollflags, fds.revents);
if (outptr + strlen(fdstr) + strlen(flagstr) + 1
>= end_outstr - sizeof(", ...], ...")) {
if (outptr + strlen(fdstr) + strlen(flagstr) + 1 >=
end_outstr - (2 + 2 * sizeof(long) + sizeof(", ], ..."))) {
outptr = stpcpy(outptr, "...");
break;
}