forked from Imagelibrary/binutils-gdb
[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.
This commit is contained in:
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user