From 0c5dee0bdd892d957d9a60081cc8e499b1ebf657 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 2 Aug 2022 11:20:23 -0700 Subject: [PATCH] aarch64-fbsd-nat: Support the capability register set for Morello. --- gdb/aarch64-fbsd-nat.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gdb/aarch64-fbsd-nat.c b/gdb/aarch64-fbsd-nat.c index 4c8e9c4fa81..e696defa492 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 (regcache, regnum, NT_ARM_TLS, &aarch64_fbsd_tls_regset, tdep->tls_regnum); + +#if __has_feature(capabilities) + if (tdep->has_capability ()) + fetch_register_set (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 (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 (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 (inferior_ptid, + PT_GETCAPREGS); +#endif return aarch64_read_description (features); } -- 2.47.2