From: Andrew Burgess Date: Thu, 5 Oct 2023 11:14:32 +0000 (+0100) Subject: gdbserver: fix gdbserver builds after expedite_regs changes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dd6a9ec16e0ce34a7e8d0ace001f3cc167846892;p=binutils-gdb.git gdbserver: fix gdbserver builds after expedite_regs changes After this commit: commit 6a65998a8a94abaaae7ca4ff0ab9c3f25dc2e766 Date: Mon Sep 11 12:42:00 2023 +0100 Convert tdesc's expedite_regs to a string vector The risc-v, loongarch, and csky gdbserver builds were broken. A use of target_desc::expedite_regs (for each architecture) was not updated to take account of the type change. I've tested that this fixes the risc-v build. I haven't tested the other architectures, but they should be fine. --- diff --git a/gdbserver/linux-csky-low.cc b/gdbserver/linux-csky-low.cc index 3117556f5de..feb428ec9d2 100644 --- a/gdbserver/linux-csky-low.cc +++ b/gdbserver/linux-csky-low.cc @@ -132,8 +132,11 @@ csky_target::low_arch_setup () static const char *expedite_regs[] = { "r14", "pc", NULL }; target_desc_up tdesc = csky_create_target_description (); - if (!tdesc->expedite_regs) - init_target_desc (tdesc.get (), expedite_regs); + if (tdesc->expedite_regs.empty ()) + { + init_target_desc (tdesc.get (), expedite_regs); + gdb_assert (!tdesc->expedite_regs.empty ()); + } current_process ()->tdesc = tdesc.release (); diff --git a/gdbserver/linux-loongarch-low.cc b/gdbserver/linux-loongarch-low.cc index ead2e76d25d..3eb87f55d0f 100644 --- a/gdbserver/linux-loongarch-low.cc +++ b/gdbserver/linux-loongarch-low.cc @@ -84,8 +84,11 @@ loongarch_target::low_arch_setup () features.xlen = sizeof (elf_greg_t); tdesc = loongarch_create_target_description (features); - if (!tdesc->expedite_regs) - init_target_desc (tdesc.get (), expedite_regs); + if (tdesc->expedite_regs.empty ()) + { + init_target_desc (tdesc.get (), expedite_regs); + gdb_assert (!tdesc->expedite_regs.empty ()); + } current_process ()->tdesc = tdesc.release (); } diff --git a/gdbserver/linux-riscv-low.cc b/gdbserver/linux-riscv-low.cc index 129bc3b138b..4c251bb179c 100644 --- a/gdbserver/linux-riscv-low.cc +++ b/gdbserver/linux-riscv-low.cc @@ -90,8 +90,12 @@ riscv_target::low_arch_setup () = riscv_linux_read_features (lwpid_of (current_thread)); target_desc_up tdesc = riscv_create_target_description (features); - if (!tdesc->expedite_regs) - init_target_desc (tdesc.get (), expedite_regs); + if (tdesc->expedite_regs.empty ()) + { + init_target_desc (tdesc.get (), expedite_regs); + gdb_assert (!tdesc->expedite_regs.empty ()); + } + current_process ()->tdesc = tdesc.release (); }