Commit 8f6800db authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Andrei Vagin

x86/ptrace: describe failures from errno

ptrace_get_regs correctly returns error code in case of failure,
but for debugging reasons let's add error printing in case of
PTRACE_GETREGSET failed right after the call to ptrace().
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent cd073d3e
...@@ -360,6 +360,11 @@ int ptrace_get_regs(pid_t pid, user_regs_struct_t *regs) ...@@ -360,6 +360,11 @@ int ptrace_get_regs(pid_t pid, user_regs_struct_t *regs)
iov.iov_len = sizeof(user_regs_struct64); iov.iov_len = sizeof(user_regs_struct64);
ret = ptrace(PTRACE_GETREGSET, pid, NT_PRSTATUS, &iov); ret = ptrace(PTRACE_GETREGSET, pid, NT_PRSTATUS, &iov);
if (ret == -1) {
pr_perror("PTRACE_GETREGSET failed");
return -1;
}
if (iov.iov_len == sizeof(regs->native)) { if (iov.iov_len == sizeof(regs->native)) {
regs->__is_native = NATIVE_MAGIC; regs->__is_native = NATIVE_MAGIC;
return ret; return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment