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 liblldb_RegisterContextPOSIX_arm64_h_
10 #define liblldb_RegisterContextPOSIX_arm64_h_
11 
12 #include "RegisterInfoInterface.h"
15 #include "lldb/Utility/Log.h"
16 
17 class ProcessMonitor;
18 
20 public:
22  lldb_private::Thread &thread, uint32_t concrete_frame_idx,
24 
25  ~RegisterContextPOSIX_arm64() override;
26 
27  void Invalidate();
28 
29  void InvalidateAllRegisters() override;
30 
31  size_t GetRegisterCount() override;
32 
33  virtual size_t GetGPRSize();
34 
35  virtual unsigned GetRegisterSize(unsigned reg);
36 
37  virtual unsigned GetRegisterOffset(unsigned reg);
38 
39  const lldb_private::RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override;
40 
41  size_t GetRegisterSetCount() override;
42 
43  const lldb_private::RegisterSet *GetRegisterSet(size_t set) override;
44 
45  const char *GetRegisterName(unsigned reg);
46 
48  uint32_t num) override;
49 
50 protected:
51  struct RegInfo {
55 
59 
62 
64  };
65 
66  // based on RegisterContextDarwin_arm64.h
67  struct VReg {
68  uint8_t bytes[16];
69  };
70 
71  // based on RegisterContextDarwin_arm64.h
72  struct FPU {
73  VReg v[32];
76  };
77 
79  // general
80  // purpose
81  // registers.
84  m_fpr; // floating-point registers including extended register sets.
85  std::unique_ptr<lldb_private::RegisterInfoInterface>
86  m_register_info_up; // Register Info Interface (FreeBSD or Linux)
87 
88  // Determines if an extended register set is supported on the processor
89  // running the inferior process.
90  virtual bool IsRegisterSetAvailable(size_t set_index);
91 
92  virtual const lldb_private::RegisterInfo *GetRegisterInfo();
93 
94  bool IsGPR(unsigned reg);
95 
96  bool IsFPR(unsigned reg);
97 
99 
100  virtual bool ReadGPR() = 0;
101  virtual bool ReadFPR() = 0;
102  virtual bool WriteGPR() = 0;
103  virtual bool WriteFPR() = 0;
104 };
105 
106 #endif // liblldb_RegisterContextPOSIX_arm64_h_
virtual bool WriteFPR()=0
uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override
Convert from a given register numbering scheme to the lldb register numbering scheme.
uint64_t m_gpr_arm64[lldb_private::k_num_gpr_registers_arm64]
RegisterInfo interface to patch RegisterInfo structure for archs.
virtual bool ReadFPR()=0
std::unique_ptr< lldb_private::RegisterInfoInterface > m_register_info_up
const char * GetRegisterName(unsigned reg)
virtual bool IsRegisterSetAvailable(size_t set_index)
Manages communication with the inferior (debugee) process.
virtual bool ReadGPR()=0
struct RegisterContextPOSIX_arm64::FPU m_fpr
const lldb_private::RegisterSet * GetRegisterSet(size_t set) override
RegisterContextPOSIX_arm64(lldb_private::Thread &thread, uint32_t concrete_frame_idx, lldb_private::RegisterInfoInterface *register_info)
virtual unsigned GetRegisterOffset(unsigned reg)
virtual unsigned GetRegisterSize(unsigned reg)
virtual const lldb_private::RegisterInfo * GetRegisterInfo()
const lldb_private::RegisterInfo * GetRegisterInfoAtIndex(size_t reg) override
virtual bool WriteGPR()=0