1 //===-- RegisterContextPOSIXProcessMonitor_x86.h ----------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #ifndef liblldb_RegisterContextPOSIXProcessMonitor_x86_H_ 11 #define liblldb_RegisterContextPOSIXProcessMonitor_x86_H_ 12 13 #include "Plugins/Process/Utility/RegisterContextPOSIX_x86.h" 14 #include "RegisterContextPOSIX.h" 15 #include <sys/uio.h> 16 17 class RegisterContextPOSIXProcessMonitor_x86_64 18 : public RegisterContextPOSIX_x86, 19 public POSIXBreakpointProtocol { 20 public: 21 RegisterContextPOSIXProcessMonitor_x86_64( 22 lldb_private::Thread &thread, uint32_t concrete_frame_idx, 23 lldb_private::RegisterInfoInterface *register_info); 24 25 protected: 26 bool ReadGPR(); 27 28 bool ReadFPR(); 29 30 bool WriteGPR(); 31 32 bool WriteFPR(); 33 34 // lldb_private::RegisterContext 35 bool ReadRegister(const unsigned reg, lldb_private::RegisterValue &value); 36 37 bool WriteRegister(const unsigned reg, 38 const lldb_private::RegisterValue &value); 39 40 bool ReadRegister(const lldb_private::RegisterInfo *reg_info, 41 lldb_private::RegisterValue &value); 42 43 bool WriteRegister(const lldb_private::RegisterInfo *reg_info, 44 const lldb_private::RegisterValue &value); 45 46 bool ReadAllRegisterValues(lldb::DataBufferSP &data_sp); 47 48 bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp); 49 50 uint32_t SetHardwareWatchpoint(lldb::addr_t addr, size_t size, bool read, 51 bool write); 52 53 bool ClearHardwareWatchpoint(uint32_t hw_index); 54 55 bool HardwareSingleStep(bool enable); 56 57 // POSIXBreakpointProtocol 58 bool UpdateAfterBreakpoint(); 59 60 unsigned GetRegisterIndexFromOffset(unsigned offset); 61 62 bool IsWatchpointHit(uint32_t hw_index); 63 64 bool ClearWatchpointHits(); 65 66 lldb::addr_t GetWatchpointAddress(uint32_t hw_index); 67 68 bool IsWatchpointVacant(uint32_t hw_index); 69 70 bool SetHardwareWatchpointWithIndex(lldb::addr_t addr, size_t size, bool read, 71 bool write, uint32_t hw_index); 72 73 uint32_t NumSupportedHardwareWatchpoints(); 74 75 private: 76 ProcessMonitor &GetMonitor(); 77 uint32_t 78 m_fctrl_offset_in_userarea; // Offset of 'fctrl' in 'UserArea' Structure 79 struct iovec m_iovec; 80 }; 81 82 #endif 83