aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-08-02 11:20:23 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2022-09-01 16:47:42 -0700
commit0c5dee0bdd892d957d9a60081cc8e499b1ebf657 (patch)
tree76ad0f1c3f131605951ba0d132429a70e5c5e16f
parentc9160e494226892214bf81df9ba724517dfe14bf (diff)
downloadfsf-binutils-gdb-0c5dee0bdd892d957d9a60081cc8e499b1ebf657.zip
fsf-binutils-gdb-0c5dee0bdd892d957d9a60081cc8e499b1ebf657.tar.gz
fsf-binutils-gdb-0c5dee0bdd892d957d9a60081cc8e499b1ebf657.tar.bz2
aarch64-fbsd-nat: Support the capability register set for Morello.
-rw-r--r--gdb/aarch64-fbsd-nat.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/aarch64-fbsd-nat.c b/gdb/aarch64-fbsd-nat.c
index 4c8e9c4..e696def 100644
--- a/gdb/aarch64-fbsd-nat.c
+++ b/gdb/aarch64-fbsd-nat.c
@@ -94,6 +94,13 @@ aarch64_fbsd_nat_target::fetch_registers (struct regcache *regcache,
if (tdep->has_tls ())
fetch_regset<uint64_t> (regcache, regnum, NT_ARM_TLS,
&aarch64_fbsd_tls_regset, tdep->tls_regnum);
+
+#if __has_feature(capabilities)
+ if (tdep->has_capability ())
+ fetch_register_set<struct capreg> (regcache, regnum, PT_GETCAPREGS,
+ &aarch64_fbsd_capregset,
+ tdep->cap_reg_base);
+#endif
}
/* Store register REGNUM back into the inferior. If REGNUM is -1, do
@@ -113,6 +120,15 @@ aarch64_fbsd_nat_target::store_registers (struct regcache *regcache,
if (tdep->has_tls ())
store_regset<uint64_t> (regcache, regnum, NT_ARM_TLS,
&aarch64_fbsd_tls_regset, tdep->tls_regnum);
+
+#ifdef notyet
+#if __has_feature(capabilities)
+ if (tdep->has_capability ())
+ store_register_set<struct capreg> (regcache, regnum, PT_GETCAPREGS,
+ PT_SETCAPREGS, &aarch64_fbsd_capregset,
+ tdep->cap_reg_base);
+#endif
+#endif
}
/* Implement the target read_description method. */
@@ -122,6 +138,10 @@ aarch64_fbsd_nat_target::read_description ()
{
aarch64_features features;
features.tls = have_regset (inferior_ptid, NT_ARM_TLS) != 0;
+#if __has_feature(capabilities)
+ features.capability = have_register_set<struct capreg> (inferior_ptid,
+ PT_GETCAPREGS);
+#endif
return aarch64_read_description (features);
}