1 //===-- RegisterContextPOSIX_arm64.h ----------------------------*- C++ -*-===// 2 // 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 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_ARM64_H 10 #define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_ARM64_H 11 12 #include "RegisterInfoInterface.h" 13 #include "RegisterInfoPOSIX_arm64.h" 14 #include "lldb/Target/RegisterContext.h" 15 #include "lldb/Utility/Log.h" 16 17 class RegisterContextPOSIX_arm64 : public lldb_private::RegisterContext { 18 public: 19 RegisterContextPOSIX_arm64( 20 lldb_private::Thread &thread, 21 std::unique_ptr<RegisterInfoPOSIX_arm64> register_info); 22 23 ~RegisterContextPOSIX_arm64() override; 24 25 void Invalidate(); 26 27 void InvalidateAllRegisters() override; 28 29 size_t GetRegisterCount() override; 30 31 virtual size_t GetGPRSize(); 32 33 virtual unsigned GetRegisterSize(unsigned reg); 34 35 virtual unsigned GetRegisterOffset(unsigned reg); 36 37 const lldb_private::RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override; 38 39 size_t GetRegisterSetCount() override; 40 41 const lldb_private::RegisterSet *GetRegisterSet(size_t set) override; 42 43 const char *GetRegisterName(unsigned reg); 44 45 protected: 46 std::unique_ptr<RegisterInfoPOSIX_arm64> m_register_info_up; 47 48 virtual const lldb_private::RegisterInfo *GetRegisterInfo(); 49 50 bool IsGPR(unsigned reg); 51 52 bool IsFPR(unsigned reg); 53 GetFPUSize()54 size_t GetFPUSize() { return sizeof(RegisterInfoPOSIX_arm64::FPU); } 55 56 bool IsSVE(unsigned reg) const; 57 IsSVEZ(unsigned reg)58 bool IsSVEZ(unsigned reg) const { return m_register_info_up->IsSVEZReg(reg); } IsSVEP(unsigned reg)59 bool IsSVEP(unsigned reg) const { return m_register_info_up->IsSVEPReg(reg); } IsSVEVG(unsigned reg)60 bool IsSVEVG(unsigned reg) const { 61 return m_register_info_up->IsSVERegVG(reg); 62 } 63 GetRegNumSVEZ0()64 uint32_t GetRegNumSVEZ0() const { 65 return m_register_info_up->GetRegNumSVEZ0(); 66 } GetRegNumSVEFFR()67 uint32_t GetRegNumSVEFFR() const { 68 return m_register_info_up->GetRegNumSVEFFR(); 69 } GetRegNumFPCR()70 uint32_t GetRegNumFPCR() const { return m_register_info_up->GetRegNumFPCR(); } GetRegNumFPSR()71 uint32_t GetRegNumFPSR() const { return m_register_info_up->GetRegNumFPSR(); } 72 73 virtual bool ReadGPR() = 0; 74 virtual bool ReadFPR() = 0; 75 virtual bool WriteGPR() = 0; 76 virtual bool WriteFPR() = 0; 77 }; 78 79 #endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_ARM64_H 80