LLDB  mainline
RegisterContextPOSIX_arm64.h
Go to the documentation of this file.
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"
15 #include "lldb/Utility/Log.h"
16 
18 public:
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 
54  size_t GetFPUSize() { return sizeof(RegisterInfoPOSIX_arm64::FPU); }
55 
56  bool IsSVE(unsigned reg) const;
57  bool IsPAuth(unsigned reg) const;
58 
59  bool IsSVEZ(unsigned reg) const { return m_register_info_up->IsSVEZReg(reg); }
60  bool IsSVEP(unsigned reg) const { return m_register_info_up->IsSVEPReg(reg); }
61  bool IsSVEVG(unsigned reg) const {
62  return m_register_info_up->IsSVERegVG(reg);
63  }
64 
66  return m_register_info_up->GetRegNumSVEZ0();
67  }
69  return m_register_info_up->GetRegNumSVEFFR();
70  }
71  uint32_t GetRegNumFPCR() const { return m_register_info_up->GetRegNumFPCR(); }
72  uint32_t GetRegNumFPSR() const { return m_register_info_up->GetRegNumFPSR(); }
73 
74  virtual bool ReadGPR() = 0;
75  virtual bool ReadFPR() = 0;
76  virtual bool WriteGPR() = 0;
77  virtual bool WriteFPR() = 0;
78 };
79 
80 #endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_ARM64_H
RegisterContextPOSIX_arm64::WriteGPR
virtual bool WriteGPR()=0
RegisterContextPOSIX_arm64::GetRegisterInfo
virtual const lldb_private::RegisterInfo * GetRegisterInfo()
Definition: RegisterContextPOSIX_arm64.cpp:79
RegisterContextPOSIX_arm64::IsSVEZ
bool IsSVEZ(unsigned reg) const
Definition: RegisterContextPOSIX_arm64.h:59
RegisterContextPOSIX_arm64::ReadGPR
virtual bool ReadGPR()=0
RegisterContextPOSIX_arm64::IsSVE
bool IsSVE(unsigned reg) const
Definition: RegisterContextPOSIX_arm64.cpp:42
RegisterContextPOSIX_arm64::GetRegNumFPCR
uint32_t GetRegNumFPCR() const
Definition: RegisterContextPOSIX_arm64.h:71
RegisterInfoPOSIX_arm64::FPU
Definition: RegisterInfoPOSIX_arm64.h:59
RegisterContextPOSIX_arm64::RegisterContextPOSIX_arm64
RegisterContextPOSIX_arm64(lldb_private::Thread &thread, std::unique_ptr< RegisterInfoPOSIX_arm64 > register_info)
Definition: RegisterContextPOSIX_arm64.cpp:50
RegisterContextPOSIX_arm64::GetFPUSize
size_t GetFPUSize()
Definition: RegisterContextPOSIX_arm64.h:54
RegisterContextPOSIX_arm64::Invalidate
void Invalidate()
Definition: RegisterContextPOSIX_arm64.cpp:58
RegisterContextPOSIX_arm64::GetRegisterSize
virtual unsigned GetRegisterSize(unsigned reg)
Definition: RegisterContextPOSIX_arm64.cpp:66
RegisterInfoInterface.h
RegisterContextPOSIX_arm64::GetRegisterSetCount
size_t GetRegisterSetCount() override
Definition: RegisterContextPOSIX_arm64.cpp:94
RegisterContextPOSIX_arm64::GetRegisterInfoAtIndex
const lldb_private::RegisterInfo * GetRegisterInfoAtIndex(size_t reg) override
Definition: RegisterContextPOSIX_arm64.cpp:87
RegisterContextPOSIX_arm64::IsFPR
bool IsFPR(unsigned reg)
Definition: RegisterContextPOSIX_arm64.cpp:35
Log.h
lldb_private::Thread
Definition: Thread.h:60
RegisterContextPOSIX_arm64::GetRegNumSVEZ0
uint32_t GetRegNumSVEZ0() const
Definition: RegisterContextPOSIX_arm64.h:65
RegisterInfoPOSIX_arm64.h
set
set(option_framework FRAMEWORK) endif() if(LLDB_ENABLE_PYTHON) get_target_property(python_bindings_dir swig_wrapper_python BINARY_DIR) set(lldb_python_wrapper $
Definition: API/CMakeLists.txt:9
RegisterContextPOSIX_arm64::m_register_info_up
std::unique_ptr< RegisterInfoPOSIX_arm64 > m_register_info_up
Definition: RegisterContextPOSIX_arm64.h:46
lldb_private::RegisterContext
Definition: RegisterContext.h:17
RegisterContextPOSIX_arm64::GetRegisterName
const char * GetRegisterName(unsigned reg)
Definition: RegisterContextPOSIX_arm64.cpp:103
RegisterContextPOSIX_arm64::GetGPRSize
virtual size_t GetGPRSize()
Definition: RegisterContextPOSIX_arm64.cpp:74
RegisterContextPOSIX_arm64::GetRegNumSVEFFR
uint32_t GetRegNumSVEFFR() const
Definition: RegisterContextPOSIX_arm64.h:68
RegisterContextPOSIX_arm64::IsSVEVG
bool IsSVEVG(unsigned reg) const
Definition: RegisterContextPOSIX_arm64.h:61
uint32_t
RegisterContextPOSIX_arm64::IsPAuth
bool IsPAuth(unsigned reg) const
Definition: RegisterContextPOSIX_arm64.cpp:46
RegisterContextPOSIX_arm64::IsGPR
bool IsGPR(unsigned reg)
Definition: RegisterContextPOSIX_arm64.cpp:28
RegisterContextPOSIX_arm64::InvalidateAllRegisters
void InvalidateAllRegisters() override
Definition: RegisterContextPOSIX_arm64.cpp:60
RegisterContextPOSIX_arm64::WriteFPR
virtual bool WriteFPR()=0
RegisterContextPOSIX_arm64::GetRegisterCount
size_t GetRegisterCount() override
Definition: RegisterContextPOSIX_arm64.cpp:70
RegisterContextPOSIX_arm64::~RegisterContextPOSIX_arm64
~RegisterContextPOSIX_arm64() override
RegisterContextPOSIX_arm64::ReadFPR
virtual bool ReadFPR()=0
RegisterContextPOSIX_arm64::IsSVEP
bool IsSVEP(unsigned reg) const
Definition: RegisterContextPOSIX_arm64.h:60
RegisterContext.h
RegisterContextPOSIX_arm64::GetRegisterSet
const lldb_private::RegisterSet * GetRegisterSet(size_t set) override
Definition: RegisterContextPOSIX_arm64.cpp:99
RegisterContextPOSIX_arm64
Definition: RegisterContextPOSIX_arm64.h:17
RegisterContextPOSIX_arm64::GetRegNumFPSR
uint32_t GetRegNumFPSR() const
Definition: RegisterContextPOSIX_arm64.h:72
RegisterContextPOSIX_arm64::GetRegisterOffset
virtual unsigned GetRegisterOffset(unsigned reg)
Definition: RegisterContextPOSIX_arm64.cpp:62