1 //===-- RegisterContextPOSIXProcessMonitor_arm.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 liblldb_RegisterContextPOSIXProcessMonitor_arm_H_ 10 #define liblldb_RegisterContextPOSIXProcessMonitor_arm_H_ 11 12 #include "Plugins/Process/Utility/RegisterContextPOSIX_arm.h" 13 #include "RegisterContextPOSIX.h" 14 15 class RegisterContextPOSIXProcessMonitor_arm : public RegisterContextPOSIX_arm, 16 public POSIXBreakpointProtocol { 17 public: 18 RegisterContextPOSIXProcessMonitor_arm( 19 lldb_private::Thread &thread, 20 std::unique_ptr<RegisterInfoPOSIX_arm> register_info); 21 22 protected: 23 bool ReadGPR() override; 24 25 bool ReadFPR() override; 26 27 bool WriteGPR() override; 28 29 bool WriteFPR() override; 30 31 // lldb_private::RegisterContext 32 bool ReadRegister(const unsigned reg, lldb_private::RegisterValue &value); 33 34 bool WriteRegister(const unsigned reg, 35 const lldb_private::RegisterValue &value); 36 37 bool ReadRegister(const lldb_private::RegisterInfo *reg_info, 38 lldb_private::RegisterValue &value) override; 39 40 bool WriteRegister(const lldb_private::RegisterInfo *reg_info, 41 const lldb_private::RegisterValue &value) override; 42 43 bool ReadAllRegisterValues(lldb::DataBufferSP &data_sp) override; 44 45 bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override; 46 47 uint32_t SetHardwareWatchpoint(lldb::addr_t addr, size_t size, bool read, 48 bool write) override; 49 50 bool ClearHardwareWatchpoint(uint32_t hw_index) override; 51 52 bool HardwareSingleStep(bool enable) override; 53 54 // POSIXBreakpointProtocol 55 bool UpdateAfterBreakpoint() override; 56 57 unsigned GetRegisterIndexFromOffset(unsigned offset) override; 58 59 bool IsWatchpointHit(uint32_t hw_index) override; 60 61 bool ClearWatchpointHits() override; 62 63 lldb::addr_t GetWatchpointAddress(uint32_t hw_index) override; 64 65 bool IsWatchpointVacant(uint32_t hw_index) override; 66 67 bool SetHardwareWatchpointWithIndex(lldb::addr_t addr, size_t size, bool read, 68 bool write, uint32_t hw_index) override; 69 70 uint32_t NumSupportedHardwareWatchpoints() override; 71 72 private: 73 RegisterInfoPOSIX_arm::GPR m_gpr_arm; 74 75 RegisterInfoPOSIX_arm::FPU m_fpr; 76 77 ProcessMonitor &GetMonitor(); 78 }; 79 80 #endif 81