1 //===-- RegisterContextWindows.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_RegisterContextWindows_H_ 10 #define liblldb_RegisterContextWindows_H_ 11 12 #include "lldb/Target/RegisterContext.h" 13 #include "lldb/lldb-forward.h" 14 15 namespace lldb_private { 16 17 class Thread; 18 19 class RegisterContextWindows : public lldb_private::RegisterContext { 20 public: 21 // Constructors and Destructors 22 RegisterContextWindows(Thread &thread, uint32_t concrete_frame_idx); 23 24 virtual ~RegisterContextWindows(); 25 26 // Subclasses must override these functions 27 void InvalidateAllRegisters() override; 28 29 bool ReadAllRegisterValues(lldb::DataBufferSP &data_sp) override; 30 31 bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override; 32 33 uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, 34 uint32_t num) override; 35 36 bool HardwareSingleStep(bool enable) override; 37 GetNumHardwareBreakpointSlots()38 static constexpr uint32_t GetNumHardwareBreakpointSlots() { 39 return NUM_HARDWARE_BREAKPOINT_SLOTS; 40 } DoHardwareBreakpointsTriggerAfter()41 static constexpr bool DoHardwareBreakpointsTriggerAfter() { return true; } 42 43 bool AddHardwareBreakpoint(uint32_t slot, lldb::addr_t address, uint32_t size, 44 bool read, bool write); 45 bool RemoveHardwareBreakpoint(uint32_t slot); 46 47 uint32_t GetTriggeredHardwareBreakpointSlotId(); 48 49 protected: 50 static constexpr unsigned NUM_HARDWARE_BREAKPOINT_SLOTS = 4; 51 52 virtual bool CacheAllRegisterValues(); 53 virtual bool ApplyAllRegisterValues(); 54 55 CONTEXT m_context; 56 bool m_context_stale; 57 }; 58 } // namespace lldb_private 59 60 #endif // #ifndef liblldb_RegisterContextWindows_H_ 61