1 //===-- RegisterContextPOSIX_arm64.h ----------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_ARM64_H
10 #define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_ARM64_H
12 #include "RegisterInfoInterface.h"
13 #include "RegisterInfoPOSIX_arm64.h"
14 #include "lldb/Target/RegisterContext.h"
15 #include "lldb/Utility/Log.h"
17 class RegisterContextPOSIX_arm64
: public lldb_private::RegisterContext
{
19 RegisterContextPOSIX_arm64(
20 lldb_private::Thread
&thread
,
21 std::unique_ptr
<RegisterInfoPOSIX_arm64
> register_info
);
23 ~RegisterContextPOSIX_arm64() override
;
27 void InvalidateAllRegisters() override
;
29 size_t GetRegisterCount() override
;
31 virtual size_t GetGPRSize();
33 virtual unsigned GetRegisterSize(unsigned reg
);
35 virtual unsigned GetRegisterOffset(unsigned reg
);
37 const lldb_private::RegisterInfo
*GetRegisterInfoAtIndex(size_t reg
) override
;
39 size_t GetRegisterSetCount() override
;
41 const lldb_private::RegisterSet
*GetRegisterSet(size_t set
) override
;
43 const char *GetRegisterName(unsigned reg
);
46 std::unique_ptr
<RegisterInfoPOSIX_arm64
> m_register_info_up
;
48 virtual const lldb_private::RegisterInfo
*GetRegisterInfo();
50 bool IsGPR(unsigned reg
);
52 bool IsFPR(unsigned reg
);
54 size_t GetFPUSize() { return sizeof(RegisterInfoPOSIX_arm64::FPU
); }
56 bool IsSVE(unsigned reg
) const;
57 bool IsPAuth(unsigned reg
) const;
58 bool IsTLS(unsigned reg
) const;
59 bool IsSME(unsigned reg
) const;
60 bool IsMTE(unsigned reg
) const;
62 bool IsSVEZ(unsigned reg
) const { return m_register_info_up
->IsSVEZReg(reg
); }
63 bool IsSVEP(unsigned reg
) const { return m_register_info_up
->IsSVEPReg(reg
); }
64 bool IsSVEVG(unsigned reg
) const {
65 return m_register_info_up
->IsSVERegVG(reg
);
67 bool IsSMEZA(unsigned reg
) const {
68 return m_register_info_up
->IsSMERegZA(reg
);
71 uint32_t GetRegNumSVEZ0() const {
72 return m_register_info_up
->GetRegNumSVEZ0();
74 uint32_t GetRegNumSVEFFR() const {
75 return m_register_info_up
->GetRegNumSVEFFR();
77 uint32_t GetRegNumFPCR() const { return m_register_info_up
->GetRegNumFPCR(); }
78 uint32_t GetRegNumFPSR() const { return m_register_info_up
->GetRegNumFPSR(); }
80 virtual bool ReadGPR() = 0;
81 virtual bool ReadFPR() = 0;
82 virtual bool WriteGPR() = 0;
83 virtual bool WriteFPR() = 0;
86 #endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_ARM64_H