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 LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_POWERPC_H
10 #define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_POWERPC_H
11 
13 #include "RegisterInfoInterface.h"
15 #include "lldb/Utility/Log.h"
16 
17 // Internal codes for all powerpc registers.
18 enum {
58 
94 
131 
136 };
137 
139 public:
141  lldb_private::Thread &thread, uint32_t concrete_frame_idx,
142  lldb_private::RegisterInfoInterface *register_info);
143 
145 
146  void Invalidate();
147 
148  void InvalidateAllRegisters() override;
149 
150  size_t GetRegisterCount() override;
151 
152  virtual size_t GetGPRSize();
153 
154  virtual unsigned GetRegisterSize(unsigned reg);
155 
156  virtual unsigned GetRegisterOffset(unsigned reg);
157 
158  const lldb_private::RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override;
159 
160  size_t GetRegisterSetCount() override;
161 
162  const lldb_private::RegisterSet *GetRegisterSet(size_t set) override;
163 
164  const char *GetRegisterName(unsigned reg);
165 
166 protected:
167  uint64_t
168  m_gpr_powerpc[k_num_gpr_registers_powerpc]; // general purpose registers.
169  uint64_t
170  m_fpr_powerpc[k_num_fpr_registers_powerpc]; // floating point registers.
172  std::unique_ptr<lldb_private::RegisterInfoInterface>
173  m_register_info_up; // Register Info Interface (FreeBSD or Linux)
174 
175  // Determines if an extended register set is supported on the processor
176  // running the inferior process.
177  virtual bool IsRegisterSetAvailable(size_t set_index);
178 
179  virtual const lldb_private::RegisterInfo *GetRegisterInfo();
180 
181  bool IsGPR(unsigned reg);
182 
183  bool IsFPR(unsigned reg);
184 
185  bool IsVMX(unsigned reg);
186 
187  virtual bool ReadGPR() = 0;
188  virtual bool ReadFPR() = 0;
189  virtual bool ReadVMX() = 0;
190  virtual bool WriteGPR() = 0;
191  virtual bool WriteFPR() = 0;
192  virtual bool WriteVMX() = 0;
193 };
194 
195 #endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_POWERPC_H
vmx_v12_powerpc
@ vmx_v12_powerpc
Definition: RegisterContextPOSIX_powerpc.h:108
vmx_v1_powerpc
@ vmx_v1_powerpc
Definition: RegisterContextPOSIX_powerpc.h:97
fpr_f2_powerpc
@ fpr_f2_powerpc
Definition: RegisterContextPOSIX_powerpc.h:62
vmx_v17_powerpc
@ vmx_v17_powerpc
Definition: RegisterContextPOSIX_powerpc.h:113
RegisterContextPOSIX_powerpc::GetRegisterInfoAtIndex
const lldb_private::RegisterInfo * GetRegisterInfoAtIndex(size_t reg) override
Definition: RegisterContextPOSIX_powerpc.cpp:131
gpr_r28_powerpc
@ gpr_r28_powerpc
Definition: RegisterContextPOSIX_powerpc.h:48
vmx_v19_powerpc
@ vmx_v19_powerpc
Definition: RegisterContextPOSIX_powerpc.h:115
gpr_r26_powerpc
@ gpr_r26_powerpc
Definition: RegisterContextPOSIX_powerpc.h:46
gpr_r4_powerpc
@ gpr_r4_powerpc
Definition: RegisterContextPOSIX_powerpc.h:24
gpr_r2_powerpc
@ gpr_r2_powerpc
Definition: RegisterContextPOSIX_powerpc.h:22
fpr_f21_powerpc
@ fpr_f21_powerpc
Definition: RegisterContextPOSIX_powerpc.h:81
gpr_r3_powerpc
@ gpr_r3_powerpc
Definition: RegisterContextPOSIX_powerpc.h:23
fpr_f0_powerpc
@ fpr_f0_powerpc
Definition: RegisterContextPOSIX_powerpc.h:60
fpr_f10_powerpc
@ fpr_f10_powerpc
Definition: RegisterContextPOSIX_powerpc.h:70
gpr_r25_powerpc
@ gpr_r25_powerpc
Definition: RegisterContextPOSIX_powerpc.h:45
fpr_f27_powerpc
@ fpr_f27_powerpc
Definition: RegisterContextPOSIX_powerpc.h:87
RegisterContextPOSIX_powerpc::InvalidateAllRegisters
void InvalidateAllRegisters() override
Definition: RegisterContextPOSIX_powerpc.cpp:102
vmx_v3_powerpc
@ vmx_v3_powerpc
Definition: RegisterContextPOSIX_powerpc.h:99
fpr_f19_powerpc
@ fpr_f19_powerpc
Definition: RegisterContextPOSIX_powerpc.h:79
vmx_v22_powerpc
@ vmx_v22_powerpc
Definition: RegisterContextPOSIX_powerpc.h:118
vmx_v6_powerpc
@ vmx_v6_powerpc
Definition: RegisterContextPOSIX_powerpc.h:102
fpr_f22_powerpc
@ fpr_f22_powerpc
Definition: RegisterContextPOSIX_powerpc.h:82
vmx_v29_powerpc
@ vmx_v29_powerpc
Definition: RegisterContextPOSIX_powerpc.h:125
k_first_gpr_powerpc
@ k_first_gpr_powerpc
Definition: RegisterContextPOSIX_powerpc.h:19
gpr_r11_powerpc
@ gpr_r11_powerpc
Definition: RegisterContextPOSIX_powerpc.h:31
vmx_v27_powerpc
@ vmx_v27_powerpc
Definition: RegisterContextPOSIX_powerpc.h:123
RegisterContextPOSIX_powerpc::GetRegisterSetCount
size_t GetRegisterSetCount() override
Definition: RegisterContextPOSIX_powerpc.cpp:138
fpr_f15_powerpc
@ fpr_f15_powerpc
Definition: RegisterContextPOSIX_powerpc.h:75
k_last_vmx
@ k_last_vmx
Definition: RegisterContextPOSIX_powerpc.h:130
vmx_v0_powerpc
@ vmx_v0_powerpc
Definition: RegisterContextPOSIX_powerpc.h:96
fpr_f7_powerpc
@ fpr_f7_powerpc
Definition: RegisterContextPOSIX_powerpc.h:67
fpr_f23_powerpc
@ fpr_f23_powerpc
Definition: RegisterContextPOSIX_powerpc.h:83
fpr_f17_powerpc
@ fpr_f17_powerpc
Definition: RegisterContextPOSIX_powerpc.h:77
RegisterContextPOSIX_powerpc::m_fpr_powerpc
uint64_t m_fpr_powerpc[k_num_fpr_registers_powerpc]
Definition: RegisterContextPOSIX_powerpc.h:170
fpr_f20_powerpc
@ fpr_f20_powerpc
Definition: RegisterContextPOSIX_powerpc.h:80
fpr_f24_powerpc
@ fpr_f24_powerpc
Definition: RegisterContextPOSIX_powerpc.h:84
RegisterContextPOSIX_powerpc::GetRegisterCount
size_t GetRegisterCount() override
Definition: RegisterContextPOSIX_powerpc.cpp:114
lldb_private::RegisterInfoInterface
Definition: RegisterInfoInterface.h:21
RegisterContextPOSIX_powerpc::Invalidate
void Invalidate()
Definition: RegisterContextPOSIX_powerpc.cpp:100
RegisterContextPOSIX_powerpc::GetRegisterOffset
virtual unsigned GetRegisterOffset(unsigned reg)
Definition: RegisterContextPOSIX_powerpc.cpp:104
RegisterContextPOSIX_powerpc::WriteFPR
virtual bool WriteFPR()=0
vmx_v7_powerpc
@ vmx_v7_powerpc
Definition: RegisterContextPOSIX_powerpc.h:103
k_num_gpr_registers_powerpc
@ k_num_gpr_registers_powerpc
Definition: RegisterContextPOSIX_powerpc.h:133
gpr_r5_powerpc
@ gpr_r5_powerpc
Definition: RegisterContextPOSIX_powerpc.h:25
RegisterContextPOSIX_powerpc::m_gpr_powerpc
uint64_t m_gpr_powerpc[k_num_gpr_registers_powerpc]
Definition: RegisterContextPOSIX_powerpc.h:168
vmx_v18_powerpc
@ vmx_v18_powerpc
Definition: RegisterContextPOSIX_powerpc.h:114
RegisterContextPOSIX_powerpc::IsVMX
bool IsVMX(unsigned reg)
Definition: RegisterContextPOSIX_powerpc.cpp:87
k_first_fpr
@ k_first_fpr
Definition: RegisterContextPOSIX_powerpc.h:59
vmx_v31_powerpc
@ vmx_v31_powerpc
Definition: RegisterContextPOSIX_powerpc.h:127
gpr_xer_powerpc
@ gpr_xer_powerpc
Definition: RegisterContextPOSIX_powerpc.h:54
gpr_r14_powerpc
@ gpr_r14_powerpc
Definition: RegisterContextPOSIX_powerpc.h:34
k_first_vmx
@ k_first_vmx
Definition: RegisterContextPOSIX_powerpc.h:95
vmx_v30_powerpc
@ vmx_v30_powerpc
Definition: RegisterContextPOSIX_powerpc.h:126
vmx_v11_powerpc
@ vmx_v11_powerpc
Definition: RegisterContextPOSIX_powerpc.h:107
fpr_f1_powerpc
@ fpr_f1_powerpc
Definition: RegisterContextPOSIX_powerpc.h:61
RegisterContextPOSIX_powerpc::GetGPRSize
virtual size_t GetGPRSize()
Definition: RegisterContextPOSIX_powerpc.cpp:119
fpr_fpscr_powerpc
@ fpr_fpscr_powerpc
Definition: RegisterContextPOSIX_powerpc.h:92
RegisterInfoInterface.h
k_last_fpr
@ k_last_fpr
Definition: RegisterContextPOSIX_powerpc.h:93
RegisterContextPOSIX_powerpc::GetRegisterSet
const lldb_private::RegisterSet * GetRegisterSet(size_t set) override
Definition: RegisterContextPOSIX_powerpc.cpp:148
gpr_r10_powerpc
@ gpr_r10_powerpc
Definition: RegisterContextPOSIX_powerpc.h:30
gpr_r16_powerpc
@ gpr_r16_powerpc
Definition: RegisterContextPOSIX_powerpc.h:36
gpr_r30_powerpc
@ gpr_r30_powerpc
Definition: RegisterContextPOSIX_powerpc.h:50
fpr_f8_powerpc
@ fpr_f8_powerpc
Definition: RegisterContextPOSIX_powerpc.h:68
fpr_f26_powerpc
@ fpr_f26_powerpc
Definition: RegisterContextPOSIX_powerpc.h:86
gpr_r19_powerpc
@ gpr_r19_powerpc
Definition: RegisterContextPOSIX_powerpc.h:39
fpr_f11_powerpc
@ fpr_f11_powerpc
Definition: RegisterContextPOSIX_powerpc.h:71
k_last_gpr_powerpc
@ k_last_gpr_powerpc
Definition: RegisterContextPOSIX_powerpc.h:57
gpr_r9_powerpc
@ gpr_r9_powerpc
Definition: RegisterContextPOSIX_powerpc.h:29
gpr_r18_powerpc
@ gpr_r18_powerpc
Definition: RegisterContextPOSIX_powerpc.h:38
vmx_v13_powerpc
@ vmx_v13_powerpc
Definition: RegisterContextPOSIX_powerpc.h:109
Log.h
gpr_r12_powerpc
@ gpr_r12_powerpc
Definition: RegisterContextPOSIX_powerpc.h:32
gpr_r29_powerpc
@ gpr_r29_powerpc
Definition: RegisterContextPOSIX_powerpc.h:49
k_num_fpr_registers_powerpc
@ k_num_fpr_registers_powerpc
Definition: RegisterContextPOSIX_powerpc.h:134
lldb_private::Thread
Definition: Thread.h:62
RegisterContextPOSIX_powerpc::ReadVMX
virtual bool ReadVMX()=0
fpr_f4_powerpc
@ fpr_f4_powerpc
Definition: RegisterContextPOSIX_powerpc.h:64
vmx_vrsave_powerpc
@ vmx_vrsave_powerpc
Definition: RegisterContextPOSIX_powerpc.h:128
RegisterContext_powerpc.h
gpr_r21_powerpc
@ gpr_r21_powerpc
Definition: RegisterContextPOSIX_powerpc.h:41
gpr_r1_powerpc
@ gpr_r1_powerpc
Definition: RegisterContextPOSIX_powerpc.h:21
RegisterContextPOSIX_powerpc::WriteGPR
virtual bool WriteGPR()=0
RegisterContextPOSIX_powerpc::GetRegisterInfo
virtual const lldb_private::RegisterInfo * GetRegisterInfo()
Definition: RegisterContextPOSIX_powerpc.cpp:123
vmx_v9_powerpc
@ vmx_v9_powerpc
Definition: RegisterContextPOSIX_powerpc.h:105
vmx_v10_powerpc
@ vmx_v10_powerpc
Definition: RegisterContextPOSIX_powerpc.h:106
gpr_r23_powerpc
@ gpr_r23_powerpc
Definition: RegisterContextPOSIX_powerpc.h:43
RegisterContextPOSIX_powerpc::IsRegisterSetAvailable
virtual bool IsRegisterSetAvailable(size_t set_index)
Definition: RegisterContextPOSIX_powerpc.cpp:160
gpr_cr_powerpc
@ gpr_cr_powerpc
Definition: RegisterContextPOSIX_powerpc.h:53
fpr_f28_powerpc
@ fpr_f28_powerpc
Definition: RegisterContextPOSIX_powerpc.h:88
fpr_f12_powerpc
@ fpr_f12_powerpc
Definition: RegisterContextPOSIX_powerpc.h:72
fpr_f25_powerpc
@ fpr_f25_powerpc
Definition: RegisterContextPOSIX_powerpc.h:85
RegisterContextPOSIX_powerpc::m_register_info_up
std::unique_ptr< lldb_private::RegisterInfoInterface > m_register_info_up
Definition: RegisterContextPOSIX_powerpc.h:173
vmx_v20_powerpc
@ vmx_v20_powerpc
Definition: RegisterContextPOSIX_powerpc.h:116
gpr_r22_powerpc
@ gpr_r22_powerpc
Definition: RegisterContextPOSIX_powerpc.h:42
RegisterContextPOSIX_powerpc::IsGPR
bool IsGPR(unsigned reg)
Definition: RegisterContextPOSIX_powerpc.cpp:79
gpr_r27_powerpc
@ gpr_r27_powerpc
Definition: RegisterContextPOSIX_powerpc.h:47
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_powerpc::IsFPR
bool IsFPR(unsigned reg)
Definition: RegisterContextPOSIX_powerpc.cpp:83
vmx_v25_powerpc
@ vmx_v25_powerpc
Definition: RegisterContextPOSIX_powerpc.h:121
lldb_private::RegisterContext
Definition: RegisterContext.h:17
RegisterContextPOSIX_powerpc
Definition: RegisterContextPOSIX_powerpc.h:138
vmx_v24_powerpc
@ vmx_v24_powerpc
Definition: RegisterContextPOSIX_powerpc.h:120
fpr_f29_powerpc
@ fpr_f29_powerpc
Definition: RegisterContextPOSIX_powerpc.h:89
fpr_f31_powerpc
@ fpr_f31_powerpc
Definition: RegisterContextPOSIX_powerpc.h:91
vmx_v16_powerpc
@ vmx_v16_powerpc
Definition: RegisterContextPOSIX_powerpc.h:112
vmx_v4_powerpc
@ vmx_v4_powerpc
Definition: RegisterContextPOSIX_powerpc.h:100
vmx_v28_powerpc
@ vmx_v28_powerpc
Definition: RegisterContextPOSIX_powerpc.h:124
vmx_v14_powerpc
@ vmx_v14_powerpc
Definition: RegisterContextPOSIX_powerpc.h:110
gpr_r17_powerpc
@ gpr_r17_powerpc
Definition: RegisterContextPOSIX_powerpc.h:37
gpr_r6_powerpc
@ gpr_r6_powerpc
Definition: RegisterContextPOSIX_powerpc.h:26
fpr_f16_powerpc
@ fpr_f16_powerpc
Definition: RegisterContextPOSIX_powerpc.h:76
gpr_r24_powerpc
@ gpr_r24_powerpc
Definition: RegisterContextPOSIX_powerpc.h:44
k_num_vmx_registers_powerpc
@ k_num_vmx_registers_powerpc
Definition: RegisterContextPOSIX_powerpc.h:135
RegisterContextPOSIX_powerpc::GetRegisterName
const char * GetRegisterName(unsigned reg)
Definition: RegisterContextPOSIX_powerpc.cpp:155
uint32_t
vmx_v26_powerpc
@ vmx_v26_powerpc
Definition: RegisterContextPOSIX_powerpc.h:122
vmx_vscr_powerpc
@ vmx_vscr_powerpc
Definition: RegisterContextPOSIX_powerpc.h:129
gpr_r31_powerpc
@ gpr_r31_powerpc
Definition: RegisterContextPOSIX_powerpc.h:51
RegisterContextPOSIX_powerpc::m_vmx_powerpc
uint32_t m_vmx_powerpc[k_num_vmx_registers_powerpc][4]
Definition: RegisterContextPOSIX_powerpc.h:171
vmx_v23_powerpc
@ vmx_v23_powerpc
Definition: RegisterContextPOSIX_powerpc.h:119
RegisterContextPOSIX_powerpc::ReadGPR
virtual bool ReadGPR()=0
fpr_f30_powerpc
@ fpr_f30_powerpc
Definition: RegisterContextPOSIX_powerpc.h:90
fpr_f6_powerpc
@ fpr_f6_powerpc
Definition: RegisterContextPOSIX_powerpc.h:66
fpr_f3_powerpc
@ fpr_f3_powerpc
Definition: RegisterContextPOSIX_powerpc.h:63
RegisterContextPOSIX_powerpc::GetRegisterSize
virtual unsigned GetRegisterSize(unsigned reg)
Definition: RegisterContextPOSIX_powerpc.cpp:109
fpr_f9_powerpc
@ fpr_f9_powerpc
Definition: RegisterContextPOSIX_powerpc.h:69
fpr_f13_powerpc
@ fpr_f13_powerpc
Definition: RegisterContextPOSIX_powerpc.h:73
RegisterContextPOSIX_powerpc::~RegisterContextPOSIX_powerpc
~RegisterContextPOSIX_powerpc() override
Definition: RegisterContextPOSIX_powerpc.cpp:98
fpr_f5_powerpc
@ fpr_f5_powerpc
Definition: RegisterContextPOSIX_powerpc.h:65
vmx_v8_powerpc
@ vmx_v8_powerpc
Definition: RegisterContextPOSIX_powerpc.h:104
gpr_pc_powerpc
@ gpr_pc_powerpc
Definition: RegisterContextPOSIX_powerpc.h:56
vmx_v2_powerpc
@ vmx_v2_powerpc
Definition: RegisterContextPOSIX_powerpc.h:98
RegisterContextPOSIX_powerpc::ReadFPR
virtual bool ReadFPR()=0
gpr_r0_powerpc
@ gpr_r0_powerpc
Definition: RegisterContextPOSIX_powerpc.h:20
gpr_r13_powerpc
@ gpr_r13_powerpc
Definition: RegisterContextPOSIX_powerpc.h:33
gpr_r20_powerpc
@ gpr_r20_powerpc
Definition: RegisterContextPOSIX_powerpc.h:40
gpr_ctr_powerpc
@ gpr_ctr_powerpc
Definition: RegisterContextPOSIX_powerpc.h:55
k_num_registers_powerpc
@ k_num_registers_powerpc
Definition: RegisterContextPOSIX_powerpc.h:132
gpr_r7_powerpc
@ gpr_r7_powerpc
Definition: RegisterContextPOSIX_powerpc.h:27
RegisterContextPOSIX_powerpc::WriteVMX
virtual bool WriteVMX()=0
gpr_r8_powerpc
@ gpr_r8_powerpc
Definition: RegisterContextPOSIX_powerpc.h:28
vmx_v15_powerpc
@ vmx_v15_powerpc
Definition: RegisterContextPOSIX_powerpc.h:111
vmx_v5_powerpc
@ vmx_v5_powerpc
Definition: RegisterContextPOSIX_powerpc.h:101
gpr_lr_powerpc
@ gpr_lr_powerpc
Definition: RegisterContextPOSIX_powerpc.h:52
fpr_f18_powerpc
@ fpr_f18_powerpc
Definition: RegisterContextPOSIX_powerpc.h:78
gpr_r15_powerpc
@ gpr_r15_powerpc
Definition: RegisterContextPOSIX_powerpc.h:35
RegisterContext.h
fpr_f14_powerpc
@ fpr_f14_powerpc
Definition: RegisterContextPOSIX_powerpc.h:74
RegisterContextPOSIX_powerpc::RegisterContextPOSIX_powerpc
RegisterContextPOSIX_powerpc(lldb_private::Thread &thread, uint32_t concrete_frame_idx, lldb_private::RegisterInfoInterface *register_info)
Definition: RegisterContextPOSIX_powerpc.cpp:91
vmx_v21_powerpc
@ vmx_v21_powerpc
Definition: RegisterContextPOSIX_powerpc.h:117