printnum_ ## name(struct tcb *tcp, const long addr, const char *fmt) \
{ \
type num; \
- if (!addr) \
- tprints("NULL"); \
- else if (umove(tcp, addr, &num) < 0) \
- tprintf("%#lx", addr); \
- else { \
+ if (!umove_or_printaddr(tcp, addr, &num)) { \
tprints("["); \
tprintf(fmt, num); \
tprints("]"); \
} \
}
+#define DEF_PRINTPAIR(name, type) \
+void \
+printpair_ ## name(struct tcb *tcp, const long addr, const char *fmt) \
+{ \
+ type pair[2]; \
+ if (!umove_or_printaddr(tcp, addr, &pair)) { \
+ tprints("["); \
+ tprintf(fmt, pair[0]); \
+ tprints(", "); \
+ tprintf(fmt, pair[1]); \
+ tprints("]"); \
+ } \
+}
+
DEF_PRINTNUM(long, long)
+DEF_PRINTPAIR(long, long)
DEF_PRINTNUM(int, int)
+DEF_PRINTPAIR(int, int)
DEF_PRINTNUM(short, short)
#if SIZEOF_LONG != 8
DEF_PRINTNUM(int64, uint64_t)
+DEF_PRINTPAIR(int64, uint64_t)
#endif
const char *
tprints("NULL");
return -1;
}
- if ((exiting(tcp) && syserror(tcp)) ||
+ if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) ||
umoven(tcp, addr, len, our_addr) < 0) {
tprintf("%#lx", addr);
return -1;