]> granicus.if.org Git - strace/commitdiff
umove*: change tracee address argument type from long to kernel_ureg_t
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 20 Dec 2016 21:23:39 +0000 (21:23 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 25 Dec 2016 11:32:43 +0000 (11:32 +0000)
* defs.h (umovestr, umoven, umoven_or_printaddr,
umoven_or_printaddr_ignore_syserror): Change tracee address argument
type from long to kernel_ureg_t.
(print_array): Change the type of tracee address argument of umoven_func
from long to kernel_ureg_t.
* util.c (vm_read_mem, umovestr, umoven, umoven_or_printaddr,
umoven_or_printaddr_ignore_syserror): Change tracee address argument
type from long to kernel_ureg_t.
(print_array): Change the type of tracee address argument of umoven_func
from long to kernel_ureg_t.
* desc.c (umove_kulong_array_or_printaddr): Change tracee address
argument type from long to kernel_ureg_t.
* mmsghdr.c (fetch_struct_mmsghdr_or_printaddr): Likewise.

defs.h
desc.c
mmsghdr.c
util.c

diff --git a/defs.h b/defs.h
index 0a4c616fc490b1733382630cde9dbfb57fd72813..ea14b007b0b49e61a6a4615b0c01265924ed1feb 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -493,16 +493,24 @@ static inline int set_tcb_priv_ulong(struct tcb *tcp, unsigned long val)
        return set_tcb_priv_data(tcp, (void *) val, 0);
 }
 
-extern int umoven(struct tcb *, long, unsigned int, void *);
+extern int
+umoven(struct tcb *tcp, kernel_ureg_t addr, unsigned int len, void *laddr);
 #define umove(pid, addr, objp) \
        umoven((pid), (addr), sizeof(*(objp)), (void *) (objp))
-extern int umoven_or_printaddr(struct tcb *, long, unsigned int, void *);
+
+extern int
+umoven_or_printaddr(struct tcb *tcp, kernel_ureg_t addr,
+                   unsigned int len, void *laddr);
 #define umove_or_printaddr(pid, addr, objp)    \
        umoven_or_printaddr((pid), (addr), sizeof(*(objp)), (void *) (objp))
+
 extern int
-umoven_or_printaddr_ignore_syserror(struct tcb *tcp, const long addr,
-                                   const unsigned int len, void *our_addr);
-extern int umovestr(struct tcb *, long, unsigned int, char *);
+umoven_or_printaddr_ignore_syserror(struct tcb *tcp, kernel_ureg_t addr,
+                                   unsigned int len, void *laddr);
+
+extern int
+umovestr(struct tcb *tcp, kernel_ureg_t addr, unsigned int len, char *laddr);
+
 extern int upeek(int pid, long, long *);
 extern int upoke(int pid, long, long);
 
@@ -513,7 +521,7 @@ print_array(struct tcb *tcp,
            void *elem_buf,
            size_t elem_size,
            int (*umoven_func)(struct tcb *,
-                                    long,
+                                    kernel_ureg_t,
                                     unsigned int,
                                     void *),
            bool (*print_func)(struct tcb *,
diff --git a/desc.c b/desc.c
index ebf5b7e47729eb3d03de70f863b4c887aa2ff2e0..5b8b7dfd43b1705e4b29c7d051fb92f15a1cf80c 100644 (file)
--- a/desc.c
+++ b/desc.c
@@ -227,8 +227,8 @@ SYS_FUNC(select)
 }
 
 static int
-umove_kulong_array_or_printaddr(struct tcb *tcp, const long addr,
-                               kernel_ulong_t *ptr, size_t n)
+umove_kulong_array_or_printaddr(struct tcb *const tcp, const kernel_ureg_t addr,
+                               kernel_ulong_t *const ptr, const size_t n)
 {
 #ifndef current_klongsize
        if (current_klongsize < sizeof(*ptr)) {
index 5ab3e0b81944267a2ba0b5d47609d1d678c414cc..6b02774a15119f7054aa77e21267ade4b218a88d 100644 (file)
--- a/mmsghdr.c
+++ b/mmsghdr.c
@@ -33,7 +33,8 @@
 #include <limits.h>
 
 static int
-fetch_struct_mmsghdr_or_printaddr(struct tcb *tcp, const long addr,
+fetch_struct_mmsghdr_or_printaddr(struct tcb *const tcp,
+                                 const kernel_ureg_t addr,
                                  const unsigned int len, void *const mh)
 {
        if ((entering(tcp) || !syserror(tcp))
diff --git a/util.c b/util.c
index ff65e8adf3d7d7b796a08346815f347ec869907b..02bb3bc1fcee31c13895f498919dc94a76ee47d8 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1082,7 +1082,8 @@ static bool process_vm_readv_not_supported = 1;
 #endif /* end of hack */
 
 static ssize_t
-vm_read_mem(pid_t pid, void *laddr, long raddr, size_t len)
+vm_read_mem(const pid_t pid, void *const laddr,
+           const kernel_ureg_t raddr, const size_t len)
 {
        const struct iovec local = {
                .iov_base = laddr,
@@ -1101,7 +1102,8 @@ vm_read_mem(pid_t pid, void *laddr, long raddr, size_t len)
  * at address `addr' to our space at `our_addr'
  */
 int
-umoven(struct tcb *tcp, long addr, unsigned int len, void *our_addr)
+umoven(struct tcb *const tcp, kernel_ureg_t addr, unsigned int len,
+       void *const our_addr)
 {
        char *laddr = our_addr;
        int pid = tcp->pid;
@@ -1208,8 +1210,8 @@ umoven(struct tcb *tcp, long addr, unsigned int len, void *our_addr)
 }
 
 int
-umoven_or_printaddr(struct tcb *tcp, const long addr, const unsigned int len,
-                   void *our_addr)
+umoven_or_printaddr(struct tcb *const tcp, const kernel_ureg_t addr,
+                   const unsigned int len, void *const our_addr)
 {
        if (!addr || !verbose(tcp) || (exiting(tcp) && syserror(tcp)) ||
            umoven(tcp, addr, len, our_addr) < 0) {
@@ -1220,8 +1222,10 @@ umoven_or_printaddr(struct tcb *tcp, const long addr, const unsigned int len,
 }
 
 int
-umoven_or_printaddr_ignore_syserror(struct tcb *tcp, const long addr,
-                                   const unsigned int len, void *our_addr)
+umoven_or_printaddr_ignore_syserror(struct tcb *const tcp,
+                                   const kernel_ureg_t addr,
+                                   const unsigned int len,
+                                   void *const our_addr)
 {
        if (!addr || !verbose(tcp) || umoven(tcp, addr, len, our_addr) < 0) {
                printaddr(addr);
@@ -1243,7 +1247,7 @@ umoven_or_printaddr_ignore_syserror(struct tcb *tcp, const long addr,
  * we never write past laddr[len-1]).
  */
 int
-umovestr(struct tcb *tcp, long addr, unsigned int len, char *laddr)
+umovestr(struct tcb *const tcp, kernel_ureg_t addr, unsigned int len, char *laddr)
 {
        const unsigned long x01010101 = (unsigned long) 0x0101010101010101ULL;
        const unsigned long x80808080 = (unsigned long) 0x8080808080808080ULL;
@@ -1426,7 +1430,7 @@ print_array(struct tcb *const tcp,
            void *const elem_buf,
            const size_t elem_size,
            int (*const umoven_func)(struct tcb *,
-                                    long,
+                                    kernel_ureg_t,
                                     unsigned int,
                                     void *),
            bool (*const print_func)(struct tcb *,