LLDB mainline
RegisterInfoPOSIX_ppc64.cpp
Go to the documentation of this file.
1//===-- RegisterInfoPOSIX_ppc64.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
9#include <cassert>
10#include <cstddef>
11#include <vector>
12
13#include "lldb/lldb-defines.h"
14#include "llvm/Support/Compiler.h"
15
17
18// Include RegisterInfoPOSIX_ppc64 to declare our g_register_infos_ppc64
19#define DECLARE_REGISTER_INFOS_PPC64_STRUCT
20#include "RegisterInfos_ppc64.h"
21#undef DECLARE_REGISTER_INFOS_PPC64_STRUCT
22
23static const lldb_private::RegisterInfo *
25 switch (target_arch.GetMachine()) {
26 case llvm::Triple::ppc64:
27 return g_register_infos_ppc64;
28 default:
29 assert(false && "Unhandled target architecture.");
30 return nullptr;
31 }
32}
33
34static uint32_t
36 switch (target_arch.GetMachine()) {
37 case llvm::Triple::ppc64:
38 return static_cast<uint32_t>(sizeof(g_register_infos_ppc64) /
39 sizeof(g_register_infos_ppc64[0]));
40 default:
41 assert(false && "Unhandled target architecture.");
42 return 0;
43 }
44}
45
51
52size_t RegisterInfoPOSIX_ppc64::GetGPRSize() const { return sizeof(GPR_PPC64); }
53
58
static const RegisterInfo * GetRegisterInfoPtr(const ArchSpec &target_arch)
static uint32_t GetRegisterInfoCount(const ArchSpec &target_arch)
static uint32_t GetRegisterInfoCount(const lldb_private::ArchSpec &target_arch)
static const lldb_private::RegisterInfo * GetRegisterInfoPtr(const lldb_private::ArchSpec &target_arch)
RegisterInfoPOSIX_ppc64(const lldb_private::ArchSpec &target_arch)
uint32_t GetRegisterCount() const override
const lldb_private::RegisterInfo * GetRegisterInfo() const override
size_t GetGPRSize() const override
const lldb_private::RegisterInfo * m_register_info_p
An architecture specification class.
Definition ArchSpec.h:32
llvm::Triple::ArchType GetMachine() const
Returns a machine family for the current architecture.
Definition ArchSpec.cpp:673
RegisterInfoInterface(const lldb_private::ArchSpec &target_arch)
A class that represents a running process on the host machine.
Every register is described in detail including its name, alternate name (optional),...