0009-gdb-Fix-native-build-on-xtensa.patch 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. From 43501f9838e7aefd7d5d19aede49491591c34c98 Mon Sep 17 00:00:00 2001
  2. From: Romain Naour <romain.naour@gmail.com>
  3. Date: Sun, 28 Aug 2022 23:21:37 +0200
  4. Subject: [PATCH] gdb: Fix native build on xtensa
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Apply a similar fix than for Alpha architecture on gdb 9:
  9. https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=7a27b85f6d9b5eea9bd1493f903158fbea4b2231
  10. Fixes:
  11. ../../gdb/xtensa-linux-nat.c: In function ‘void fill_gregset(const regcache*, elf_greg_t (*)[128], int)’:
  12. ../../gdb/xtensa-linux-nat.c:66:17: error: ‘gdbarch_pc_regnum’ was not declared in this scope
  13. 66 | if (regnum == gdbarch_pc_regnum (gdbarch) || regnum == -1)
  14. | ^~~~~~~~~~~~~~~~~
  15. CXX complaints.o
  16. ../../gdb/xtensa-linux-nat.c:68:17: error: ‘gdbarch_ps_regnum’ was not declared in this scope
  17. 68 | if (regnum == gdbarch_ps_regnum (gdbarch) || regnum == -1)
  18. | ^~~~~~~~~~~~~~~~~
  19. ../../gdb/xtensa-linux-nat.c:71:38: error: no matching function for call to ‘gdbarch_tdep::gdbarch_tdep(gdbarch*&)’
  20. 71 | if (regnum == gdbarch_tdep (gdbarch)->wb_regnum || regnum == -1)
  21. | ^
  22. In file included from ../../gdb/xtensa-linux-nat.c:38:
  23. ../../gdb/xtensa-tdep.h:160:8: note: candidate: ‘gdbarch_tdep::gdbarch_tdep()’
  24. 160 | struct gdbarch_tdep
  25. | ^~~~~~~~~~~~
  26. ../../gdb/xtensa-tdep.h:160:8: note: candidate expects 0 arguments, 1 provided
  27. ../../gdb/xtensa-tdep.h:160:8: note: candidate: ‘constexpr gdbarch_tdep::gdbarch_tdep(const gdbarch_tdep&)’
  28. ../../gdb/xtensa-tdep.h:160:8: note: no known conversion for argument 1 from ‘gdbarch*’ to ‘const gdbarch_tdep&’
  29. ../../gdb/xtensa-tdep.h:160:8: note: candidate: ‘constexpr gdbarch_tdep::gdbarch_tdep(gdbarch_tdep&&)’
  30. ../../gdb/xtensa-tdep.h:160:8: note: no known conversion for argument 1 from ‘gdbarch*’ to ‘gdbarch_tdep&&’
  31. ../../gdb/xtensa-linux-nat.c:72:49: error: no matching function for call to ‘gdbarch_tdep::gdbarch_tdep(gdbarch*&)’
  32. 72 | regcache->raw_collect (gdbarch_tdep (gdbarch)->wb_regnum,
  33. | ^
  34. Signed-off-by: Romain Naour <romain.naour@gmail.com>
  35. ---
  36. gdb/xtensa-linux-nat.c | 1 +
  37. 1 file changed, 1 insertion(+)
  38. diff --git a/gdb/xtensa-linux-nat.c b/gdb/xtensa-linux-nat.c
  39. index f8509b02e07..794be827f9a 100644
  40. --- a/gdb/xtensa-linux-nat.c
  41. +++ b/gdb/xtensa-linux-nat.c
  42. @@ -35,6 +35,7 @@
  43. #include "gregset.h"
  44. #include "xtensa-tdep.h"
  45. +#include "gdbarch.h"
  46. /* Defines ps_err_e, struct ps_prochandle. */
  47. #include "gdb_proc_service.h"
  48. --
  49. 2.48.1