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  <luis.machado@linaro.org>

	* aarch64-linux-tdep.c
	(aarch64_linux_iterate_over_regset_sections): Handle MTE register set.
	* aarch64-linux-tdep.h (AARCH64_LINUX_SIZEOF_MTE_REGSET): Define.
This commit is contained in:
Luis Machado 2020-08-18 16:21:04 -03:00
parent 41919a58ce
commit ffcc2a1549
3 changed files with 29 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2021-03-24 Luis Machado <luis.machado@linaro.org>
* 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 <luis.machado@linaro.org>
* aarch64-linux-tdep.c

View File

@ -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. */

View File

@ -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;