aboutsummaryrefslogtreecommitdiff
path: root/gdb/nat/aarch64-sve-linux-ptrace.h
diff options
context:
space:
mode:
authorAlan Hayward <alan.hayward@arm.com>2019-04-15 12:31:21 +0100
committerAlan Hayward <alan.hayward@arm.com>2019-04-15 15:12:44 +0100
commit48574d91bf1289074f2c88b1f83aa3cd37d524d9 (patch)
tree8bb9c8cbd7c8c487de165db5fd0fe8914f5036d7 /gdb/nat/aarch64-sve-linux-ptrace.h
parent4da037ef9dba6c17089250d228efdbe6f7d830c9 (diff)
downloadgdb-48574d91bf1289074f2c88b1f83aa3cd37d524d9.zip
gdb-48574d91bf1289074f2c88b1f83aa3cd37d524d9.tar.gz
gdb-48574d91bf1289074f2c88b1f83aa3cd37d524d9.tar.bz2
AArch64 SVE: Support changing vector lengths for ptrace
When writing registers to the kernel, check if regcache VG has been changed. If so then update the thread's vector length, then write back the registers. When reading registers from the kernel, ensure regcache VG register is updated. The regcache registers should already be of the correct length. Remove all the checks that error if the vector length has changed. gdb/ChangeLog: * aarch64-linux-nat.c (store_sveregs_to_thread): Set vector length. * nat/aarch64-sve-linux-ptrace.c (aarch64_sve_set_vq): New function. (aarch64_sve_regs_copy_to_reg_buf): Remove VG checks. (aarch64_sve_regs_copy_from_reg_buf): Likewise. * nat/aarch64-sve-linux-ptrace.h (aarch64_sve_set_vq): New declaration.
Diffstat (limited to 'gdb/nat/aarch64-sve-linux-ptrace.h')
-rw-r--r--gdb/nat/aarch64-sve-linux-ptrace.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/gdb/nat/aarch64-sve-linux-ptrace.h b/gdb/nat/aarch64-sve-linux-ptrace.h
index 167fc8e..ee994f2 100644
--- a/gdb/nat/aarch64-sve-linux-ptrace.h
+++ b/gdb/nat/aarch64-sve-linux-ptrace.h
@@ -39,17 +39,25 @@
uint64_t aarch64_sve_get_vq (int tid);
+/* Set VQ in the kernel for the given tid, using either the value VQ or
+ reading from the register VG in the register buffer. */
+
+bool aarch64_sve_set_vq (int tid, uint64_t vq);
+bool aarch64_sve_set_vq (int tid, struct reg_buffer_common *reg_buf);
+
/* Read the current SVE register set using ptrace, allocating space as
required. */
extern std::unique_ptr<gdb_byte[]> aarch64_sve_get_sveregs (int tid);
-/* Put the registers from linux structure buf into register buffer. */
+/* Put the registers from linux structure buf into register buffer. Assumes the
+ vector lengths in the register buffer match the size in the kernel. */
extern void aarch64_sve_regs_copy_to_reg_buf (struct reg_buffer_common *reg_buf,
const void *buf);
-/* Put the registers from register buffer into linux structure buf. */
+/* Put the registers from register buffer into linux structure buf. Assumes the
+ vector lengths in the register buffer match the size in the kernel. */
extern void
aarch64_sve_regs_copy_from_reg_buf (const struct reg_buffer_common *reg_buf,