LLDB mainline
NativeRegisterContextWindows_arm64.h
Go to the documentation of this file.
1//===-- NativeRegisterContextWindows_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#if defined(__aarch64__) || defined(_M_ARM64)
10#ifndef liblldb_NativeRegisterContextWindows_arm64_h_
11#define liblldb_NativeRegisterContextWindows_arm64_h_
12
14
18
20
21namespace lldb_private {
22
24
25class NativeRegisterContextWindows_arm64
28public:
29 NativeRegisterContextWindows_arm64(const ArchSpec &target_arch,
30 NativeThreadProtocol &native_thread);
31
32 uint32_t GetRegisterSetCount() const override;
33
34 const RegisterSet *GetRegisterSet(uint32_t set_index) const override;
35
36 Status ReadRegister(const RegisterInfo *reg_info,
37 RegisterValue &reg_value) override;
38
39 Status WriteRegister(const RegisterInfo *reg_info,
40 const RegisterValue &reg_value) override;
41
42 Status ReadAllRegisterValues(lldb::WritableDataBufferSP &data_sp) override;
43
44 Status WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override;
45
46 void InvalidateAllRegisters() override;
47
48protected:
49 Status GPRRead(const uint32_t reg, RegisterValue &reg_value);
50
51 Status GPRWrite(const uint32_t reg, const RegisterValue &reg_value);
52
53 Status FPRRead(const uint32_t reg, RegisterValue &reg_value);
54
55 Status FPRWrite(const uint32_t reg, const RegisterValue &reg_value);
56
57private:
58 PCONTEXT m_context;
59 std::shared_ptr<DataBufferHeap> m_context_buffer;
60
61 bool IsGPR(uint32_t reg_index) const;
62
63 bool IsFPR(uint32_t reg_index) const;
64
65 llvm::Error ReadHardwareDebugInfo() override;
66
67 llvm::Error WriteHardwareDebugRegs(DREGType hwbType) override;
68
69 Status CacheAllRegisterValues();
70};
71
72} // namespace lldb_private
73
74#endif // liblldb_NativeRegisterContextWindows_arm64_h_
75#endif // defined(__aarch64__) || defined(_M_ARM64)
Status WriteHardwareDebugRegs(int hwbType, ::pid_t tid, uint32_t max_supported, const std::array< NativeRegisterContextDBReg::DREG, 16 > &regs)
Status ReadHardwareDebugInfo(::pid_t tid, uint32_t &max_hwp_supported, uint32_t &max_hbp_supported)
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
std::shared_ptr< lldb_private::WritableDataBuffer > WritableDataBufferSP