aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis Machado <luis.machado@linaro.org>2021-10-04 09:34:50 -0300
committerLuis Machado <luis.machado@linaro.org>2021-10-11 16:03:48 -0300
commitdc22c61a1600639046407fb171613a3192fc0608 (patch)
tree3d11e6fa9e78419f380360dc47a1b7044bda26b1
parent4d224f4a589689449677e9c500cf12bee8283a3b (diff)
downloadfsf-binutils-gdb-dc22c61a1600639046407fb171613a3192fc0608.zip
fsf-binutils-gdb-dc22c61a1600639046407fb171613a3192fc0608.tar.gz
fsf-binutils-gdb-dc22c61a1600639046407fb171613a3192fc0608.tar.bz2
[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.
-rw-r--r--gdb/arm-tdep.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index ab6999a..2a6bfb1 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. */