From: Luis Machado Date: Tue, 18 Aug 2020 19:21:04 +0000 (-0300) Subject: AArch64: Add MTE register set support for core files X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ffcc2a15499644040a4c6a80828cf1795d9bc54b;p=binutils-gdb.git AArch64: Add MTE register set support for core files This patch handles the tagged_addr_ctrl register that is exported when generating a core file. gdb/ChangeLog: 2021-03-24 Luis Machado * aarch64-linux-tdep.c (aarch64_linux_iterate_over_regset_sections): Handle MTE register set. * aarch64-linux-tdep.h (AARCH64_LINUX_SIZEOF_MTE_REGSET): Define. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 52e0ddeb2b4..76e905ea497 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2021-03-24 Luis Machado + + * aarch64-linux-tdep.c + (aarch64_linux_iterate_over_regset_sections): Handle MTE register set. + * aarch64-linux-tdep.h (AARCH64_LINUX_SIZEOF_MTE_REGSET): Define. + 2021-03-24 Luis Machado * aarch64-linux-tdep.c diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c index 15bbdb253f9..9602fc4b29a 100644 --- a/gdb/aarch64-linux-tdep.c +++ b/gdb/aarch64-linux-tdep.c @@ -728,6 +728,26 @@ aarch64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch, AARCH64_LINUX_SIZEOF_PAUTH, &aarch64_linux_pauth_regset, "pauth registers", cb_data); } + + /* Handle MTE registers. */ + if (tdep->has_mte ()) + { + /* Create this on the fly in order to handle the variable location. */ + const struct regcache_map_entry mte_regmap[] = + { + { 1, tdep->mte_reg_base, 4}, + { 0 } + }; + + const struct regset aarch64_linux_mte_regset = + { + mte_regmap, regcache_supply_regset, regcache_collect_regset + }; + + cb (".reg-aarch-mte", AARCH64_LINUX_SIZEOF_MTE_REGSET, + AARCH64_LINUX_SIZEOF_MTE_REGSET, &aarch64_linux_mte_regset, + "MTE registers", cb_data); + } } /* Implement the "core_read_description" gdbarch method. */ diff --git a/gdb/aarch64-linux-tdep.h b/gdb/aarch64-linux-tdep.h index 84c25172a9b..62a6da83494 100644 --- a/gdb/aarch64-linux-tdep.h +++ b/gdb/aarch64-linux-tdep.h @@ -36,6 +36,9 @@ /* The pauth regset consists of 2 X sized registers. */ #define AARCH64_LINUX_SIZEOF_PAUTH (2 * X_REGISTER_SIZE) +/* The MTE regset consists of a 32-bit register. */ +#define AARCH64_LINUX_SIZEOF_MTE_REGSET (4) + extern const struct regset aarch64_linux_gregset; extern const struct regset aarch64_linux_fpregset;