summaryrefslogtreecommitdiff
path: root/gdb/gdbarch.h
diff options
context:
space:
mode:
authorThiago Jung Bauermann <thiago.bauermann@linaro.org>2022-08-18 13:42:55 +0100
committerLuis Machado <luis.machado@arm.com>2022-08-18 14:46:43 +0100
commit4f3681cc336158fbbbf3333a38eb9f324fdb9bf5 (patch)
tree531af26bdfb4dce427bf0cf306251ff7d54032e0 /gdb/gdbarch.h
parentf08216536117ada44bdba391114148da554764e1 (diff)
downloadbinutils-gdb-4f3681cc336158fbbbf3333a38eb9f324fdb9bf5.tar.gz
Fix thread's gdbarch when SVE vector length changes
When the inferior program changes the SVE length, GDB can stop tracking some registers as it obtains the new gdbarch that corresponds to the updated length: Breakpoint 1, do_sve_ioctl_test () at sve-ioctls.c:44 44 res = prctl(PR_SVE_SET_VL, i, 0, 0, 0, 0); (gdb) print i $2 = 32 (gdb) info registers ⋮ [ snip registers x0 to x30 ] ⋮ sp 0xffffffffeff0 0xffffffffeff0 pc 0xaaaaaaaaa8ac 0xaaaaaaaaa8ac <do_sve_ioctl_test+112> cpsr 0x60000000 [ EL=0 BTYPE=0 C Z ] fpsr 0x0 0 fpcr 0x0 0 vg 0x8 8 tpidr 0xfffff7fcb320 0xfffff7fcb320 (gdb) next 45 if (res < 0) { (gdb) info registers ⋮ [ snip registers x0 to x30 ] ⋮ sp 0xffffffffeff0 0xffffffffeff0 pc 0xaaaaaaaaa8cc 0xaaaaaaaaa8cc <do_sve_ioctl_test+144> cpsr 0x200000 [ EL=0 BTYPE=0 SS ] fpsr 0x0 0 fpcr 0x0 0 vg 0x4 4 (gdb) Notice that register tpidr disappeared when vg (which holds the vector length) changed from 8 to 4. The tpidr register is provided by the org.gnu.gdb.aarch64.tls feature. This happens because the code that searches for a new gdbarch to match the new vector length in aarch64_linux_nat_target::thread_architecture doesn't take into account the features present in the target description associated with the previous gdbarch. This patch makes it do that. Since the id member of struct gdbarch_info is now unused, it's removed.
Diffstat (limited to 'gdb/gdbarch.h')
-rw-r--r--gdb/gdbarch.h13
1 files changed, 2 insertions, 11 deletions
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 9ac418150b1..2f1c7399d78 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -251,17 +251,8 @@ struct gdbarch_info
bfd *abfd = nullptr;
- union
- {
- /* Architecture-specific target description data. Numerous targets
- need only this, so give them an easy way to hold it. */
- struct tdesc_arch_data *tdesc_data;
-
- /* SPU file system ID. This is a single integer, so using the
- generic form would only complicate code. Other targets may
- reuse this member if suitable. */
- int *id;
- };
+ /* Architecture-specific target description data. */
+ struct tdesc_arch_data *tdesc_data;
enum gdb_osabi osabi = GDB_OSABI_UNKNOWN;