LLDB  mainline
RegisterContextFreeBSD_powerpc.cpp
Go to the documentation of this file.
1 //===-- RegisterContextFreeBSD_powerpc.cpp --------------------------------===//
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 
11 #include <vector>
12 
13 using namespace lldb_private;
14 using namespace lldb;
15 
16 // http://svnweb.freebsd.org/base/head/sys/powerpc/include/reg.h
17 typedef struct _GPR64 {
18  uint64_t r0;
19  uint64_t r1;
20  uint64_t r2;
21  uint64_t r3;
22  uint64_t r4;
23  uint64_t r5;
24  uint64_t r6;
25  uint64_t r7;
26  uint64_t r8;
27  uint64_t r9;
28  uint64_t r10;
29  uint64_t r11;
30  uint64_t r12;
31  uint64_t r13;
32  uint64_t r14;
33  uint64_t r15;
34  uint64_t r16;
35  uint64_t r17;
36  uint64_t r18;
37  uint64_t r19;
38  uint64_t r20;
39  uint64_t r21;
40  uint64_t r22;
41  uint64_t r23;
42  uint64_t r24;
43  uint64_t r25;
44  uint64_t r26;
45  uint64_t r27;
46  uint64_t r28;
47  uint64_t r29;
48  uint64_t r30;
49  uint64_t r31;
50  uint64_t lr;
51  uint64_t cr;
52  uint64_t xer;
53  uint64_t ctr;
54  uint64_t pc;
55 } GPR64;
56 
57 typedef struct _GPR32 {
95 } GPR32;
96 
97 typedef struct _FPR {
98  uint64_t f0;
99  uint64_t f1;
100  uint64_t f2;
101  uint64_t f3;
102  uint64_t f4;
103  uint64_t f5;
104  uint64_t f6;
105  uint64_t f7;
106  uint64_t f8;
107  uint64_t f9;
108  uint64_t f10;
109  uint64_t f11;
110  uint64_t f12;
111  uint64_t f13;
112  uint64_t f14;
113  uint64_t f15;
114  uint64_t f16;
115  uint64_t f17;
116  uint64_t f18;
117  uint64_t f19;
118  uint64_t f20;
119  uint64_t f21;
120  uint64_t f22;
121  uint64_t f23;
122  uint64_t f24;
123  uint64_t f25;
124  uint64_t f26;
125  uint64_t f27;
126  uint64_t f28;
127  uint64_t f29;
128  uint64_t f30;
129  uint64_t f31;
130  uint64_t fpscr;
131 } FPR;
132 
133 typedef struct _VMX {
166  uint32_t pad[2];
169 } VMX;
170 
171 // Include RegisterInfos_powerpc to declare our g_register_infos_powerpc
172 // structure.
173 #define DECLARE_REGISTER_INFOS_POWERPC_STRUCT
174 #include "RegisterInfos_powerpc.h"
175 #undef DECLARE_REGISTER_INFOS_POWERPC_STRUCT
176 
178  const ArchSpec &target_arch)
179  : RegisterInfoInterface(target_arch) {}
180 
182 
184  // This is an 'abstract' base, so no GPR struct.
185  return 0;
186 }
187 
189  // assert (m_target_arch.GetCore() == ArchSpec::eCore_powerpc);
190  llvm_unreachable("Abstract class!");
191  return nullptr;
192 }
193 
195 
197  const ArchSpec &target_arch)
198  : RegisterContextFreeBSD_powerpc(target_arch) {}
199 
201 
203  return sizeof(GPR32);
204 }
205 
207  // assert (m_target_arch.GetCore() == ArchSpec::eCore_powerpc);
208  return g_register_infos_powerpc32;
209 }
210 
212  return static_cast<uint32_t>(sizeof(g_register_infos_powerpc32) /
213  sizeof(g_register_infos_powerpc32[0]));
214 }
215 
217  const ArchSpec &target_arch)
218  : RegisterContextFreeBSD_powerpc(target_arch) {}
219 
221 
223  return sizeof(GPR64);
224 }
225 
227  // assert (m_target_arch.GetCore() == ArchSpec::eCore_powerpc);
228  if (m_target_arch.GetMachine() == llvm::Triple::ppc)
229  return g_register_infos_powerpc64_32;
230  return g_register_infos_powerpc64;
231 }
232 
234  return static_cast<uint32_t>(sizeof(g_register_infos_powerpc64) /
235  sizeof(g_register_infos_powerpc64[0]));
236 }
lldb_private::RegisterInfoInterface::m_target_arch
lldb_private::ArchSpec m_target_arch
Definition: RegisterInfoInterface.h:65
_FPR
Definition: RegisterContextFreeBSD_mips64.cpp:108
arm64_dwarf::v5
@ v5
Definition: ARM64_DWARF_Registers.h:86
_GPR32::r4
uint32_t r4
Definition: RegisterContextFreeBSD_powerpc.cpp:62
_GPR64::r3
uint64_t r3
Definition: RegisterContextFreeBSD_powerpc.cpp:21
_GPR64::r17
uint64_t r17
Definition: RegisterContextFreeBSD_powerpc.cpp:35
v12
@ v12
Definition: CompactUnwindInfo.cpp:1261
_GPR64::r11
uint64_t r11
Definition: RegisterContextFreeBSD_powerpc.cpp:29
RegisterContextFreeBSD_powerpc
Definition: RegisterContextFreeBSD_powerpc.h:15
GPR32
struct _GPR32 GPR32
lldb_private::ArchSpec
Definition: ArchSpec.h:33
_GPR64::r27
uint64_t r27
Definition: RegisterContextFreeBSD_powerpc.cpp:45
arm64_dwarf::v20
@ v20
Definition: ARM64_DWARF_Registers.h:101
_GPR64::r7
uint64_t r7
Definition: RegisterContextFreeBSD_powerpc.cpp:25
v10
@ v10
Definition: CompactUnwindInfo.cpp:1259
_GPR32::r5
uint32_t r5
Definition: RegisterContextFreeBSD_powerpc.cpp:63
lldb_private::ArchSpec::GetMachine
llvm::Triple::ArchType GetMachine() const
Returns a machine family for the current architecture.
Definition: ArchSpec.cpp:667
arm64_dwarf::v22
@ v22
Definition: ARM64_DWARF_Registers.h:103
_GPR64::r19
uint64_t r19
Definition: RegisterContextFreeBSD_powerpc.cpp:37
_VMX::vrsave
uint32_t vrsave
Definition: RegisterContextFreeBSD_powerpc.cpp:167
_GPR32::r17
uint32_t r17
Definition: RegisterContextFreeBSD_powerpc.cpp:75
_GPR64::r29
uint64_t r29
Definition: RegisterContextFreeBSD_powerpc.cpp:47
_GPR64::r6
uint64_t r6
Definition: RegisterContextFreeBSD_powerpc.cpp:24
lldb_private::RegisterInfoInterface
Definition: RegisterInfoInterface.h:21
arm64_dwarf::v16
@ v16
Definition: ARM64_DWARF_Registers.h:97
RegisterContextFreeBSD_powerpc64::GetRegisterInfo
const lldb_private::RegisterInfo * GetRegisterInfo() const override
Definition: RegisterContextFreeBSD_powerpc.cpp:226
_GPR32::r20
uint32_t r20
Definition: RegisterContextFreeBSD_powerpc.cpp:78
RegisterContextFreeBSD_powerpc64::GetRegisterCount
uint32_t GetRegisterCount() const override
Definition: RegisterContextFreeBSD_powerpc.cpp:233
RegisterContextFreeBSD_powerpc.h
_GPR32::r23
uint32_t r23
Definition: RegisterContextFreeBSD_powerpc.cpp:81
_GPR32::r25
uint32_t r25
Definition: RegisterContextFreeBSD_powerpc.cpp:83
_GPR32::r14
uint32_t r14
Definition: RegisterContextFreeBSD_powerpc.cpp:72
_GPR64::r28
uint64_t r28
Definition: RegisterContextFreeBSD_powerpc.cpp:46
_GPR32::r1
uint32_t r1
Definition: RegisterContextFreeBSD_powerpc.cpp:59
_GPR64::r10
uint64_t r10
Definition: RegisterContextFreeBSD_powerpc.cpp:28
_GPR32::r26
uint32_t r26
Definition: RegisterContextFreeBSD_powerpc.cpp:84
v9
@ v9
Definition: CompactUnwindInfo.cpp:1258
_GPR32::r27
uint32_t r27
Definition: RegisterContextFreeBSD_powerpc.cpp:85
_GPR32::xer
uint32_t xer
Definition: RegisterContextFreeBSD_powerpc.cpp:92
_GPR64::r4
uint64_t r4
Definition: RegisterContextFreeBSD_powerpc.cpp:22
RegisterContextFreeBSD_powerpc64::RegisterContextFreeBSD_powerpc64
RegisterContextFreeBSD_powerpc64(const lldb_private::ArchSpec &target_arch)
Definition: RegisterContextFreeBSD_powerpc.cpp:216
_VMX::vscr
uint32_t vscr
Definition: RegisterContextFreeBSD_powerpc.cpp:168
_GPR32::r3
uint32_t r3
Definition: RegisterContextFreeBSD_powerpc.cpp:61
_GPR64::r31
uint64_t r31
Definition: RegisterContextFreeBSD_powerpc.cpp:49
_GPR64::r5
uint64_t r5
Definition: RegisterContextFreeBSD_powerpc.cpp:23
arm64_dwarf::v24
@ v24
Definition: ARM64_DWARF_Registers.h:105
_GPR32::r18
uint32_t r18
Definition: RegisterContextFreeBSD_powerpc.cpp:76
RegisterContextFreeBSD_powerpc32::GetGPRSize
size_t GetGPRSize() const override
Definition: RegisterContextFreeBSD_powerpc.cpp:202
_GPR64::pc
uint64_t pc
Definition: RegisterContextFreeBSD_powerpc.cpp:54
arm64_dwarf::v27
@ v27
Definition: ARM64_DWARF_Registers.h:108
arm64_dwarf::v31
@ v31
Definition: ARM64_DWARF_Registers.h:112
_GPR64::r12
uint64_t r12
Definition: RegisterContextFreeBSD_powerpc.cpp:30
_GPR64::r0
uint64_t r0
Definition: RegisterContextFreeBSD_powerpc.cpp:18
RegisterContextFreeBSD_powerpc::RegisterContextFreeBSD_powerpc
RegisterContextFreeBSD_powerpc(const lldb_private::ArchSpec &target_arch)
Definition: RegisterContextFreeBSD_powerpc.cpp:177
_GPR32::ctr
uint32_t ctr
Definition: RegisterContextFreeBSD_powerpc.cpp:93
RegisterContextFreeBSD_powerpc32::GetRegisterCount
uint32_t GetRegisterCount() const override
Definition: RegisterContextFreeBSD_powerpc.cpp:211
_GPR64::r14
uint64_t r14
Definition: RegisterContextFreeBSD_powerpc.cpp:32
v13
@ v13
Definition: CompactUnwindInfo.cpp:1262
_GPR64::r18
uint64_t r18
Definition: RegisterContextFreeBSD_powerpc.cpp:36
arm64_dwarf::v6
@ v6
Definition: ARM64_DWARF_Registers.h:87
RegisterContextFreeBSD_powerpc::~RegisterContextFreeBSD_powerpc
~RegisterContextFreeBSD_powerpc() override
arm64_dwarf::v18
@ v18
Definition: ARM64_DWARF_Registers.h:99
_GPR64::r23
uint64_t r23
Definition: RegisterContextFreeBSD_powerpc.cpp:41
arm64_dwarf::v23
@ v23
Definition: ARM64_DWARF_Registers.h:104
RegisterContextFreeBSD_powerpc64::GetGPRSize
size_t GetGPRSize() const override
Definition: RegisterContextFreeBSD_powerpc.cpp:222
_GPR64::xer
uint64_t xer
Definition: RegisterContextFreeBSD_powerpc.cpp:52
_GPR32::r12
uint32_t r12
Definition: RegisterContextFreeBSD_powerpc.cpp:70
_GPR32::r6
uint32_t r6
Definition: RegisterContextFreeBSD_powerpc.cpp:64
_GPR32::r21
uint32_t r21
Definition: RegisterContextFreeBSD_powerpc.cpp:79
_VMX
Definition: RegisterContextFreeBSD_powerpc.cpp:133
arm64_dwarf::v19
@ v19
Definition: ARM64_DWARF_Registers.h:100
_FPR::fpscr
uint64_t fpscr
Definition: RegisterContextFreeBSD_powerpc.cpp:130
arm64_dwarf::v21
@ v21
Definition: ARM64_DWARF_Registers.h:102
_GPR32::r15
uint32_t r15
Definition: RegisterContextFreeBSD_powerpc.cpp:73
RegisterContextFreeBSD_powerpc::GetGPRSize
size_t GetGPRSize() const override
Definition: RegisterContextFreeBSD_powerpc.cpp:183
RegisterContextFreeBSD_powerpc::GetRegisterInfo
const lldb_private::RegisterInfo * GetRegisterInfo() const override
Definition: RegisterContextFreeBSD_powerpc.cpp:188
_GPR32::r22
uint32_t r22
Definition: RegisterContextFreeBSD_powerpc.cpp:80
FPR
struct _FPR FPR
_GPR32::r16
uint32_t r16
Definition: RegisterContextFreeBSD_powerpc.cpp:74
v15
@ v15
Definition: CompactUnwindInfo.cpp:1264
arm64_dwarf::v30
@ v30
Definition: ARM64_DWARF_Registers.h:111
RegisterContextFreeBSD_powerpc32::GetRegisterInfo
const lldb_private::RegisterInfo * GetRegisterInfo() const override
Definition: RegisterContextFreeBSD_powerpc.cpp:206
_GPR64::r22
uint64_t r22
Definition: RegisterContextFreeBSD_powerpc.cpp:40
_GPR64::r16
uint64_t r16
Definition: RegisterContextFreeBSD_powerpc.cpp:34
RegisterContextFreeBSD_powerpc::GetRegisterCount
uint32_t GetRegisterCount() const override
Definition: RegisterContextFreeBSD_powerpc.cpp:194
_GPR32::r24
uint32_t r24
Definition: RegisterContextFreeBSD_powerpc.cpp:82
_GPR64::r8
uint64_t r8
Definition: RegisterContextFreeBSD_powerpc.cpp:26
RegisterContextPOSIX_powerpc.h
v8
@ v8
Definition: CompactUnwindInfo.cpp:1257
_GPR32::lr
uint32_t lr
Definition: RegisterContextFreeBSD_powerpc.cpp:90
arm64_dwarf::v28
@ v28
Definition: ARM64_DWARF_Registers.h:109
arm64_dwarf::v17
@ v17
Definition: ARM64_DWARF_Registers.h:98
_GPR32
Definition: RegisterContextFreeBSD_powerpc.cpp:57
_GPR32::r13
uint32_t r13
Definition: RegisterContextFreeBSD_powerpc.cpp:71
_GPR32::cr
uint32_t cr
Definition: RegisterContextFreeBSD_powerpc.cpp:91
v11
@ v11
Definition: CompactUnwindInfo.cpp:1260
_GPR64::r13
uint64_t r13
Definition: RegisterContextFreeBSD_powerpc.cpp:31
_GPR32::r19
uint32_t r19
Definition: RegisterContextFreeBSD_powerpc.cpp:77
arm64_dwarf::v2
@ v2
Definition: ARM64_DWARF_Registers.h:83
_GPR64::r15
uint64_t r15
Definition: RegisterContextFreeBSD_powerpc.cpp:33
uint32_t
_GPR64::r25
uint64_t r25
Definition: RegisterContextFreeBSD_powerpc.cpp:43
_GPR32::r2
uint32_t r2
Definition: RegisterContextFreeBSD_powerpc.cpp:60
VMX
struct _VMX VMX
arm64_dwarf::v25
@ v25
Definition: ARM64_DWARF_Registers.h:106
_GPR32::r29
uint32_t r29
Definition: RegisterContextFreeBSD_powerpc.cpp:87
_GPR32::r7
uint32_t r7
Definition: RegisterContextFreeBSD_powerpc.cpp:65
_GPR32::r30
uint32_t r30
Definition: RegisterContextFreeBSD_powerpc.cpp:88
_GPR32::r10
uint32_t r10
Definition: RegisterContextFreeBSD_powerpc.cpp:68
RegisterContextFreeBSD_powerpc64::~RegisterContextFreeBSD_powerpc64
~RegisterContextFreeBSD_powerpc64() override
RegisterContextFreeBSD_powerpc32::~RegisterContextFreeBSD_powerpc32
~RegisterContextFreeBSD_powerpc32() override
_GPR32::r11
uint32_t r11
Definition: RegisterContextFreeBSD_powerpc.cpp:69
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
arm64_dwarf::v4
@ v4
Definition: ARM64_DWARF_Registers.h:85
arm64_dwarf::v3
@ v3
Definition: ARM64_DWARF_Registers.h:84
_GPR64::lr
uint64_t lr
Definition: RegisterContextFreeBSD_powerpc.cpp:50
_GPR32::r28
uint32_t r28
Definition: RegisterContextFreeBSD_powerpc.cpp:86
_GPR64::r30
uint64_t r30
Definition: RegisterContextFreeBSD_powerpc.cpp:48
arm64_dwarf::v1
@ v1
Definition: ARM64_DWARF_Registers.h:82
arm64_dwarf::v0
@ v0
Definition: ARM64_DWARF_Registers.h:81
arm64_dwarf::v26
@ v26
Definition: ARM64_DWARF_Registers.h:107
arm64_dwarf::v29
@ v29
Definition: ARM64_DWARF_Registers.h:110
_GPR32::r0
uint32_t r0
Definition: RegisterContextFreeBSD_powerpc.cpp:58
_GPR64::r2
uint64_t r2
Definition: RegisterContextFreeBSD_powerpc.cpp:20
_GPR64
Definition: RegisterContextFreeBSD_powerpc.cpp:17
_GPR64::cr
uint64_t cr
Definition: RegisterContextFreeBSD_powerpc.cpp:51
_GPR32::r8
uint32_t r8
Definition: RegisterContextFreeBSD_powerpc.cpp:66
_GPR32::r9
uint32_t r9
Definition: RegisterContextFreeBSD_powerpc.cpp:67
RegisterInfos_powerpc.h
_GPR64::r1
uint64_t r1
Definition: RegisterContextFreeBSD_powerpc.cpp:19
arm64_dwarf::v7
@ v7
Definition: ARM64_DWARF_Registers.h:88
_GPR64::r21
uint64_t r21
Definition: RegisterContextFreeBSD_powerpc.cpp:39
GPR64
struct _GPR64 GPR64
lldb
Definition: SBAddress.h:15
_GPR32::pc
uint32_t pc
Definition: RegisterContextFreeBSD_powerpc.cpp:94
RegisterContextFreeBSD_powerpc32::RegisterContextFreeBSD_powerpc32
RegisterContextFreeBSD_powerpc32(const lldb_private::ArchSpec &target_arch)
Definition: RegisterContextFreeBSD_powerpc.cpp:196
_GPR64::r26
uint64_t r26
Definition: RegisterContextFreeBSD_powerpc.cpp:44
v14
@ v14
Definition: CompactUnwindInfo.cpp:1263
_GPR64::r24
uint64_t r24
Definition: RegisterContextFreeBSD_powerpc.cpp:42
_GPR32::r31
uint32_t r31
Definition: RegisterContextFreeBSD_powerpc.cpp:89
_GPR64::ctr
uint64_t ctr
Definition: RegisterContextFreeBSD_powerpc.cpp:53
_GPR64::r20
uint64_t r20
Definition: RegisterContextFreeBSD_powerpc.cpp:38
_GPR64::r9
uint64_t r9
Definition: RegisterContextFreeBSD_powerpc.cpp:27