From dc22c61a1600639046407fb171613a3192fc0608 Mon Sep 17 00:00:00 2001 From: Luis Machado Date: Mon, 4 Oct 2021 09:34:50 -0300 Subject: [PATCH] [ARM] Small refactoring of arm gdbarch initialization This is in preparation to MVE support, where we will define another pseudo register. We need to define the pseudo register numbers *after* accounting for all the registers in the XML description, so move the call to tdesc_use_registers up. If we don't do it, GDB's register count won't consider registers contained in the XML but ignored by GDB, throwing the register numbering off. --- gdb/arm-tdep.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index ab6999ae209..2a6bfb1b3f7 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -9470,6 +9470,17 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_long_double_format (gdbarch, floatformats_ieee_double); } + if (tdesc_data != nullptr) + { + set_tdesc_pseudo_register_name (gdbarch, arm_register_name); + + tdesc_use_registers (gdbarch, tdesc, std::move (tdesc_data)); + + /* Override tdesc_register_type to adjust the types of VFP + registers for NEON. */ + set_gdbarch_register_type (gdbarch, arm_register_type); + } + if (have_vfp_pseudos) { /* NOTE: These are the only pseudo registers used by @@ -9484,17 +9495,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_pseudo_register_write (gdbarch, arm_pseudo_write); } - if (tdesc_data != nullptr) - { - set_tdesc_pseudo_register_name (gdbarch, arm_register_name); - - tdesc_use_registers (gdbarch, tdesc, std::move (tdesc_data)); - - /* Override tdesc_register_type to adjust the types of VFP - registers for NEON. */ - set_gdbarch_register_type (gdbarch, arm_register_type); - } - /* Add standard register aliases. We add aliases even for those names which are used by the current architecture - it's simpler, and does no harm, since nothing ever lists user registers. */ -- 2.30.2