]> granicus.if.org Git - strace/commitdiff
ucopy: enhance vm_read_mem error diagnostics
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 30 Jul 2017 23:28:12 +0000 (23:28 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 30 Jul 2017 23:28:12 +0000 (23:28 +0000)
* ucopy.c (umoven, umovestr): Enhance vm_read_mem error diagnostics
to match PTRACE_PEEKDATA case.

ucopy.c

diff --git a/ucopy.c b/ucopy.c
index 52cbfebd8f7283b69bcc508177e06cc1e4aa704c..cd16e8eb13619540b240f02d385d78b78f059158 100644 (file)
--- a/ucopy.c
+++ b/ucopy.c
@@ -120,6 +120,7 @@ umoven(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len,
                }
                switch (errno) {
                        case ENOSYS:
+                               /* never try it again */
                                process_vm_readv_not_supported = 1;
                                break;
                        case EPERM:
@@ -133,7 +134,8 @@ umoven(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len,
                                return -1;
                        default:
                                /* all the rest is strange and should be reported */
-                               perror_msg("process_vm_readv");
+                               perror_msg("process_vm_readv: pid:%d @0x%" PRI_klx,
+                                           pid, addr);
                                return -1;
                }
        }
@@ -263,6 +265,7 @@ umovestr(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len, char *lad
                        }
                        switch (errno) {
                                case ENOSYS:
+                                       /* never try it again */
                                        process_vm_readv_not_supported = 1;
                                        goto vm_readv_didnt_work;
                                case ESRCH:
@@ -282,7 +285,8 @@ umovestr(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len, char *lad
                                        return -1;
                                default:
                                        /* all the rest is strange and should be reported */
-                                       perror_msg("process_vm_readv");
+                                       perror_msg("process_vm_readv: pid:%d @0x%" PRI_klx,
+                                                   pid, addr);
                                        return -1;
                        }
                }