This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Fix PR gdb/20413 - x32: linux_ptrace_test_ret_to_nx: Cannot PTRACE_PEEKUSER
- From: sergiodj+buildbot at sergiodj dot net
- To: gdb-testers at sourceware dot org
- Date: Tue, 26 Jul 2016 16:19:14 -0400
- Subject: [binutils-gdb] Fix PR gdb/20413 - x32: linux_ptrace_test_ret_to_nx: Cannot PTRACE_PEEKUSER
- Authentication-results: sourceware.org; auth=none
*** TEST RESULTS FOR COMMIT 40c31709c6a51926fcb409611caa52b2da6515c0 ***
Author: Pedro Alves <palves@redhat.com>
Branch: master
Commit: 40c31709c6a51926fcb409611caa52b2da6515c0
Fix PR gdb/20413 - x32: linux_ptrace_test_ret_to_nx: Cannot PTRACE_PEEKUSER
An x32 gdb always issues this warning:
(gdb) start
Temporary breakpoint 1 at 0x4043e9: file foo.c, line 25.
Starting program: a.out
warning: linux_ptrace_test_ret_to_nx: Cannot PTRACE_PEEKUSER: Input/output error
Temporary breakpoint 1, main (argc=1, argv=0xffffd544) at foo.c:25
25 {
(gdb)
As described in Linux commit 55283e253771 (x32: Add ptrace for x32):
[...] PTRACE_PEEKUSR and PTRACE_POKEUSR are only allowed to access
segment and debug registers. [...]
The fix is to use PTRACE_GETREGS instead.
gdb/ChangeLog:
2016-07-26 Pedro Alves <palves@redhat.com>
* nat/linux-ptrace.c: Include "gregset.h".
(linux_ptrace_test_ret_to_nx): Use PTRACE_GETREGS instead of
PTRACE_PEEKUSER.