9#if defined(__loongarch__) && __loongarch_grlen == 64
11#ifndef lldb_NativeRegisterContextLinux_loongarch64_h
12#define lldb_NativeRegisterContextLinux_loongarch64_h
18#include <asm/ptrace.h>
25class NativeRegisterContextLinux_loongarch64
27 public NativeRegisterContextDBReg_loongarch {
29 NativeRegisterContextLinux_loongarch64(
30 const ArchSpec &target_arch, NativeThreadProtocol &native_thread,
31 std::unique_ptr<RegisterInfoPOSIX_loongarch64> register_info_up);
33 uint32_t GetRegisterSetCount()
const override;
35 uint32_t GetUserRegisterCount()
const override;
37 const RegisterSet *GetRegisterSet(uint32_t set_index)
const override;
39 Status ReadRegister(
const RegisterInfo *reg_info,
40 RegisterValue ®_value)
override;
42 Status WriteRegister(
const RegisterInfo *reg_info,
43 const RegisterValue ®_value)
override;
49 void InvalidateAllRegisters()
override;
52 GetExpeditedRegisters(ExpeditedRegs expType)
const override;
54 bool RegisterOffsetIsDynamic()
const override {
return true; }
59 Status WriteGPR()
override;
63 Status WriteFPR()
override;
73 void *GetGPRBuffer()
override {
return &m_gpr; }
75 void *GetFPRBuffer()
override {
return &m_fpr; }
77 size_t GetGPRSize()
const override {
return GetRegisterInfo().GetGPRSize(); }
79 size_t GetFPRSize()
override {
return GetRegisterInfo().GetFPRSize(); }
86 bool m_refresh_hwdebug_info;
88 RegisterInfoPOSIX_loongarch64::GPR m_gpr;
89 RegisterInfoPOSIX_loongarch64::FPR m_fpr;
90 RegisterInfoPOSIX_loongarch64::LSX m_lsx;
91 RegisterInfoPOSIX_loongarch64::LASX m_lasx;
93 bool IsGPR(
unsigned reg)
const;
95 bool IsFPR(
unsigned reg)
const;
97 bool IsLSX(
unsigned reg)
const;
99 bool IsLASX(
unsigned reg)
const;
101 uint32_t CalculateFprOffset(
const RegisterInfo *reg_info)
const;
103 uint32_t CalculateLsxOffset(
const RegisterInfo *reg_info)
const;
105 uint32_t CalculateLasxOffset(
const RegisterInfo *reg_info)
const;
107 const RegisterInfoPOSIX_loongarch64 &GetRegisterInfo()
const;
Manages communication with the inferior (debugee) process.
Status WriteHardwareDebugRegs(int hwbType, ::pid_t tid, uint32_t max_supported, const std::array< NativeRegisterContextDBReg::DREG, 16 > ®s)
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