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 
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 
47 protected:
48  struct RegInfo {
52 
56 
59 
61  };
62 
63  // based on RegisterContextDarwin_arm64.h
64  struct VReg {
65  uint8_t bytes[16];
66  };
67 
68  // based on RegisterContextDarwin_arm64.h
69  struct FPU {
70  VReg v[32];
73  };
74 
76  // general
77  // purpose
78  // registers.
81  m_fpr; // floating-point registers including extended register sets.
82  std::unique_ptr<lldb_private::RegisterInfoInterface>
83  m_register_info_up; // Register Info Interface (FreeBSD or Linux)
84 
85  // Determines if an extended register set is supported on the processor
86  // running the inferior process.
87  virtual bool IsRegisterSetAvailable(size_t set_index);
88 
89  virtual const lldb_private::RegisterInfo *GetRegisterInfo();
90 
91  bool IsGPR(unsigned reg);
92 
93  bool IsFPR(unsigned reg);
94 
95  virtual bool ReadGPR() = 0;
96  virtual bool ReadFPR() = 0;
97  virtual bool WriteGPR() = 0;
98  virtual bool WriteFPR() = 0;
99 };
100 
101 #endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_ARM64_H
virtual bool WriteFPR()=0
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