}
MPERS_PRINTER_DECL(void, print_timeval,
- struct tcb *tcp, const long addr)
+ struct tcb *const tcp, const kernel_ureg_t addr)
{
timeval_t t;
print_timeval_t(&t);
}
-MPERS_PRINTER_DECL(void, print_timeval_pair,
- struct tcb *tcp, const long addr)
+static bool
+print_timeval_item(struct tcb *tcp, void *elem_buf, size_t size, void *data)
{
- timeval_t t[2];
+ timeval_t *t = elem_buf;
- if (umove_or_printaddr(tcp, addr, &t))
- return;
+ print_timeval_t(t);
- tprints("[");
- print_timeval_t(&t[0]);
- tprints(", ");
- print_timeval_t(&t[1]);
- tprints("]");
+ return true;
+}
+
+MPERS_PRINTER_DECL(void, print_timeval_pair,
+ struct tcb *const tcp, const kernel_ureg_t addr)
+{
+ timeval_t t;
+
+ print_array(tcp, addr, 2, &t, sizeof(t), umoven_or_printaddr,
+ print_timeval_item, NULL);
}
MPERS_PRINTER_DECL(const char *, sprint_timeval,
- struct tcb *tcp, const long addr)
+ struct tcb *const tcp, const kernel_ureg_t addr)
{
timeval_t t;
static char buf[sizeof(timeval_fmt) + 3 * sizeof(t)];
strcpy(buf, "NULL");
} else if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) ||
umove(tcp, addr, &t)) {
- snprintf(buf, sizeof(buf), "%#lx", addr);
+ snprintf(buf, sizeof(buf), "%#" PRI_krx, addr);
} else {
snprintf(buf, sizeof(buf), timeval_fmt,
(intmax_t) t.tv_sec, (intmax_t) t.tv_usec);
}
MPERS_PRINTER_DECL(void, print_itimerval,
- struct tcb *tcp, const long addr)
+ struct tcb *const tcp, const kernel_ureg_t addr)
{
timeval_t t[2];
}
void
-print_timeval32(struct tcb *tcp, const long addr)
+print_timeval32(struct tcb *const tcp, const kernel_ureg_t addr)
{
timeval32_t t;
}
void
-print_timeval32_pair(struct tcb *tcp, const long addr)
+print_timeval32_pair(struct tcb *const tcp, const kernel_ureg_t addr)
{
timeval32_t t[2];
}
void
-print_itimerval32(struct tcb *tcp, const long addr)
+print_itimerval32(struct tcb *const tcp, const kernel_ureg_t addr)
{
timeval32_t t[2];
}
const char *
-sprint_timeval32(struct tcb *tcp, const long addr)
+sprint_timeval32(struct tcb *const tcp, const kernel_ureg_t addr)
{
timeval32_t t;
static char buf[sizeof(timeval_fmt) + 3 * sizeof(t)];
strcpy(buf, "NULL");
} else if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) ||
umove(tcp, addr, &t)) {
- snprintf(buf, sizeof(buf), "%#lx", addr);
+ snprintf(buf, sizeof(buf), "%#" PRI_krx, addr);
} else {
snprintf(buf, sizeof(buf), timeval_fmt,
(intmax_t) t.tv_sec, (intmax_t) t.tv_usec);