LLDB  mainline
RegisterContextPOSIX_powerpc.h
Go to the documentation of this file.
1 //===-- RegisterContextPOSIX_powerpc.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_powerpc_h_
10 #define liblldb_RegisterContextPOSIX_powerpc_h_
11 
13 #include "RegisterInfoInterface.h"
15 #include "lldb/Utility/Log.h"
16 
17 class ProcessMonitor;
18 
19 // Internal codes for all powerpc registers.
20 enum {
60 
96 
133 
138 };
139 
141 public:
143  lldb_private::Thread &thread, uint32_t concrete_frame_idx,
144  lldb_private::RegisterInfoInterface *register_info);
145 
147 
148  void Invalidate();
149 
150  void InvalidateAllRegisters() override;
151 
152  size_t GetRegisterCount() override;
153 
154  virtual size_t GetGPRSize();
155 
156  virtual unsigned GetRegisterSize(unsigned reg);
157 
158  virtual unsigned GetRegisterOffset(unsigned reg);
159 
160  const lldb_private::RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override;
161 
162  size_t GetRegisterSetCount() override;
163 
164  const lldb_private::RegisterSet *GetRegisterSet(size_t set) override;
165 
166  const char *GetRegisterName(unsigned reg);
167 
169  uint32_t num) override;
170 
171 protected:
172  uint64_t
173  m_gpr_powerpc[k_num_gpr_registers_powerpc]; // general purpose registers.
174  uint64_t
175  m_fpr_powerpc[k_num_fpr_registers_powerpc]; // floating point registers.
177  std::unique_ptr<lldb_private::RegisterInfoInterface>
178  m_register_info_up; // Register Info Interface (FreeBSD or Linux)
179 
180  // Determines if an extended register set is supported on the processor
181  // running the inferior process.
182  virtual bool IsRegisterSetAvailable(size_t set_index);
183 
184  virtual const lldb_private::RegisterInfo *GetRegisterInfo();
185 
186  bool IsGPR(unsigned reg);
187 
188  bool IsFPR(unsigned reg);
189 
190  bool IsVMX(unsigned reg);
191 
193 
194  virtual bool ReadGPR() = 0;
195  virtual bool ReadFPR() = 0;
196  virtual bool ReadVMX() = 0;
197  virtual bool WriteGPR() = 0;
198  virtual bool WriteFPR() = 0;
199  virtual bool WriteVMX() = 0;
200 };
201 
202 #endif // liblldb_RegisterContextPOSIX_powerpc_h_
virtual unsigned GetRegisterOffset(unsigned reg)
uint64_t m_gpr_powerpc[k_num_gpr_registers_powerpc]
uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override
Convert from a given register numbering scheme to the lldb register numbering scheme.
RegisterInfo interface to patch RegisterInfo structure for archs.
uint64_t m_fpr_powerpc[k_num_fpr_registers_powerpc]
const lldb_private::RegisterSet * GetRegisterSet(size_t set) override
Manages communication with the inferior (debugee) process.
virtual bool IsRegisterSetAvailable(size_t set_index)
std::unique_ptr< lldb_private::RegisterInfoInterface > m_register_info_up
uint32_t m_vmx_powerpc[k_num_vmx_registers_powerpc][4]
virtual const lldb_private::RegisterInfo * GetRegisterInfo()
virtual unsigned GetRegisterSize(unsigned reg)
const char * GetRegisterName(unsigned reg)
RegisterContextPOSIX_powerpc(lldb_private::Thread &thread, uint32_t concrete_frame_idx, lldb_private::RegisterInfoInterface *register_info)
const lldb_private::RegisterInfo * GetRegisterInfoAtIndex(size_t reg) override