gdb-100-xtensa-fix-linux-ptrace-includes.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. From e671835b7afc90b3ff201b79f07a6fb67797bc5c Mon Sep 17 00:00:00 2001
  2. From: Baruch Siach <baruch@tkos.co.il>
  3. Date: Mon, 20 Jan 2014 09:53:12 +0200
  4. Subject: [PATCH] gdb: xtensa: fix linux ptrace includes
  5. Currently, xtensa code using the Linux ptrace interface only include
  6. sys/ptrace.h. This file comes from the C library (glibc and uClibc,
  7. at least), and includes a declaration of the ptrace() functions, along
  8. with some cross architecture constants that are mostly copied from the
  9. file located at include/uapi/linux/ptrace.h in recent Linux kernels.
  10. For xtensa specific constants like PTRACE_GETXTREGS and
  11. PTRACE_SETXTREGS the asm/ptrace.h include from the Linux kernel UAPI
  12. is needed. The code in gdbserver xtensa specific part doesn't call
  13. ptrace() directly, so we can remove the unneeded sys/ptrace.h include.
  14. The gdb xtensa specific code needs both headers, since it calls
  15. ptrace().
  16. gdb/
  17. * xtensa-linux-nat.c: Include asm/ptrace.h.
  18. gdb/gdbserver/
  19. * linux-xtensa-low.c: Include asm/ptrace.h instead of
  20. sys/ptrace.h.
  21. ---
  22. Backported from: e671835b7afc90b3ff201b79f07a6fb67797bc5c
  23. Changes to Changelog files are dropped.
  24. gdb/gdbserver/linux-xtensa-low.c | 2 +-
  25. gdb/xtensa-linux-nat.c | 1 +
  26. 2 files changed, 2 insertions(+), 1 deletion(-)
  27. diff --git a/gdb/gdbserver/linux-xtensa-low.c b/gdb/gdbserver/linux-xtensa-low.c
  28. index 7db97a9..479b65b 100644
  29. --- a/gdb/gdbserver/linux-xtensa-low.c
  30. +++ b/gdb/gdbserver/linux-xtensa-low.c
  31. @@ -24,7 +24,7 @@
  32. void init_registers_xtensa (void);
  33. extern const struct target_desc *tdesc_xtensa;
  34. -#include <sys/ptrace.h>
  35. +#include <asm/ptrace.h>
  36. #include <xtensa-config.h>
  37. #include "xtensa-xtregs.c"
  38. diff --git a/gdb/xtensa-linux-nat.c b/gdb/xtensa-linux-nat.c
  39. index 2372e79..9340c62 100644
  40. --- a/gdb/xtensa-linux-nat.c
  41. +++ b/gdb/xtensa-linux-nat.c
  42. @@ -36,6 +36,7 @@
  43. #include <fcntl.h>
  44. #include <sys/procfs.h>
  45. #include <sys/ptrace.h>
  46. +#include <asm/ptrace.h>
  47. #include "gregset.h"
  48. #include "xtensa-tdep.h"
  49. --
  50. 1.8.1.4