[PATCH v2 10/10] Remove reg2 section from Aarch64 SVE cores

Alan Hayward
2018-06-06T15:17:29Z

reg2 sections in SVE binaries will cause gdb to segfault on loading
due to miscalculating the register size.

For now, simply remove reg2 from SVE core files. This results in
core files without any vector/float register. Full core support
for SVE will come in a later set of patches.

2018-06-06 Alan Hayward <alan.hayward@arm.com>

gdb/
* aarch64-linux-tdep.c
(aarch64_linux_iterate_over_regset_sections): Check for SVE.
---
gdb/aarch64-linux-tdep.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index 96dc8a1132..b05bb49ae8 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -227,10 +227,13 @@ aarch64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
void *cb_data,
const struct regcache *regcache)
{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
cb (".reg", AARCH64_LINUX_SIZEOF_GREGSET, &aarch64_linux_gregset,
NULL, cb_data);
- cb (".reg2", AARCH64_LINUX_SIZEOF_FPREGSET, &aarch64_linux_fpregset,
- NULL, cb_data);
+ if (!tdep->has_sve ())
+ cb (".reg2", AARCH64_LINUX_SIZEOF_FPREGSET, &aarch64_linux_fpregset,
+ NULL, cb_data);
}

/* Implement the "core_read_description" gdbarch method. SVE not yet
--
2.15.1 (Apple Git-101)