LLDB mainline
RegisterContextCore_arm64.cpp
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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 <cerrno>
10#include <cstdint>
11#include <cstring>
12
13#include "lldb/Target/Process.h"
14#include "lldb/Target/Target.h"
15#include "lldb/Target/Thread.h"
18#include "lldb/Utility/Endian.h"
20#include "lldb/Utility/Scalar.h"
21#include "llvm/Support/Compiler.h"
22
24
25using namespace lldb;
26using namespace lldb_private;
27
29 if (m_register_info_up->GetRegisterSetFromRegisterIndex(reg) ==
31 return true;
32 return false;
33}
34
36 if (m_register_info_up->GetRegisterSetFromRegisterIndex(reg) ==
38 return true;
39 return false;
40}
41
42bool RegisterContextCore_arm64::IsSVE(unsigned reg) const {
43 return m_register_info_up->IsSVEReg(reg);
44}
45
46bool RegisterContextCore_arm64::IsSME(unsigned reg) const {
47 return m_register_info_up->IsSMEReg(reg);
48}
49
50bool RegisterContextCore_arm64::IsPAuth(unsigned reg) const {
51 return m_register_info_up->IsPAuthReg(reg);
52}
53
54bool RegisterContextCore_arm64::IsTLS(unsigned reg) const {
55 return m_register_info_up->IsTLSReg(reg);
56}
57
58bool RegisterContextCore_arm64::IsMTE(unsigned reg) const {
59 return m_register_info_up->IsMTEReg(reg);
60}
61
62bool RegisterContextCore_arm64::IsFPMR(unsigned reg) const {
63 return m_register_info_up->IsFPMRReg(reg);
64}
65
66bool RegisterContextCore_arm64::IsGCS(unsigned reg) const {
67 return m_register_info_up->IsGCSReg(reg);
68}
69
70bool RegisterContextCore_arm64::IsPOE(unsigned reg) const {
71 return m_register_info_up->IsPOEReg(reg);
72}
73
76 std::unique_ptr<RegisterInfo_arm64> register_info)
77 : lldb_private::RegisterContext(thread, 0),
78 m_register_info_up(std::move(register_info)) {}
79
81
83
85
87 return m_register_info_up->GetRegisterInfo()[reg].byte_offset;
88}
89
91 return m_register_info_up->GetRegisterInfo()[reg].byte_size;
92}
93
95 return m_register_info_up->GetRegisterCount();
96}
97
99 return m_register_info_up->GetGPRSize();
100}
101
103 // Commonly, this method is overridden and g_register_infos is copied and
104 // specialized. So, use GetRegisterInfo() rather than g_register_infos in
105 // this scope.
106 return m_register_info_up->GetRegisterInfo();
107}
108
111 if (reg < GetRegisterCount())
112 return &GetRegisterInfo()[reg];
113
114 return nullptr;
115}
116
118 return m_register_info_up->GetRegisterSetCount();
119}
120
123 return m_register_info_up->GetRegisterSet(set);
124}
125
127 if (reg < GetRegisterCount())
128 return GetRegisterInfo()[reg].name;
129 return nullptr;
130}
const lldb_private::RegisterInfo * GetRegisterInfoAtIndex(size_t reg) override
const char * GetRegisterName(unsigned reg)
virtual const lldb_private::RegisterInfo * GetRegisterInfo()
virtual unsigned GetRegisterOffset(unsigned reg)
RegisterContextCore_arm64(lldb_private::Thread &thread, std::unique_ptr< RegisterInfo_arm64 > register_info)
const lldb_private::RegisterSet * GetRegisterSet(size_t set) override
virtual unsigned GetRegisterSize(unsigned reg)
std::unique_ptr< RegisterInfo_arm64 > m_register_info_up
~RegisterContextCore_arm64() override
RegisterContext(Thread &thread, uint32_t concrete_frame_idx)
A class that represents a running process on the host machine.
Every register is described in detail including its name, alternate name (optional),...
const char * name
Name of this register, can't be NULL.
Registers are grouped into register sets.