]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
AArch64 SVE: Check for vector length change when getting gdbarch
authorAlan Hayward <alan.hayward@arm.com>
Mon, 15 Apr 2019 11:29:40 +0000 (12:29 +0100)
committerAlan Hayward <alan.hayward@arm.com>
Mon, 15 Apr 2019 14:12:43 +0000 (15:12 +0100)
commit4da037ef9dba6c17089250d228efdbe6f7d830c9
treed255e2f1b678fe4c1bef688cac9d5c4e1d6a6307
parentccb8d7e8194b848a6c4aa43272540eec0f4f21f2
AArch64 SVE: Check for vector length change when getting gdbarch

Override the thread_architecture method, similar to SPU.  If the vector
length has changed, then find the arch using info, making sure the vector
length is passed down to the init routine.

In the init routine, ensure the arch has the correct vector length.

Example output. Program is stopped in thread 2, just before it calls prctl
to change the vector length

(gdb) info threads
  Id   Target Id                                     Frame
  1    Thread 0xffffbf6f4000 (LWP 3188) "sve_change" 0x0000ffffbf6ae130 in pthread_join ()
* 2    Thread 0xffffbf55e200 (LWP 3189) "sve_change" thread1 (arg=0xfeedface) at sve_change_size.c:28
(gdb) print $vg
$1 = 8
(gdb) print $z0.s.u
$2 = {623191333623191333623191333623191333, 0 <repeats 12 times>}
(gdb) n
29   int ret = prctl(PR_SVE_SET_VL, vl/2);
(gdb) n
30   printf ("Changed: ret\n", ret);
(gdb) print $vg
$4 = 4
(gdb) print $z0.s.u
$5 = {623191333623191333623191333623191333, 0, 0, 0, 0}
(gdb) thr 1
[Switching to thread 1 (Thread 0xffffbf6f4000 (LWP 3181))]
(gdb) print $vg
$6 = 8
(gdb) print $z0.s.u
$7 = {623191333623191333623191333623191333, 0 <repeats 12 times>}

gdb/ChangeLog:

* aarch64-linux-nat.c
(aarch64_linux_nat_target::thread_architecture): Add override.
* aarch64-tdep.c (aarch64_gdbarch_init): Ensure different tdesc for
each VQ.
gdb/ChangeLog
gdb/aarch64-linux-nat.c
gdb/aarch64-tdep.c