From bf20786de2b62645c233edeb10ba729b9a46374f Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Tue, 20 Dec 2016 22:33:52 +0000 Subject: [PATCH] printnum_*, printpair_*: change address argument type from long to kernel_ureg_t * defs.h (DECL_PRINTNUM, DECL_PRINTPAIR, printnum_long_int): Change address argument type from long to kernel_ureg_t. * util.c (DEF_PRINTNUM, DEF_PRINTPAIR, printnum_long_int): Likewise. --- defs.h | 8 +++++--- util.c | 10 ++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/defs.h b/defs.h index 8c4165ca..0412ed4c 100644 --- a/defs.h +++ b/defs.h @@ -610,7 +610,7 @@ printstr_ex(struct tcb *, kernel_ureg_t addr, long len, #define DECL_PRINTNUM(name) \ extern bool \ -printnum_ ## name(struct tcb *, long addr, const char *fmt) \ +printnum_ ## name(struct tcb *, kernel_ureg_t addr, const char *fmt) \ ATTRIBUTE_FORMAT((printf, 3, 0)) DECL_PRINTNUM(short); DECL_PRINTNUM(int); @@ -618,7 +618,9 @@ DECL_PRINTNUM(int64); #undef DECL_PRINTNUM #if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4 -extern bool printnum_long_int(struct tcb *, long, const char *, const char *) +extern bool +printnum_long_int(struct tcb *, kernel_ureg_t addr, + const char *fmt_long, const char *fmt_int) ATTRIBUTE_FORMAT((printf, 3, 0)) ATTRIBUTE_FORMAT((printf, 4, 0)); # define printnum_slong(tcp, addr) \ @@ -645,7 +647,7 @@ extern bool printnum_long_int(struct tcb *, long, const char *, const char *) #define DECL_PRINTPAIR(name) \ extern bool \ -printpair_ ## name(struct tcb *, long addr, const char *fmt) \ +printpair_ ## name(struct tcb *, kernel_ureg_t addr, const char *fmt) \ ATTRIBUTE_FORMAT((printf, 3, 0)) DECL_PRINTPAIR(int); DECL_PRINTPAIR(int64); diff --git a/util.c b/util.c index 71bb6509..245ffca3 100644 --- a/util.c +++ b/util.c @@ -472,7 +472,8 @@ printaddr_klu(const kernel_ulong_t addr) #define DEF_PRINTNUM(name, type) \ bool \ -printnum_ ## name(struct tcb *tcp, const long addr, const char *fmt) \ +printnum_ ## name(struct tcb *const tcp, const kernel_ureg_t addr, \ + const char *const fmt) \ { \ type num; \ if (umove_or_printaddr(tcp, addr, &num)) \ @@ -485,7 +486,8 @@ printnum_ ## name(struct tcb *tcp, const long addr, const char *fmt) \ #define DEF_PRINTPAIR(name, type) \ bool \ -printpair_ ## name(struct tcb *tcp, const long addr, const char *fmt) \ +printpair_ ## name(struct tcb *const tcp, const kernel_ureg_t addr, \ + const char *const fmt) \ { \ type pair[2]; \ if (umove_or_printaddr(tcp, addr, &pair)) \ @@ -506,8 +508,8 @@ DEF_PRINTPAIR(int64, uint64_t) #if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4 bool -printnum_long_int(struct tcb *tcp, const long addr, - const char *fmt_long, const char *fmt_int) +printnum_long_int(struct tcb *const tcp, const kernel_ureg_t addr, + const char *const fmt_long, const char *const fmt_int) { if (current_wordsize > sizeof(int)) { return printnum_int64(tcp, addr, fmt_long); -- 2.40.0