LLDB  mainline
RegisterContextFreeBSD_powerpc.cpp
Go to the documentation of this file.
1 //===-- RegisterContextFreeBSD_powerpc.cpp ----------------------*- 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 
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 NULL;
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 }
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
RegisterInfo interface to patch RegisterInfo structure for archs.
An architecture specification class.
Definition: ArchSpec.h:32
const lldb_private::RegisterInfo * GetRegisterInfo() const override
const lldb_private::RegisterInfo * GetRegisterInfo() const override
struct _GPR32 GPR32
struct _GPR64 GPR64
RegisterContextFreeBSD_powerpc64(const lldb_private::ArchSpec &target_arch)
RegisterContextFreeBSD_powerpc(const lldb_private::ArchSpec &target_arch)
RegisterContextFreeBSD_powerpc32(const lldb_private::ArchSpec &target_arch)
Definition: SBAddress.h:15
const lldb_private::RegisterInfo * GetRegisterInfo() const override
struct _VMX VMX
llvm::Triple::ArchType GetMachine() const
Returns a machine family for the current architecture.
Definition: ArchSpec.cpp:726
struct _FPR FPR