From: Baruch Siach Date: Wed, 22 Jan 2014 12:22:26 +0000 (+0000) Subject: gdb: xtensa: fix linux ptrace includes X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ce1f8608d5debf47bf2312b937abdaab5e4dcc4e;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 6a2f95763bc..c29fa6fd8a4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2014-01-22 Baruch Siach + + * xtensa-linux-nat.c: Include asm/ptrace.h. + 2013-12-16 Pedro Alves PR 16329 diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 514bbcb68d2..7078404e7fe 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. + 2013-09-16 Will Newton * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Zero diff --git a/gdb/gdbserver/linux-xtensa-low.c b/gdb/gdbserver/linux-xtensa-low.c index d988a465bb1..194530e7c33 100644 --- a/gdb/gdbserver/linux-xtensa-low.c +++ b/gdb/gdbserver/linux-xtensa-low.c @@ -23,7 +23,7 @@ /* Defined in auto-generated file reg-xtensa.c. */ void init_registers_xtensa (void); -#include +#include #include #include "xtensa-xtregs.c" diff --git a/gdb/xtensa-linux-nat.c b/gdb/xtensa-linux-nat.c index 2ca71440dcd..8c536185e91 100644 --- a/gdb/xtensa-linux-nat.c +++ b/gdb/xtensa-linux-nat.c @@ -37,6 +37,7 @@ #include #include #include +#include #include "gregset.h" #include "xtensa-tdep.h"