From: Baruch Siach Date: Wed, 22 Jan 2014 12:18:29 +0000 (+0000) Subject: gdb: xtensa: fix linux ptrace includes X-Git-Tag: gdb-7.7-release~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8f0e6a87293d9ab36aa9cfc22a9952a36a0191ec;p=thirdparty%2Fbinutils-gdb.git gdb: xtensa: fix linux ptrace includes Currently, xtensa code using the Linux ptrace interface only include sys/ptrace.h. This file comes from the C library (glibc and uClibc, at least), and includes a declaration of the ptrace() functions, along with some cross architecture constants that are mostly copied from the file located at include/uapi/linux/ptrace.h in recent Linux kernels. For xtensa specific constants like PTRACE_GETXTREGS and PTRACE_SETXTREGS the asm/ptrace.h include from the Linux kernel UAPI is needed. The code in gdbserver xtensa specific part doesn't call ptrace() directly, so we can remove the unneeded sys/ptrace.h include. The gdb xtensa specific code needs both headers, since it calls ptrace(). gdb/ * xtensa-linux-nat.c: Include asm/ptrace.h. gdb/gdbserver/ * linux-xtensa-low.c: Include asm/ptrace.h instead of sys/ptrace.h. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 010f2922e07..d1274d1b1b2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2014-01-22 Baruch Siach + + * xtensa-linux-nat.c: Include asm/ptrace.h. + 2014-01-21 Roland McGrath * configure.ac: Call AM_PROG_INSTALL_STRIP. diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 27f182db180..102d27000d1 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2014-01-22 Baruch Siach + + * linux-xtensa-low.c: Include asm/ptrace.h instead of + sys/ptrace.h. + 2014-01-13 Eli Zaretskii * Makefile.in (INCLUDE_CFLAGS): Remove trailing slash from diff --git a/gdb/gdbserver/linux-xtensa-low.c b/gdb/gdbserver/linux-xtensa-low.c index 7db97a9cc54..479b65b26b0 100644 --- a/gdb/gdbserver/linux-xtensa-low.c +++ b/gdb/gdbserver/linux-xtensa-low.c @@ -24,7 +24,7 @@ void init_registers_xtensa (void); extern const struct target_desc *tdesc_xtensa; -#include +#include #include #include "xtensa-xtregs.c" diff --git a/gdb/xtensa-linux-nat.c b/gdb/xtensa-linux-nat.c index 2372e792f3f..9340c62fe85 100644 --- a/gdb/xtensa-linux-nat.c +++ b/gdb/xtensa-linux-nat.c @@ -36,6 +36,7 @@ #include #include #include +#include #include "gregset.h" #include "xtensa-tdep.h"