LLDB mainline
RegisterContextPOSIXCore_arm64.h
Go to the documentation of this file.
1//===-- RegisterContextPOSIXCore_arm64.h ------------------------*- 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
9#ifndef LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_ARM64_H
10#define LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_ARM64_H
11
15
19
21public:
22 static std::unique_ptr<RegisterContextCorePOSIX_arm64>
24 const lldb_private::DataExtractor &gpregset,
25 llvm::ArrayRef<lldb_private::CoreNote> notes);
26
28
29 bool ReadRegister(const lldb_private::RegisterInfo *reg_info,
30 lldb_private::RegisterValue &value) override;
31
32 bool WriteRegister(const lldb_private::RegisterInfo *reg_info,
33 const lldb_private::RegisterValue &value) override;
34
36
37 bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override;
38
39 bool HardwareSingleStep(bool enable) override;
40
41protected:
44 std::unique_ptr<RegisterInfoPOSIX_arm64> register_info,
45 const lldb_private::DataExtractor &gpregset,
46 llvm::ArrayRef<lldb_private::CoreNote> notes);
47
48 bool ReadGPR() override;
49
50 bool ReadFPR() override;
51
52 bool WriteGPR() override;
53
54 bool WriteFPR() override;
55
56private:
65
66 SVEState m_sve_state = SVEState::Unknown;
67 uint16_t m_sve_vector_length = 0;
68
69 // These are pseudo registers derived from the values in SSVE and ZA data.
70 struct __attribute__((packed)) sme_pseudo_regs {
71 uint64_t ctrl_reg;
72 uint64_t svg_reg;
73 };
74 static_assert(sizeof(sme_pseudo_regs) == 16);
75
76 struct sme_pseudo_regs m_sme_pseudo_regs;
77
79
80 const uint8_t *GetSVEBuffer(uint64_t offset = 0);
81
83
84 uint32_t CalculateSVEOffset(const lldb_private::RegisterInfo *reg_info);
85
86 uint64_t GetSVERegVG() { return m_sve_vector_length / 8; }
87};
88
89#endif // LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_ARM64_H
struct __attribute__((packed)) sme_pseudo_regs
static std::unique_ptr< RegisterContextCorePOSIX_arm64 > Create(lldb_private::Thread &thread, const lldb_private::ArchSpec &arch, const lldb_private::DataExtractor &gpregset, llvm::ArrayRef< lldb_private::CoreNote > notes)
~RegisterContextCorePOSIX_arm64() override
uint32_t CalculateSVEOffset(const lldb_private::RegisterInfo *reg_info)
bool ReadAllRegisterValues(lldb::WritableDataBufferSP &data_sp) override
const uint8_t * GetSVEBuffer(uint64_t offset=0)
bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override
bool WriteRegister(const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &value) override
lldb_private::LinuxArm64RegisterFlags m_linux_register_flags
bool ReadRegister(const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value) override
An architecture specification class.
Definition: ArchSpec.h:31
An data extractor class.
Definition: DataExtractor.h:48
This class manages the storage and detection of register field information for Arm64 Linux registers.
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
Definition: lldb-forward.h:328
std::shared_ptr< lldb_private::WritableDataBuffer > WritableDataBufferSP
Definition: lldb-forward.h:329
Every register is described in detail including its name, alternate name (optional),...