================
@@ -79,36 +81,45 @@ class NativeRegisterContextLinux_arm64
lldb::addr_t FixWatchpointHitAddress(lldb::addr_t hit_addr) override;
private:
- enum RegisterSetType : uint32_t {
- GPR, // General purpose registers.
- SVE, // Used for SVE registers in streaming or non-streaming mode.
- FPR, // When there is no SVE, or SVE in FPSIMD mode, or streaming only SVE
- // that is in non-streaming mode.
- // Pointer authentication registers are read only, so not included here.
- MTE, // Memory tagging control registers.
- TLS, // Thread local storage registers.
- SME, // ZA only, because SVCR and SVG are pseudo registers.
- SME2, // ZT only.
- FPMR, // Floating point mode control registers.
- GCS, // Guarded Control Stack registers.
- POE, // Permission Overlay registers.
+ // Bit mask enum used to refer to the types of registers we support.
Currently
+ // used for tracking cache validity and ReadAll/WriteAllRegister data. Will
+ // be used for much more in future.
+ enum class RegisterSetType : uint32_t {
+ GPR = 1 << 0, // General purpose registers.
+ FPR = 1 << 1, // When there is no SVE, or SVE in FPSIMD mode, or streaming
+ // only SVE that is in non-streaming mode.
+ SVE = 1 << 2, // Used for SVE registers in streaming or non-streaming mode.
+ SVE_HEADER = 1 << 3, // Only the ptrace header for SVE.
+ PAC = 1 << 4, // Pointer authentication mask registers.
+ MTE = 1 << 5, // Memory tagging control registers.
+ TLS = 1 << 6, // Thread local storage registers.
+ ZA = 1 << 7, // ZA only, because SVCR and SVG are pseudo registers.
+ ZA_HEADER = 1 << 8, // Only the ptrace header for ZA.
+ ZT = 1 << 9, // ZT only.
+ FPMR = 1 << 10, // Floating point mode control registers.
+ GCS = 1 << 11, // Guarded Control Stack registers.
+ POE = 1 << 12, // Permission Overlay registers.
+ LLVM_MARK_AS_BITMASK_ENUM(POE),
};
- bool m_gpr_is_valid;
- bool m_fpu_is_valid;
- bool m_sve_buffer_is_valid;
- bool m_mte_ctrl_is_valid;
- bool m_zt_buffer_is_valid;
- bool m_fpmr_is_valid;
-
- bool m_sve_header_is_valid;
- bool m_za_buffer_is_valid;
- bool m_za_header_is_valid;
- bool m_pac_mask_is_valid;
- bool m_tls_is_valid;
+ RegisterSetType m_validity = static_cast<RegisterSetType>(0);
+
+ void MakeValid(RegisterSetType set) { m_validity |= set; }
+
+ [[nodiscard]] bool IsValid(RegisterSetType set) {
----------------
Teemperor wrote:
Could be `const`
https://github.com/llvm/llvm-project/pull/197113
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits