[AArch64] Fix FFR register size for core files.

Message ID 20210624172518.323314-1-luis.machado@linaro.org
State New
Headers show
Series
  • [AArch64] Fix FFR register size for core files.
Related show

Commit Message

Rustam Kovhaev via Gdb-patches June 24, 2021, 5:25 p.m.
The FFR register has a size of VL bits, not 32 bits.

This causes issues when writing core files with the gcore command and when
reading them. The FFR register sometimes shows up with garbage data.

gdb/ChangeLog:

2021-06-24  Luis Machado  <luis.machado@linaro.org>

	* aarch64-linux-tdep.c
	(aarch64_linux_iterate_over_regset_sections): Fix FFR register size.
---
 gdb/aarch64-linux-tdep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.25.1

Patch

diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index d541c6a32d0..167035275a4 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -687,7 +687,7 @@  aarch64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
 	{
 	  { 32, AARCH64_SVE_Z0_REGNUM, (int) (tdep->vq * 16) },
 	  { 16, AARCH64_SVE_P0_REGNUM, (int) (tdep->vq * 16 / 8) },
-	  { 1, AARCH64_SVE_FFR_REGNUM, 4 },
+	  { 1, AARCH64_SVE_FFR_REGNUM, (int) (tdep->vq * 16 / 8) },
 	  { 1, AARCH64_FPSR_REGNUM, 4 },
 	  { 1, AARCH64_FPCR_REGNUM, 4 },
 	  { 0 }