LLDB mainline
RegisterContextPOSIX_arm64.cpp
Go to the documentation of this file.
1//===-- RegisterContextPOSIX_arm64.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 <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 RegisterContextPOSIX_arm64::IsSVE(unsigned reg) const {
43 return m_register_info_up->IsSVEReg(reg);
44}
45
46bool RegisterContextPOSIX_arm64::IsPAuth(unsigned reg) const {
47 return m_register_info_up->IsPAuthReg(reg);
48}
49
52 std::unique_ptr<RegisterInfoPOSIX_arm64> register_info)
53 : lldb_private::RegisterContext(thread, 0),
54 m_register_info_up(std::move(register_info)) {}
55
57
59
61
63 return m_register_info_up->GetRegisterInfo()[reg].byte_offset;
64}
65
67 return m_register_info_up->GetRegisterInfo()[reg].byte_size;
68}
69
71 return m_register_info_up->GetRegisterCount();
72}
73
75 return m_register_info_up->GetGPRSize();
76}
77
78const lldb_private::RegisterInfo *
80 // Commonly, this method is overridden and g_register_infos is copied and
81 // specialized. So, use GetRegisterInfo() rather than g_register_infos in
82 // this scope.
83 return m_register_info_up->GetRegisterInfo();
84}
85
86const lldb_private::RegisterInfo *
88 if (reg < GetRegisterCount())
89 return &GetRegisterInfo()[reg];
90
91 return nullptr;
92}
93
95 return m_register_info_up->GetRegisterSetCount();
96}
97
98const lldb_private::RegisterSet *
100 return m_register_info_up->GetRegisterSet(set);
101}
102
104 if (reg < GetRegisterCount())
105 return GetRegisterInfo()[reg].name;
106 return nullptr;
107}
virtual unsigned GetRegisterOffset(unsigned reg)
virtual unsigned GetRegisterSize(unsigned reg)
virtual const lldb_private::RegisterInfo * GetRegisterInfo()
const lldb_private::RegisterInfo * GetRegisterInfoAtIndex(size_t reg) override
~RegisterContextPOSIX_arm64() override
std::unique_ptr< RegisterInfoPOSIX_arm64 > m_register_info_up
RegisterContextPOSIX_arm64(lldb_private::Thread &thread, std::unique_ptr< RegisterInfoPOSIX_arm64 > register_info)
const char * GetRegisterName(unsigned reg)
const lldb_private::RegisterSet * GetRegisterSet(size_t set) override
A class that represents a running process on the host machine.
Definition: SBAddress.h:15