Path: blob/main/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.h
96380 views
//===-- NativeRegisterContextFreeBSD_arm64.h --------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#if defined(__aarch64__)910#ifndef lldb_NativeRegisterContextFreeBSD_arm64_h11#define lldb_NativeRegisterContextFreeBSD_arm64_h1213// clang-format off14#include <sys/types.h>15#include <sys/param.h>16#include <machine/reg.h>17// clang-format on1819#include "Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.h"20#include "Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.h"21#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"2223#include <array>2425#if __FreeBSD_version >= 130013926# define LLDB_HAS_FREEBSD_WATCHPOINT 127#endif2829namespace lldb_private {30namespace process_freebsd {3132class NativeProcessFreeBSD;3334class NativeRegisterContextFreeBSD_arm6435: public NativeRegisterContextFreeBSD,36public NativeRegisterContextDBReg_arm64 {37public:38NativeRegisterContextFreeBSD_arm64(const ArchSpec &target_arch,39NativeThreadFreeBSD &native_thread);4041uint32_t GetRegisterSetCount() const override;4243uint32_t GetUserRegisterCount() const override;4445const RegisterSet *GetRegisterSet(uint32_t set_index) const override;4647Status ReadRegister(const RegisterInfo *reg_info,48RegisterValue ®_value) override;4950Status WriteRegister(const RegisterInfo *reg_info,51const RegisterValue ®_value) override;5253Status ReadAllRegisterValues(lldb::WritableDataBufferSP &data_sp) override;5455Status WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override;5657llvm::Error58CopyHardwareWatchpointsFrom(NativeRegisterContextFreeBSD &source) override;5960private:61// Due to alignment, FreeBSD reg/fpreg are a few bytes larger than62// LLDB's GPR/FPU structs. However, all fields have matching offsets63// and sizes, so we do not have to worry about these (and we have64// a unittest to assert that).65std::array<uint8_t, sizeof(reg) + sizeof(fpreg)> m_reg_data;66#ifdef LLDB_HAS_FREEBSD_WATCHPOINT67dbreg m_dbreg;68bool m_read_dbreg;69#endif7071Status ReadRegisterSet(uint32_t set);72Status WriteRegisterSet(uint32_t set);7374llvm::Error ReadHardwareDebugInfo() override;75llvm::Error WriteHardwareDebugRegs(DREGType hwbType) override;7677RegisterInfoPOSIX_arm64 &GetRegisterInfo() const;78};7980} // namespace process_freebsd81} // namespace lldb_private8283#endif // #ifndef lldb_NativeRegisterContextFreeBSD_arm64_h8485#endif // defined (__aarch64__)868788