From: Dmitry V. Levin Date: Sun, 30 Jul 2017 23:28:12 +0000 (+0000) Subject: ucopy: enhance vm_read_mem error diagnostics X-Git-Tag: v4.19~197 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5f96feb9b7025dcc0def9024446329a3037ca5be;p=strace ucopy: enhance vm_read_mem error diagnostics * ucopy.c (umoven, umovestr): Enhance vm_read_mem error diagnostics to match PTRACE_PEEKDATA case. --- diff --git a/ucopy.c b/ucopy.c index 52cbfebd..cd16e8eb 100644 --- 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; } }