aboutsummaryrefslogtreecommitdiff
path: root/gdb/aarch64-linux-nat.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2023-09-29 14:24:35 -0400
committerSimon Marchi <simon.marchi@efficios.com>2023-10-10 10:44:35 -0400
commit27b1f19f8f5cc46faba4bb2142547df074a82a29 (patch)
tree732d6d243fc7f90780e2a7b469cf9e97990d47f4 /gdb/aarch64-linux-nat.c
parentae0d827fa483c4e569803d99f8dff14794c63a17 (diff)
downloadgdb-27b1f19f8f5cc46faba4bb2142547df074a82a29.zip
gdb-27b1f19f8f5cc46faba4bb2142547df074a82a29.tar.gz
gdb-27b1f19f8f5cc46faba4bb2142547df074a82a29.tar.bz2
gdb: add inferior::{arch, set_arch}
Make the inferior's gdbarch field private, and add getters and setters. This helped me by allowing putting breakpoints on set_arch to know when the inferior's arch was set. A subsequent patch in this series also adds more things in set_arch. Change-Id: I0005bd1ef4cd6b612af501201cec44e457998eec Reviewed-By: John Baldwin <jhb@FreeBSD.org> Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/aarch64-linux-nat.c')
-rw-r--r--gdb/aarch64-linux-nat.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index c1d59b5..eb54db4 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -1005,24 +1005,24 @@ aarch64_linux_nat_target::thread_architecture (ptid_t ptid)
/* If this is a 32-bit architecture, then this is ARM, not AArch64.
There's no SVE vectors here, so just return the inferior
architecture. */
- if (gdbarch_bfd_arch_info (inf->gdbarch)->bits_per_word == 32)
- return inf->gdbarch;
+ if (gdbarch_bfd_arch_info (inf->arch ())->bits_per_word == 32)
+ return inf->arch ();
/* Only return the inferior's gdbarch if both vq and svq match the ones in
the tdep. */
aarch64_gdbarch_tdep *tdep
- = gdbarch_tdep<aarch64_gdbarch_tdep> (inf->gdbarch);
+ = gdbarch_tdep<aarch64_gdbarch_tdep> (inf->arch ());
uint64_t vq = aarch64_sve_get_vq (ptid.lwp ());
uint64_t svq = aarch64_za_get_svq (ptid.lwp ());
if (vq == tdep->vq && svq == tdep->sme_svq)
- return inf->gdbarch;
+ return inf->arch ();
/* We reach here if any vector length for the thread is different from its
value at process start. Lookup gdbarch via info (potentially creating a
new one) by using a target description that corresponds to the new vq/svq
value and the current architecture features. */
- const struct target_desc *tdesc = gdbarch_target_desc (inf->gdbarch);
+ const struct target_desc *tdesc = gdbarch_target_desc (inf->arch ());
aarch64_features features = aarch64_features_from_target_desc (tdesc);
features.vq = vq;
features.svq = svq;