LLDB
mainline
llvm-project
lldb
source
Plugins
Process
Utility
RegisterInfoPOSIX_ppc64le.cpp
Go to the documentation of this file.
1
//===-- RegisterInfoPOSIX_ppc64le.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
16
#include "
RegisterInfoPOSIX_ppc64le.h
"
17
18
// Include RegisterInfoPOSIX_ppc64le to declare our g_register_infos_ppc64le
19
#define DECLARE_REGISTER_INFOS_PPC64LE_STRUCT
20
#include "
RegisterInfos_ppc64le.h
"
21
#undef DECLARE_REGISTER_INFOS_PPC64LE_STRUCT
22
23
static
const
lldb_private::RegisterInfo
*
24
GetRegisterInfoPtr
(
const
lldb_private::ArchSpec
&target_arch) {
25
switch
(target_arch.
GetMachine
()) {
26
case
llvm::Triple::ppc64le:
27
return
g_register_infos_ppc64le;
28
default
:
29
assert(
false
&&
"Unhandled target architecture."
);
30
return
nullptr
;
31
}
32
}
33
34
static
uint32_t
35
GetRegisterInfoCount
(
const
lldb_private::ArchSpec
&target_arch) {
36
switch
(target_arch.
GetMachine
()) {
37
case
llvm::Triple::ppc64le:
38
return
static_cast<
uint32_t
>
(
sizeof
(g_register_infos_ppc64le) /
39
sizeof
(g_register_infos_ppc64le[0]));
40
default
:
41
assert(
false
&&
"Unhandled target architecture."
);
42
return
0;
43
}
44
}
45
46
RegisterInfoPOSIX_ppc64le::RegisterInfoPOSIX_ppc64le
(
47
const
lldb_private::ArchSpec
&target_arch)
48
:
lldb_private
::
RegisterInfoInterface
(target_arch),
49
m_register_info_p
(
GetRegisterInfoPtr
(target_arch)),
50
m_register_info_count
(
GetRegisterInfoCount
(target_arch)) {}
51
52
size_t
RegisterInfoPOSIX_ppc64le::GetGPRSize
()
const
{
53
return
sizeof
(
GPR
);
54
}
55
56
const
lldb_private::RegisterInfo
*
57
RegisterInfoPOSIX_ppc64le::GetRegisterInfo
()
const
{
58
return
m_register_info_p
;
59
}
60
61
uint32_t
RegisterInfoPOSIX_ppc64le::GetRegisterCount
()
const
{
62
return
m_register_info_count
;
63
}
GPR
#define GPR(r16)
Definition
ABIX86.cpp:145
GetRegisterInfoPtr
static const RegisterInfo * GetRegisterInfoPtr(const ArchSpec &target_arch)
Definition
RegisterContextLinux_s390x.cpp:20
GetRegisterInfoCount
static uint32_t GetRegisterInfoCount(const ArchSpec &target_arch)
Definition
RegisterContextLinux_s390x.cpp:30
GetRegisterInfoCount
static uint32_t GetRegisterInfoCount(const lldb_private::ArchSpec &target_arch)
Definition
RegisterInfoPOSIX_ppc64le.cpp:35
GetRegisterInfoPtr
static const lldb_private::RegisterInfo * GetRegisterInfoPtr(const lldb_private::ArchSpec &target_arch)
Definition
RegisterInfoPOSIX_ppc64le.cpp:24
RegisterInfoPOSIX_ppc64le.h
RegisterInfos_ppc64le.h
RegisterInfoPOSIX_ppc64le::GetRegisterInfo
const lldb_private::RegisterInfo * GetRegisterInfo() const override
Definition
RegisterInfoPOSIX_ppc64le.cpp:57
RegisterInfoPOSIX_ppc64le::GetRegisterCount
uint32_t GetRegisterCount() const override
Definition
RegisterInfoPOSIX_ppc64le.cpp:61
RegisterInfoPOSIX_ppc64le::m_register_info_p
const lldb_private::RegisterInfo * m_register_info_p
Definition
RegisterInfoPOSIX_ppc64le.h:27
RegisterInfoPOSIX_ppc64le::GetGPRSize
size_t GetGPRSize() const override
Definition
RegisterInfoPOSIX_ppc64le.cpp:52
RegisterInfoPOSIX_ppc64le::m_register_info_count
uint32_t m_register_info_count
Definition
RegisterInfoPOSIX_ppc64le.h:28
RegisterInfoPOSIX_ppc64le::RegisterInfoPOSIX_ppc64le
RegisterInfoPOSIX_ppc64le(const lldb_private::ArchSpec &target_arch)
Definition
RegisterInfoPOSIX_ppc64le.cpp:46
lldb_private::ArchSpec
An architecture specification class.
Definition
ArchSpec.h:31
lldb_private::ArchSpec::GetMachine
llvm::Triple::ArchType GetMachine() const
Returns a machine family for the current architecture.
Definition
ArchSpec.cpp:677
lldb_private::RegisterInfoInterface::RegisterInfoInterface
RegisterInfoInterface(const lldb_private::ArchSpec &target_arch)
Definition
RegisterInfoInterface.h:23
lldb-defines.h
lldb_private
A class that represents a running process on the host machine.
Definition
SBAddressRange.h:14
lldb_private::RegisterInfo
Every register is described in detail including its name, alternate name (optional),...
Definition
lldb-private-types.h:37
Generated on
for LLDB by
1.14.0