From: Luis Machado via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Cc: peter.maydell@linaro.org
Subject: [PATCH 2/4] [ARM] Small refactoring of arm gdbarch initialization
Date: Tue, 5 Oct 2021 11:45:19 -0300 [thread overview]
Message-ID: <20211005144521.1965198-3-luis.machado@linaro.org> (raw)
In-Reply-To: <20211005144521.1965198-1-luis.machado@linaro.org>
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.25.1
next prev parent reply other threads:[~2021-10-05 14:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-05 14:45 [PATCH 0/4] [ARM] M-profile MVE extension support Luis Machado via Gdb-patches
2021-10-05 14:45 ` [PATCH 1/4] [ARM] Refactor some constants Luis Machado via Gdb-patches
2021-10-08 16:03 ` Alan Hayward via Gdb-patches
2021-10-05 14:45 ` Luis Machado via Gdb-patches [this message]
2021-10-08 16:03 ` [PATCH 2/4] [ARM] Small refactoring of arm gdbarch initialization Alan Hayward via Gdb-patches
2021-10-05 14:45 ` [PATCH 3/4] [ARM] Refactor pseudo register numbering Luis Machado via Gdb-patches
2021-10-08 16:04 ` Alan Hayward via Gdb-patches
2021-10-11 13:06 ` Luis Machado via Gdb-patches
2021-10-05 14:45 ` [PATCH 4/4] [ARM] Add support for M-profile MVE extension Luis Machado via Gdb-patches
2021-10-05 15:55 ` Eli Zaretskii via Gdb-patches
2021-10-08 16:34 ` Alan Hayward via Gdb-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211005144521.1965198-3-luis.machado@linaro.org \
--to=gdb-patches@sourceware.org \
--cc=luis.machado@linaro.org \
--cc=peter.maydell@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox