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