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:
66
67 SVEState m_sve_state = SVEState::Unknown;
68 uint16_t m_sve_vector_length = 0;
69
70 // These are pseudo registers derived from the values in SSVE and ZA data.
71 struct __attribute__((packed)) sme_pseudo_regs {
72 uint64_t ctrl_reg;
73 uint64_t svg_reg;
74 };
75 static_assert(sizeof(sme_pseudo_regs) == 16);
76
77 struct sme_pseudo_regs m_sme_pseudo_regs;
78
80
81 const uint8_t *GetSVEBuffer(uint64_t offset = 0);
82
84
85 uint32_t CalculateSVEOffset(const lldb_private::RegisterInfo *reg_info);
86
87 uint64_t GetSVERegVG() { return m_sve_vector_length / 8; }
88};
89
90#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)
lldb_private::Arm64RegisterFlagsDetector m_register_flags_detector
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
bool ReadRegister(const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value) override
An architecture specification class.
Definition: ArchSpec.h:31
This class manages the storage and detection of register field information.
An data extractor class.
Definition: DataExtractor.h:48
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
Definition: lldb-forward.h:336
std::shared_ptr< lldb_private::WritableDataBuffer > WritableDataBufferSP
Definition: lldb-forward.h:337
Every register is described in detail including its name, alternate name (optional),...